db backend: mostly feature-complete
This commit is contained in:
parent
872bb95acf
commit
0afe9ca6bf
12 changed files with 497 additions and 160 deletions
31
tagitem.cpp
Normal file
31
tagitem.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include "tagitem.h"
|
||||
|
||||
TagItem::TagItem(const Tag &tag)
|
||||
: valid(true)
|
||||
{
|
||||
setFlags(QGraphicsItem::ItemIsMovable
|
||||
| QGraphicsItem::ItemIsSelectable
|
||||
| QGraphicsItem::ItemIsFocusable);
|
||||
/* TODO text_it.setFlags(QGraphicsItem::ItemIgnoresTransformations);
|
||||
*/
|
||||
tagUpdated(tag);
|
||||
}
|
||||
|
||||
void TagItem::tagUpdated(const Tag &tag)
|
||||
{
|
||||
m_tag = tag;
|
||||
setText(tag.name);
|
||||
setPos(tag.anchor);
|
||||
}
|
||||
|
||||
QVariant TagItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == ItemPositionChange) {
|
||||
/* https://gist.github.com/csukuangfj/c2a06416062bec9ed99eddd705c21275#file-qgraphicsscenetest-cpp-L90
|
||||
*
|
||||
*/
|
||||
/* FIXME */
|
||||
|
||||
}
|
||||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue