diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-09 04:14:46 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-18 17:23:48 -0500 |
| commit | 3db95eb4043b8da20e99dd7476bc82468a4609fb (patch) | |
| tree | 257af3a4acd74b09713420cf184dffa77f6ab68d /src/mainwindow.cpp | |
| parent | 0c62a26e09fc293d7ab3a6ac8527c067d85f7773 (diff) | |
customizable columns for mod and plugin lists
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0efb043b..3e03c52d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5818,38 +5818,6 @@ void MainWindow::extractBSATriggered() } } - -void MainWindow::displayColumnSelection(const QPoint &pos) -{ - QMenu menu; - - // display a list of all headers as checkboxes - QAbstractItemModel *model = ui->modList->header()->model(); - for (int i = 1; i < model->columnCount(); ++i) { - QString columnName = model->headerData(i, Qt::Horizontal).toString(); - QCheckBox *checkBox = new QCheckBox(&menu); - checkBox->setText(columnName); - checkBox->setChecked(!ui->modList->header()->isSectionHidden(i)); - QWidgetAction *checkableAction = new QWidgetAction(&menu); - checkableAction->setDefaultWidget(checkBox); - menu.addAction(checkableAction); - } - menu.exec(pos); - - // view/hide columns depending on check-state - int i = 1; - for (const QAction *action : menu.actions()) { - const QWidgetAction *widgetAction = qobject_cast<const QWidgetAction*>(action); - if (widgetAction != nullptr) { - const QCheckBox *checkBox = qobject_cast<const QCheckBox*>(widgetAction->defaultWidget()); - if (checkBox != nullptr) { - ui->modList->header()->setSectionHidden(i, !checkBox->isChecked()); - } - } - ++i; - } -} - void MainWindow::on_bsaList_customContextMenuRequested(const QPoint &pos) { m_ContextItem = ui->bsaList->itemAt(pos); |
