GUI: Added ui file for the selectfilesdialog

This commit is contained in:
Daniel Marjamäki 2012-01-11 21:32:52 +01:00
parent 833f9af107
commit feb187cb02
4 changed files with 94 additions and 23 deletions

View File

@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = cppcheck-gui
CONFIG += warn_on
CONFIG += warn_on debug
DEPENDPATH += . \
../lib
INCLUDEPATH += . \
@ -30,7 +30,8 @@ FORMS = about.ui \
projectfile.ui \
resultsview.ui \
settings.ui \
stats.ui
stats.ui \
selectfilesdialog.ui
TRANSLATIONS = cppcheck_de.ts \
cppcheck_en.ts \

View File

@ -1,5 +1,6 @@
#include "selectfilesdialog.h"
#include "ui_selectfilesdialog.h"
#include <QTreeView>
#include <QVBoxLayout>
@ -100,26 +101,20 @@ public:
}
};
SelectFilesDialog::SelectFilesDialog(QWidget *w) : QDialog(w)
{
setModal(true);
resize(300,400);
QTreeView *treeView = new QTreeView(this);
treeView->setModel(new SelectFilesModel);
for (int i = 1; i < 4; ++i)
treeView->setColumnHidden(i, true);
QPushButton *cancel = new QPushButton("Cancel", this);
connect(cancel,SIGNAL(clicked()),this,SLOT(accept()));
setLayout(new QVBoxLayout(this));
layout()->addWidget(treeView);
layout()->addWidget(cancel);
SelectFilesDialog::~SelectFilesDialog() {
delete ui;
}
SelectFilesDialog::SelectFilesDialog(QWidget *w) :
QDialog(w),
ui(new Ui::SelectFilesDialog)
{
ui->setupUi(this);
ui->treeView->setModel(new SelectFilesModel);
for (int i = 1; i < 4; ++i)
ui->treeView->setColumnHidden(i, true);
}

View File

@ -4,9 +4,17 @@
#include <QDialog>
namespace Ui {
class SelectFilesDialog;
}
class SelectFilesDialog : public QDialog {
public:
SelectFilesDialog(QWidget *w);
explicit SelectFilesDialog(QWidget *w);
~SelectFilesDialog();
private:
Ui::SelectFilesDialog *ui;
};
#endif

67
gui/selectfilesdialog.ui Normal file
View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SelectFilesDialog</class>
<widget class="QDialog" name="SelectFilesDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTreeView" name="treeView"/>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>SelectFilesDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SelectFilesDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>