Enable single click expansion on Quicktoolbar categories
This commit is contained in:
parent
7f444c8c96
commit
db658fddf7
2 changed files with 12 additions and 0 deletions
|
@ -332,6 +332,9 @@ CommandBarListTree::CommandBarListTree(QWidget* parent) : QTreeWidget(parent) {
|
|||
CommandBarSeparatorItem* sep = new CommandBarSeparatorItem(0);
|
||||
sep->setToolTip(0, QObject::tr("[Drag&Drop] to copy separator to toolbar"));
|
||||
addTopLevelItem(sep);
|
||||
|
||||
connect(this, SIGNAL(clicked(const QModelIndex&)), this,
|
||||
SLOT(onItemClicked(const QModelIndex&)));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -457,6 +460,12 @@ void CommandBarListTree::searchItems(const QString& searchWord) {
|
|||
update();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void CommandBarListTree::onItemClicked(const QModelIndex& index) {
|
||||
isExpanded(index) ? collapse(index) : expand(index);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// CommandBarPopup
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -52,6 +52,9 @@ public:
|
|||
|
||||
void searchItems(const QString& searchWord = QString());
|
||||
|
||||
public slots:
|
||||
void onItemClicked(const QModelIndex&);
|
||||
|
||||
private:
|
||||
void displayAll(QTreeWidgetItem* item);
|
||||
void hideAll(QTreeWidgetItem* item);
|
||||
|
|
Loading…
Reference in a new issue