mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
update dicttreemodel
This commit is contained in:
parent
8f09e187de
commit
4466499ae8
@ -83,7 +83,7 @@ public:
|
|||||||
QTextOption o;
|
QTextOption o;
|
||||||
o.setAlignment ( Qt::AlignLeft | Qt::AlignVCenter );
|
o.setAlignment ( Qt::AlignLeft | Qt::AlignVCenter );
|
||||||
QRect localRect2 ( option.rect );
|
QRect localRect2 ( option.rect );
|
||||||
localRect2.setLeft ( localRect2.left() + localRect.height() );
|
localRect2.setLeft ( localRect2.left() + localRect2.height() );
|
||||||
painter->drawText ( localRect2, QString ( "%1" ).arg ( value ), o );
|
painter->drawText ( localRect2, QString ( "%1" ).arg ( value ), o );
|
||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
@ -45,6 +45,26 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QQtDictionary* pdict;
|
QQtDictionary* pdict;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// QAbstractItemModel interface
|
||||||
|
// 一般EditRole和DisplayRole保存一样的数据。
|
||||||
|
public:
|
||||||
|
virtual QVariant data ( const QModelIndex& index, int role ) const override {
|
||||||
|
//根据index的column从字典中获取数据返回。
|
||||||
|
if ( !pdict )
|
||||||
|
return QVariant();
|
||||||
|
|
||||||
|
//返回默认的也可以,二选一。
|
||||||
|
}
|
||||||
|
virtual bool setData ( const QModelIndex& index, const QVariant& value, int role ) override {
|
||||||
|
//根据index的column向字典中设置数据。
|
||||||
|
if ( !pdict )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
//返回默认的也可以,二选一。
|
||||||
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QQTDICTTREEMODEL_H
|
#endif // QQTDICTTREEMODEL_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user