Qt Virtual Chart Table (QVCT)
CVesselPointDeviceCreateView.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 <QVBoxLayout>
26 
27 // QVCT
30 
31 
32 //------------------------------------------------------------------------------
33 // CONSTRUCTORS / DESTRUCTOR
34 //------------------------------------------------------------------------------
35 
37  : QDialog( 0 )
38  , ppoVesselPointDevice( _ppoVesselPointDevice )
39  , pqLineEditName( 0 )
40  , pqLineEditSourceName( 0 )
41 {
42  QDialog::setWindowTitle( tr("Create Device")+"..." );
45 }
46 
48 {
49  // Create layout
50  QVBoxLayout* __pqVBoxLayout = new QVBoxLayout();
51 
52  // Add form
53  QHBoxLayout* __pqHBoxLayout = new QHBoxLayout();
54  // ... icon
55  QLabel* __pqLabelIcon = new QLabel();
56  __pqLabelIcon->setPixmap( QPixmap( ":icons/32x32/vessel_device.png" ) );
57  __pqHBoxLayout->addWidget( __pqLabelIcon, 0 );
58  // ... form
59  QFormLayout* __pqFormLayout = new QFormLayout();
60  // ... name
61  pqLineEditName = new QLineEdit();
62  pqLineEditName->setToolTip( tr("Device name (matching one of the defined devices)") );
63  __pqFormLayout->addRow( tr("Device")+":", pqLineEditName );
64  // ... source name
65  pqLineEditSourceName = new QLineEdit();
66  pqLineEditSourceName->setToolTip( tr("Source name/filter (exactly matching the device provided source name)") );
67  __pqFormLayout->addRow( tr("Source")+":", pqLineEditSourceName );
68  // ... [end]
69  __pqHBoxLayout->addLayout( __pqFormLayout, 1 );
70  __pqVBoxLayout->addLayout( __pqHBoxLayout );
71 
72  // Add buttons
73  QDialogButtonBox* __pqDialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Cancel|QDialogButtonBox::Ok, Qt::Horizontal );
74  QDialog::connect( __pqDialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()) );
75  QDialog::connect( __pqDialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()) );
76  __pqVBoxLayout->addWidget( __pqDialogButtonBox );
77 
78  // Set the layout
79  QDialog::setLayout( __pqVBoxLayout );
80 
81 }
82 
83 
84 //------------------------------------------------------------------------------
85 // METHODS: QDialog (override)
86 //------------------------------------------------------------------------------
87 
89 {
91  QDialog::accept();
92 }
CVesselPointDeviceCreateView(CVesselPointDevice **_ppoVesselPointDevice)
QLineEdit * pqLineEditName
[UI:LineEdit] Device name
void constructLayout()
Constructs the layout of the user-interface.
CVesselPointDevice ** ppoVesselPointDevice
[out] Created VesselPointDevice
virtual void accept()
[override] QDialog::accept()
QLineEdit * pqLineEditSourceName
[UI:LineEdit] Device source name
[UI] Vessel device