Added add and remove functionality to settings listWidget
This commit is contained in:
parent
bddc7ea852
commit
d908894265
|
@ -489,9 +489,6 @@
|
|||
<string>General</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QListView" name="dirListView"/>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
@ -556,6 +553,9 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QListWidget" name="dirListWidget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -410,3 +410,4 @@ void MainWindow::setFileInfo(QString name, QVector<Material>* materials, int ver
|
|||
m_infoWindow->setDetailText(QString(m_fileInfo.right(m_fileInfo.size() - m_fileInfo.indexOf("<detail>") - 8)));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "..\Header\SettingsWindow.h"
|
||||
#include "..\Header\SettingsManager.h"
|
||||
#include <QFileDialog>
|
||||
#include <QListWidgetItem>
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// 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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue