All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ProjectInfoDialog.cpp
Go to the documentation of this file.
1 #include "ProjectInfoDialog.h"
2 #include "ProjectInfoWidget.h"
3 
4 // Qt
5 #include <QPushButton>
6 #include <QHBoxLayout>
7 #include <QVBoxLayout>
8 #include <QGridLayout>
9 
11 QDialog(parent)
12 {
13  QDialog::setWindowTitle(tr("Project Properties"));
14  QDialog::setWindowModality(Qt::ApplicationModal);
15 
16  //Buttons
17  QPushButton* okButton = new QPushButton(tr("&Ok"), this);
18  QPushButton* cancelButton = new QPushButton(tr("&Cancel"), this);
19  QPushButton* helpButton = new QPushButton(tr("&Help"), this);
20 
21  QHBoxLayout* hlay = new QHBoxLayout;
22 
23  hlay->addWidget(helpButton);
24  hlay->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum));
25  hlay->addWidget(okButton);
26  hlay->addWidget(cancelButton);
27  // --------------------------------------------------------------------
28 
29  // Project info
30  m_info = new ProjectInfoWidget(this);
31 
32  QVBoxLayout* vlay = new QVBoxLayout;
33 
34  vlay->addWidget(m_info);
35  vlay->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum));
36  vlay->addLayout(hlay);
37 
38  QGridLayout* grd = new QGridLayout(this);
39  grd->addLayout(vlay, 0, 0, 1, 1);
40  // --------------------------------------------------------------------
41 
42  // Signal/Slot Connections
43  connect(okButton, SIGNAL(pressed()), SLOT(onOkPushButtonPressed()));
44  connect(cancelButton, SIGNAL(pressed()), SLOT(reject()));
45  connect(helpButton, SIGNAL(pressed()), SLOT(onHelpPushButtonPressed()));
46 }
47 
49 {
50 }
51 
53 {
54  m_info->setProject(proj);
55 }
56 
58 {
59  m_info->updateProjectInfo();
60  QDialog::accept();
61 }
62 
64 {
65 }
Contains a widget for define Project informations.
A widget for present te::qt::af::Project informations.
void onOkPushButtonPressed()
Called on ok button pressed.
A dialog for edition of te::qt::af::Project informations.
void onHelpPushButtonPressed()
Called on help button pressed.
ProjectInfoWidget * m_info
Pointer to the widget that contains information about te::qt::af::Project.
This class models the concept of a project for the TerraLib Application Framework.
Definition: Project.h:50
ProjectInfoDialog(QWidget *parent=0)
Constructor.
void setProject(Project *proj)
Sets the project to be inspected.