Qt Virtual Chart Table (QVCT)
CVesselContainerDeviceCreateView.cpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 // QT
20 #include <QDialogButtonBox>
21 #include <QFormLayout>
22 #include <QHBoxLayout>
23 #include <QLabel>
24 #include <QLineEdit>
25 #include <QSpinBox>
26 #include <QVBoxLayout>
27 
28 // QVCT
31 
32 
33 //------------------------------------------------------------------------------
34 // CONSTRUCTORS / DESTRUCTOR
35 //------------------------------------------------------------------------------
36 
38  : QDialog( 0 )
39  , ppoVesselContainerDevice( _ppoVesselContainerDevice )
40 {
41  QDialog::setWindowTitle( tr("Create Device")+"..." );
44 }
45 
47 {
48  // Create layout
49  QVBoxLayout* __pqVBoxLayout = new QVBoxLayout();
50 
51  // Add form
52  QHBoxLayout* __pqHBoxLayout = new QHBoxLayout();
53  // ... icon
54  QLabel* __pqLabelIcon = new QLabel();
55  __pqLabelIcon->setPixmap( QPixmap( ":icons/32x32/vessel_device.png" ) );
56  __pqHBoxLayout->addWidget( __pqLabelIcon, 0 );
57  // ... form
58  QFormLayout* __pqFormLayout = new QFormLayout();
59  // ... name
60  pqLineEditName = new QLineEdit();
61  pqLineEditName->setToolTip( tr("Device name (matching one of the defined devices)") );
62  __pqFormLayout->addRow( tr("Device")+":", pqLineEditName );
63  // ... [end]
64  __pqHBoxLayout->addLayout( __pqFormLayout, 1 );
65  __pqVBoxLayout->addLayout( __pqHBoxLayout );
66 
67  // Add buttons
68  QDialogButtonBox* __pqDialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Cancel|QDialogButtonBox::Ok, Qt::Horizontal );
69  QDialog::connect( __pqDialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()) );
70  QDialog::connect( __pqDialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()) );
71  __pqVBoxLayout->addWidget( __pqDialogButtonBox );
72 
73  // Set the layout
74  QDialog::setLayout( __pqVBoxLayout );
75 
76 }
77 
78 
79 //------------------------------------------------------------------------------
80 // METHODS: QDialog (override)
81 //------------------------------------------------------------------------------
82 
84 {
86  QDialog::accept();
87 }
CVesselContainerDeviceCreateView(CVesselContainerDevice **_ppoVesselContainerDevice)
virtual void accept()
[override] QDialog::accept()
QLineEdit * pqLineEditName
[UI:LineEdit] Device name
CVesselContainerDevice ** ppoVesselContainerDevice
[out] Created VesselContainerDevice
void constructLayout()
Constructs the layout of the user-interface.