FFSM++
1.1.0
French Forest Sector Model ++
Loading...
Searching...
No Matches
ScenarioSelectionWidget.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
* Copyright (C) 2015 by Laboratoire d'Economie Forestière *
3
* http://ffsm-project.org *
4
* *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU 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, given the compliance with the *
9
* exceptions listed in the file COPYING that is distribued together *
10
* with this file. *
11
* *
12
* This program is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
16
* *
17
* You should have received a copy of the GNU General Public License *
18
* along with this program; if not, write to the *
19
* Free Software Foundation, Inc., *
20
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
***************************************************************************/
22
23
//#include <QtGui> // Qt4
24
#include <QtWidgets>
// Qt5
25
26
27
#include "
ScenarioSelectionWidget.h
"
28
29
ScenarioSelectionWidget::ScenarioSelectionWidget
(QWidget *parent): QDialog(parent) {
30
31
label
=
new
QLabel(tr(
"Select the scenario you want to run..."
));
32
scenarioSelector
=
new
QComboBox();
33
QVBoxLayout *mainLayout =
new
QVBoxLayout;
34
mainLayout->addWidget(
label
);
35
mainLayout->addWidget(
scenarioSelector
);
36
setLayout(mainLayout);
37
setWindowTitle(tr(
"Scenario selection"
));
38
setFixedHeight(sizeHint().height());
39
40
//connect(scenarioSelector, SIGNAL( activated(const QString&)), this, SLOT( processSelectedScenario(const QString &) ));
41
//connect(scenarioSelector, SIGNAL( activated(const QString&)), this, SLOT( close()));
42
43
}
44
45
ScenarioSelectionWidget::~ScenarioSelectionWidget
(){
46
}
47
48
49
void
50
ScenarioSelectionWidget::receiveScenarioOptions
(
const
QVector<QString> &scenarios_h){
51
scenarioSelector
->clear();
52
for
(uint i=0; i< scenarios_h.size();i++){
53
scenarioSelector
->addItem(scenarios_h.at(i));
54
}
55
//scenarioSelector->setFocus(); // may be not visible, no effect!
56
//scenarioSelector->grabMouse();
57
//scenarioSelector->grabKeyboard();
58
}
59
60
/*
61
void
62
ScenarioSelectionWidget::processSelectedScenario(const QString &scenario_h){
63
emit selectedScenarioName(scenario_h);
64
}
65
66
*/
67
68
ScenarioSelectionWidget.h
ScenarioSelectionWidget::scenarioSelector
QComboBox * scenarioSelector
Definition
ScenarioSelectionWidget.h:43
ScenarioSelectionWidget::label
QLabel * label
Definition
ScenarioSelectionWidget.h:46
ScenarioSelectionWidget::~ScenarioSelectionWidget
~ScenarioSelectionWidget()
Definition
ScenarioSelectionWidget.cpp:45
ScenarioSelectionWidget::ScenarioSelectionWidget
ScenarioSelectionWidget(QWidget *parent=0)
Definition
ScenarioSelectionWidget.cpp:29
ScenarioSelectionWidget::receiveScenarioOptions
void receiveScenarioOptions(const QVector< QString > &scenarios_h)
Definition
ScenarioSelectionWidget.cpp:50