Setting up removing and adding stuff to the settings window dirlistview

This commit is contained in:
Maxim Stewart 2017-05-31 03:09:20 -05:00
parent e768ae9af8
commit 0372a4ad8c
5 changed files with 90 additions and 48 deletions

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>400</width>
<height>358</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -359,6 +359,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="7" colspan="2">
<widget class="QCheckBox" name="checkHeadlight">
<property name="text">
<string>Headlight</string>
</property>
</widget>
</item>
<item row="0" column="4" colspan="3">
<widget class="QRadioButton" name="radioPointLight">
<property name="text">
<string>Point light</string>
</property>
</widget>
</item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QSlider" name="light_R_S"> <widget class="QSlider" name="light_R_S">
<property name="maximum"> <property name="maximum">
@ -466,20 +480,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="7" colspan="2">
<widget class="QCheckBox" name="checkHeadlight">
<property name="text">
<string>Headlight</string>
</property>
</widget>
</item>
<item row="0" column="4" colspan="3">
<widget class="QRadioButton" name="radioPointLight">
<property name="text">
<string>Point light</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -489,6 +489,16 @@
<string>General</string> <string>General</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <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">
<string>Directory Drop Down List:</string>
</property>
</widget>
</item>
<item row="1" column="3"> <item row="1" column="3">
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
@ -532,21 +542,22 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="4" column="1">
<widget class="QPushButton" name="addItem">
<property name="text">
<string>+</string>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="2">
<spacer name="verticalSpacer"> <widget class="QPushButton" name="removeItem">
<property name="orientation"> <property name="text">
<enum>Qt::Vertical</enum> <string>--</string>
</property> </property>
<property name="sizeHint" stdset="0"> </widget>
<size> </item>
<width>20</width> </layout>
<height>40</height> </widget>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@ -49,6 +49,8 @@ public:
bool isLight() const; bool isLight() const;
QString getListOfDirs(); QString getListOfDirs();
void setListOfDirs(QString);
int getLightType() const; int getLightType() const;
QVector3D getLightColor() const; QVector3D getLightColor() const;
float getAttenuation() const; float getAttenuation() const;

View File

@ -18,6 +18,9 @@ private:
void setupConnections(); void setupConnections();
private:
QString dirList;
private slots: private slots:
void autoColorToggled(); void autoColorToggled();
void radioToggled(); void radioToggled();
@ -25,6 +28,9 @@ private slots:
void backgroundColorOnChanged(); void backgroundColorOnChanged();
void lightColorChanged(); void lightColorChanged();
void on_addItem_clicked();
void on_removeItem_clicked();
signals: signals:
void updateBGColorOff(QVector3D value); void updateBGColorOff(QVector3D value);
void updateBGColorOn(QVector3D value); void updateBGColorOn(QVector3D value);

View File

@ -130,6 +130,12 @@ QString SettingsManager::getListOfDirs()
return listOfDirs; return listOfDirs;
} }
void SettingsManager::setListOfDirs(QString newDirSet)
{
listOfDirs = newDirSet;
}
QVector3D SettingsManager::getBgColorOn() const QVector3D SettingsManager::getBgColorOn() const
{ {
return m_bgColorOn; return m_bgColorOn;

View File

@ -1,6 +1,6 @@
#include "..\Header\SettingsWindow.h" #include "..\Header\SettingsWindow.h"
#include "..\Header\SettingsManager.h" #include "..\Header\SettingsManager.h"
#include <QFileDialog>
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// constructor/destructor // constructor/destructor
@ -65,9 +65,11 @@ SettingsWindow::~SettingsWindow()
QString SettingsWindow::getDirList() QString SettingsWindow::getDirList()
{ {
return SettingsManager::getInstance()->getListOfDirs(); dirList = SettingsManager::getInstance()->getListOfDirs();
}
// ui->dirListView->
return dirList;
}
void SettingsWindow::setupConnections() void SettingsWindow::setupConnections()
{ {
@ -187,3 +189,18 @@ void SettingsWindow::lightColorChanged()
ui->lightOn_B_S->setValue((int)(ui->light_B_S->value() / 50)); ui->lightOn_B_S->setValue((int)(ui->light_B_S->value() / 50));
} }
} }
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);
}
void SettingsWindow::on_removeItem_clicked()
{
ui->dirListView->selectionModel()->selectedIndexes();
// ui->dirListView->model()->removeRow(ui->dirListView->selectionModel()->selectedIndexes());
}