leocad/qt/lc_qpartstree.h

41 lines
701 B
C
Raw Normal View History

2013-08-09 06:57:18 +02:00
#ifndef LC_QPARTSTREE_H
#define LC_QPARTSTREE_H
#include <QTreeWidget>
class PieceInfo;
class lcQPartsTree : public QTreeWidget
{
Q_OBJECT
public:
explicit lcQPartsTree(QWidget *parent = 0);
QSize sizeHint() const;
void startDrag(Qt::DropActions supportedActions);
void updateCategories();
2014-12-24 16:52:52 +01:00
void UpdateModels();
2013-08-09 06:57:18 +02:00
void searchParts(const QString& searchString);
void setCurrentPart(PieceInfo *part);
enum
{
2014-12-24 16:52:52 +01:00
PieceInfoRole = Qt::UserRole,
2013-08-09 06:57:18 +02:00
CategoryRole,
ExpandedOnceRole
};
protected:
bool event(QEvent *event);
2013-08-09 06:57:18 +02:00
public slots:
void itemExpanded(QTreeWidgetItem *item);
private:
2014-12-24 16:52:52 +01:00
QTreeWidgetItem* mModelListItem;
QTreeWidgetItem* mSearchResultsItem;
2013-08-09 06:57:18 +02:00
};
#endif // LC_QPARTSTREE_H