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 #include <QDialog>
10 
12 QDialog(parent)
13 {
14  QDialog::setWindowTitle(tr("Project Properties"));
15  QDialog::setWindowModality(Qt::ApplicationModal);
16 
17  //Buttons
18  QPushButton* okButton = new QPushButton(tr("&Ok"), this);
19  QPushButton* cancelButton = new QPushButton(tr("&Cancel"), this);
20  QPushButton* helpButton = new QPushButton(tr("&Help"), this);
21 
22  QHBoxLayout* hlay = new QHBoxLayout;
23 
24  hlay->addWidget(helpButton);
25  hlay->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum));
26  hlay->addWidget(okButton);
27  hlay->addWidget(cancelButton);
28  // --------------------------------------------------------------------
29 
30  // Project info
31  m_info = new ProjectInfoWidget(this);
32 
33  QVBoxLayout* vlay = new QVBoxLayout;
34 
35  vlay->addWidget(m_info);
36  vlay->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum));
37  vlay->addLayout(hlay);
38 
39  QGridLayout* grd = new QGridLayout(this);
40  grd->addLayout(vlay, 0, 0, 1, 1);
41  // --------------------------------------------------------------------
42 
43  // Signal/Slot Connections
44  connect(okButton, SIGNAL(pressed()), SLOT(onOkPushButtonPressed()));
45  connect(cancelButton, SIGNAL(pressed()), SLOT(reject()));
46  connect(helpButton, SIGNAL(pressed()), SLOT(onHelpPushButtonPressed()));
47 }
48 
50 
52 {
53  m_info->setProject(proj);
54 }
55 
57 {
59  QDialog::accept();
60 }
61 
63 {
64 }
Contains a widget for define Project informations.
~ProjectInfoDialog()
Destructor.
void onHelpPushButtonPressed()
Called on help button pressed.
void setProject(ProjectMetadata *proj)
Updates the te::qt::af::Project being visualized.
void onOkPushButtonPressed()
Called on ok button pressed.
A dialog for edition of Project informations.
void updateProjectInfo()
Updates the te::qt::af::Project informations.
ProjectInfoWidget * m_info
Pointer to the widget that contains information about te::qt::af::Project.
A widget for present te::qt::af::Project informations.
ProjectInfoDialog(QWidget *parent=0)
Constructor.
void setProject(ProjectMetadata *proj)
Sets the project to be inspected.