From cf7d23694c6b26390b55f8b9c9a56cfc43aaac10 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Mon, 29 Mar 2021 20:59:30 -0400 Subject: [PATCH] Added checkboxes to enable/disable hot keys. --- src/drivers/Qt/HotKeyConf.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/drivers/Qt/HotKeyConf.cpp b/src/drivers/Qt/HotKeyConf.cpp index 0e212aca..d1b82205 100644 --- a/src/drivers/Qt/HotKeyConf.cpp +++ b/src/drivers/Qt/HotKeyConf.cpp @@ -55,6 +55,7 @@ HotKeyConfDialog_t::HotKeyConfDialog_t(QWidget *parent) tree = new HotKeyConfTree_t(this); tree->setColumnCount(2); + tree->setSelectionMode( QAbstractItemView::SingleSelection ); item = new QTreeWidgetItem(); item->setText(0, QString::fromStdString("Command")); @@ -76,7 +77,10 @@ HotKeyConfDialog_t::HotKeyConfDialog_t(QWidget *parent) item = new QTreeWidgetItem(); + tree->addTopLevelItem(item); + item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemNeverHasChildren ); + item->setCheckState( 0, Qt::Checked ); item->setText(0, QString::fromStdString(optionName)); item->setText(1, QString::fromStdString(keyName)); @@ -84,7 +88,6 @@ HotKeyConfDialog_t::HotKeyConfDialog_t(QWidget *parent) item->setTextAlignment(0, Qt::AlignLeft); item->setTextAlignment(1, Qt::AlignCenter); - tree->addTopLevelItem(item); } mainLayout->addWidget(tree);