21 #include <QDialogButtonBox>
22 #include <QFormLayout>
23 #include <QHBoxLayout>
28 #include <QVBoxLayout>
41 , ppoDevice( _ppoDevice )
43 , pqComboBoxDriver( 0 )
45 QDialog::setWindowTitle( tr(
"Create Device")+
"..." );
53 QVBoxLayout* __pqVBoxLayout =
new QVBoxLayout();
56 QHBoxLayout* __pqHBoxLayout =
new QHBoxLayout();
58 QLabel* __pqLabelIcon =
new QLabel();
59 __pqLabelIcon->setPixmap( QPixmap(
":icons/32x32/device.png" ) );
60 __pqHBoxLayout->addWidget( __pqLabelIcon, 0 );
62 QFormLayout* __pqFormLayout =
new QFormLayout();
69 int __iCount = __qListDriverName.count();
70 for(
int __i = 0; __i < __iCount; __i++ )
pqComboBoxDriver->addItem( __qListDriverName.at( __i ) );
73 __pqHBoxLayout->addLayout( __pqFormLayout, 1 );
74 __pqVBoxLayout->addLayout( __pqHBoxLayout );
77 QDialogButtonBox* __pqDialogButtonBox =
new QDialogButtonBox( QDialogButtonBox::Cancel|QDialogButtonBox::Ok, Qt::Horizontal );
78 QDialog::connect( __pqDialogButtonBox, SIGNAL(accepted()),
this, SLOT(
accept()) );
79 QDialog::connect( __pqDialogButtonBox, SIGNAL(rejected()),
this, SLOT(reject()) );
80 __pqVBoxLayout->addWidget( __pqDialogButtonBox );
83 QDialog::setLayout( __pqVBoxLayout );
QLineEdit * pqLineEditName
[UI:LineEdit] Device name
CDeviceCreateView(CDevice **_ppoDevice)
CDevice ** ppoDevice
[out] Created device
QComboBox * pqComboBoxDriver
[UI:ComboBox] Device driver
void constructLayout()
Constructs the layout of the user-interface.
virtual void accept()
[override] QDialog::accept()
static EDriver fromName(const QString &_rqsName)
Returns the device driver ID corresponding to the given human-readable name.
static const QMap< EDriver, QString > & names()
Returns the list of supported human-readable device driver names.
static CDevice * createDevice(const QString &_rqsDeviceName, EDriver _eDriver)
Create a new device based on the specified driver.
Generic navigation device (GPS, speedometer, compass, etc.)