20 #include <QHBoxLayout>
21 #include <QPushButton>
22 #include <QStackedWidget>
23 #include <QVBoxLayout>
39 : QWidget( _pqParent )
57 pqPushButtonAdd =
new QPushButton( QIcon(
":icons/32x32/add.png" ),
"" );
62 pqPushButtonUp =
new QPushButton( QIcon(
":icons/32x32/move_up.png" ),
"" );
67 pqPushButtonDown =
new QPushButton( QIcon(
":icons/32x32/move_down.png" ),
"" );
78 QVBoxLayout* __pqVBoxLayout =
new QVBoxLayout();
84 QFrame* __pqFrameSeparator =
new QFrame();
85 __pqFrameSeparator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
86 __pqVBoxLayout->addWidget( __pqFrameSeparator );
89 QHBoxLayout* __pqHBoxLayoutButtons =
new QHBoxLayout();
92 __pqHBoxLayoutButtons->addWidget(
pqPushButtonUp, 0, Qt::AlignHCenter );
95 __pqVBoxLayout->addLayout( __pqHBoxLayoutButtons );
98 QWidget::setLayout( __pqVBoxLayout );
114 if( __qsFilename.isEmpty() )
return;
117 CDevice* __poDevice = __poDeviceOverlay->
load( __qsFilename );
118 if( !__poDevice )
return;
119 __poDeviceOverlay->setCurrentItem( __poDevice );
128 __poDeviceCreateView->exec();
131 __poDeviceOverlay->addChild( __poDevice );
132 __poDeviceOverlay->setCurrentItem( __poDevice );
136 delete __poDeviceCreateView;
142 QTreeWidgetItem* __pqTreeWidgetItem_current = __poDeviceOverlay->currentItem();
143 if( !__pqTreeWidgetItem_current )
return;
144 switch( __pqTreeWidgetItem_current->type() )
149 QTreeWidgetItem* __pqTreeWidgetItem_parent = __pqTreeWidgetItem_current->parent();
150 if( !__pqTreeWidgetItem_parent )
return;
151 int __iIndex = __pqTreeWidgetItem_parent->indexOfChild( __pqTreeWidgetItem_current );
152 if( __iIndex <= 0 )
return;
153 __pqTreeWidgetItem_parent->removeChild( __pqTreeWidgetItem_current );
154 __pqTreeWidgetItem_parent->insertChild( __iIndex-1, __pqTreeWidgetItem_current );
155 __poDeviceOverlay->setCurrentItem( __pqTreeWidgetItem_current );
168 QTreeWidgetItem* __pqTreeWidgetItem_current = __poDeviceOverlay->currentItem();
169 if( !__pqTreeWidgetItem_current )
return;
170 switch( __pqTreeWidgetItem_current->type() )
175 QTreeWidgetItem* __pqTreeWidgetItem_parent = __pqTreeWidgetItem_current->parent();
176 if( !__pqTreeWidgetItem_parent )
return;
177 int __iIndex = __pqTreeWidgetItem_parent->indexOfChild( __pqTreeWidgetItem_current );
178 if( __iIndex >= __pqTreeWidgetItem_parent->childCount()-1 )
return;
179 __pqTreeWidgetItem_parent->removeChild( __pqTreeWidgetItem_current );
180 __pqTreeWidgetItem_parent->insertChild( __iIndex+1, __pqTreeWidgetItem_current );
181 __poDeviceOverlay->setCurrentItem( __pqTreeWidgetItem_current );
194 __poDeviceOverlayActionsView->exec();
195 delete __poDeviceOverlayActionsView;
void setProjectModified()
Sets the status of the project to modified (data have changed and need saving)
[UI] Generic overlay object's pick (select) view
[UI] Device overlay's actions view
QPushButton * pqPushButtonActions
[UI:Button] Actions
QPushButton * pqPushButtonLoad
[UI:Button] Load
QPushButton * pqPushButtonAdd
[UI:Button] Add
void constructLayout()
Constructs the layout of the user-interface.
void slotActions()
[UI:Slot] Slot to show additional actions
QPushButton * pqPushButtonUp
[UI:Button] Up
void slotDown()
[UI:Slot] Slot to move overlay's content down
QPushButton * pqPushButtonDown
[UI:Button] Down
void slotAdd()
[UI:Slot] Slot to add a new container
CDeviceOverlay * poDeviceOverlay
Device overlay.
void slotLoad()
[UI:Slot] Slot to load overlay's content from file
CDeviceOverlayListView(QWidget *_pqParent=0)
void slotUp()
[UI:Slot] Slot to move overlay's content up
[UI] Device overlay container
CDevice * load(const QString &_rqsFilename, bool _bSilent=false)
Load this object's content from the given file and returns the last loaded device (0 if none)
Generic navigation device (GPS, speedometer, compass, etc.)
virtual void showEdit()=0
Displays the device's edit (configuration) widget/view.
QString fileDialog(QVCT::EFileOperation _eFileOperation, const QString &_rqsTitle, const QString &_rqsFilter)
Displays a generic dialog to pick a file for the given operation (open/save)
static CDeviceOverlay * useDeviceOverlay()
static void registerDeviceOverlay(CDeviceOverlay *_poDeviceOverlay)
static CMainWindow * useMainWindow()
static CChartTable * useChartTable()