tuchulcha  0.10.1
Graphical Workflow Configuration Editor
PriorityDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2012 David Stronczek
2 
3  This file is part of Tuchulcha.
4 
5  Tuchulcha is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Tuchulcha is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Tuchulcha. If not, see <http://www.gnu.org/licenses/>.
17 */
24 #include "PriorityDialog.h"
25 #include "ui_PriorityDialog.h"
26 
27 #include <QDialog>
28 
29 PriorityDialog::PriorityDialog(QWidget* pp, int sel) :
30  QDialog(pp)
31 {
32  _ui = new Ui::PriorityDialog;
33  _ui->setupUi(this);
34 
35  _selection = sel;
36  _ui->priorityBox->setCurrentIndex(sel);
37 }
38 
40  delete _ui;
41 }
42 
44  return _selection;
45 }
46 
48  _selection = _ui->priorityBox->currentIndex();
49  QDialog::accept();
50 }
51 
52 void PriorityDialog::on_buttonBox_clicked(QAbstractButton* button) const {
53  switch (_ui->buttonBox->buttonRole(button)) {
54  case QDialogButtonBox::ResetRole:
55  _ui->priorityBox->setCurrentIndex(0);
56  break;
57  default:
58  break;
59  }
60 }
PriorityDialog(QWidget *parent=0, int selection=0)
Default constructor, setting parent widget.
int selection() const
Get selected index.
int _selection
var to store selection
virtual void accept()
set selection value
Ui::PriorityDialog * _ui
designer gui
virtual ~PriorityDialog()
default destructor
void on_buttonBox_clicked(QAbstractButton *button) const
handle buttonBox clicks
Declaration of class PriorityDialog.