From d908894265df8fc11dc6102b92e888751c0dfff6 Mon Sep 17 00:00:00 2001 From: Maxim Stewart <1itdominator@gmail.com> Date: Thu, 15 Jun 2017 22:31:11 -0500 Subject: [PATCH] Added add and remove functionality to settings listWidget --- QtMeshViewer/Form Files/SettingsWindow.ui | 6 +++--- QtMeshViewer/Source/MainWindow.cpp | 1 + QtMeshViewer/Source/SettingsWindow.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/QtMeshViewer/Form Files/SettingsWindow.ui b/QtMeshViewer/Form Files/SettingsWindow.ui index a916145..21b5341 100644 --- a/QtMeshViewer/Form Files/SettingsWindow.ui +++ b/QtMeshViewer/Form Files/SettingsWindow.ui @@ -489,9 +489,6 @@ General - - - @@ -556,6 +553,9 @@ + + + diff --git a/QtMeshViewer/Source/MainWindow.cpp b/QtMeshViewer/Source/MainWindow.cpp index 508dfd0..52cd349 100644 --- a/QtMeshViewer/Source/MainWindow.cpp +++ b/QtMeshViewer/Source/MainWindow.cpp @@ -410,3 +410,4 @@ void MainWindow::setFileInfo(QString name, QVector* materials, int ver m_infoWindow->setDetailText(QString(m_fileInfo.right(m_fileInfo.size() - m_fileInfo.indexOf("") - 8))); } + diff --git a/QtMeshViewer/Source/SettingsWindow.cpp b/QtMeshViewer/Source/SettingsWindow.cpp index 8e889f5..9f16dee 100644 --- a/QtMeshViewer/Source/SettingsWindow.cpp +++ b/QtMeshViewer/Source/SettingsWindow.cpp @@ -1,6 +1,8 @@ #include "..\Header\SettingsWindow.h" #include "..\Header\SettingsManager.h" #include +#include + ///////////////////////////////////////////////////////////////////////// // constructor/destructor @@ -195,12 +197,10 @@ void SettingsWindow::on_addItem_clicked() QString dirName = QFileDialog::getExistingDirectory(this, tr("Open Directory"), "/home", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); -// ui->dirListView-> selectionModel()-> -// ui->dirListView->model()->insertRow(dirName) ; //->insertRow(dirName); + ui->dirListWidget->insertItem(0,dirName); } void SettingsWindow::on_removeItem_clicked() { - ui->dirListView->selectionModel()->selectedIndexes(); -// ui->dirListView->model()->removeRow(ui->dirListView->selectionModel()->selectedIndexes()); + qDeleteAll(ui->dirListWidget->selectedItems()); }