diff options
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreeitemdelegate.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreeitemdelegate.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreeitemdelegate.h b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreeitemdelegate.h new file mode 100644 index 0000000..43eeac2 --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreeitemdelegate.h @@ -0,0 +1,28 @@ +#ifndef DBTREEITEMDELEGATE_H +#define DBTREEITEMDELEGATE_H + +#include "guiSQLiteStudio_global.h" +#include <QStyledItemDelegate> + +class DbTreeItem; + +class GUI_API_EXPORT DbTreeItemDelegate : public QStyledItemDelegate +{ + Q_OBJECT + + public: + explicit DbTreeItemDelegate(QObject *parent = 0); + + QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const; + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; + + private: + void paintDb(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, DbTreeItem* item) const; + void paintChildCount(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, DbTreeItem* item) const; + void paintTableLabel(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, DbTreeItem* item) const; + void paintVirtualTableLabel(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index, DbTreeItem* item) const; + void paintSystemIndexLabel(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, DbTreeItem* item) const; + void paintLabel(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, DbTreeItem* item, const QString& label) const; +}; + +#endif // DBTREEITEMDELEGATE_H |
