Qt Virtual Chart Table (QVCT)
CLandmarkContainerPickView.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 <QComboBox>
21 #include <QDialogButtonBox>
22 #include <QFormLayout>
23 #include <QHBoxLayout>
24 #include <QLabel>
25 #include <QVBoxLayout>
26 
27 // QVCT
30 
31 
32 //------------------------------------------------------------------------------
33 // CONSTRUCTORS / DESTRUCTOR
34 //------------------------------------------------------------------------------
35 
37  : COverlayObjectPickView( _poLandmarkOverlay, _ppoOverlayObject )
38 {
40 }
41 
43 {
44  // Create layout
45  QVBoxLayout* __pqVBoxLayout = new QVBoxLayout();
46 
47  // Add icon and data
48  QHBoxLayout* __pqHBoxLayoutHeader = new QHBoxLayout();
49  // ... icon
50  QLabel* __pqLabelIcon = new QLabel();
51  __pqLabelIcon->setPixmap( QPixmap( ":icons/32x32/landmark.png" ) );
52  __pqHBoxLayoutHeader->addWidget( __pqLabelIcon, 0 );
53  // ... picker
54  pqComboBox = new QComboBox();
55  int __iCount = COverlayObjectPickView::pqTreeWidgetItem->childCount();
56  for( int __i = 0; __i < __iCount; __i++ ) pqComboBox->addItem( ((COverlayObject*)COverlayObjectPickView::pqTreeWidgetItem->child( __i ))->getName() );
57  __pqHBoxLayoutHeader->addWidget( pqComboBox, 1 );
58  // ... [end]
59  __pqVBoxLayout->addLayout( __pqHBoxLayoutHeader );
60 
61  // Add buttons
62  QDialogButtonBox* __pqDialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Cancel|QDialogButtonBox::Ok, Qt::Horizontal );
63  QDialog::connect( __pqDialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()) );
64  QDialog::connect( __pqDialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()) );
65  __pqVBoxLayout->addWidget( __pqDialogButtonBox );
66 
67  // Set the layout
68  COverlayObjectPickView::setLayout( __pqVBoxLayout );
69 
70 }
CLandmarkContainerPickView(const CLandmarkOverlay *_poLandmarkOverlay, COverlayObject **_ppoOverlayObject)
void constructLayout()
Constructs the layout of the user-interface.
[UI] Landmark overlay container
[UI] Generic overlay object's pick (select) view
const QTreeWidgetItem * pqTreeWidgetItem
Base overlay.
virtual void accept()
[override] QDialog::accept()
QComboBox * pqComboBox
[UI:ComboBox] Objects combo-box
Generic overlay object.