20 #include <QHBoxLayout>
21 #include <QPushButton>
22 #include <QStackedWidget>
23 #include <QVBoxLayout>
38 : QWidget( _pqParent )
51 pqPushButtonAdd =
new QPushButton( QIcon(
":icons/32x32/add.png" ),
"" );
61 pqPushButtonUp =
new QPushButton( QIcon(
":icons/32x32/move_up.png" ),
"" );
62 pqPushButtonUp->setToolTip( tr(
"[landmarks set/landmark] Move up") );
66 pqPushButtonDown =
new QPushButton( QIcon(
":icons/32x32/move_down.png" ),
"" );
77 QVBoxLayout* __pqVBoxLayout =
new QVBoxLayout();
83 QFrame* __pqFrameSeparator =
new QFrame();
84 __pqFrameSeparator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
85 __pqVBoxLayout->addWidget( __pqFrameSeparator );
88 QHBoxLayout* __pqHBoxLayoutButtons =
new QHBoxLayout();
91 __pqHBoxLayoutButtons->addWidget(
pqPushButtonUp, 0, Qt::AlignHCenter );
94 __pqVBoxLayout->addLayout( __pqHBoxLayoutButtons );
97 QWidget::setLayout( __pqVBoxLayout );
113 QString __qsName = __poLandmarkOverlay->
newChildName( tr(
"Landmarks"), 1,
true );
115 if( !__poLandmarkContainer )
return;
116 __poLandmarkOverlay->setCurrentItem( __poLandmarkContainer );
124 if( __qsFilename.isEmpty() )
return;
128 if( !__poLandmarkContainer )
return;
129 __poLandmarkOverlay->setCurrentItem( __poLandmarkContainer );
138 QTreeWidgetItem* __pqTreeWidgetItem_current = __poLandmarkOverlay->currentItem();
139 if( !__pqTreeWidgetItem_current )
return;
140 switch( __pqTreeWidgetItem_current->type() )
146 QTreeWidgetItem* __pqTreeWidgetItem_parent = __pqTreeWidgetItem_current->parent();
147 if( !__pqTreeWidgetItem_parent )
return;
148 int __iIndex = __pqTreeWidgetItem_parent->indexOfChild( __pqTreeWidgetItem_current );
149 if( __iIndex <= 0 )
return;
150 __pqTreeWidgetItem_parent->removeChild( __pqTreeWidgetItem_current );
151 __pqTreeWidgetItem_parent->insertChild( __iIndex-1, __pqTreeWidgetItem_current );
152 __poLandmarkOverlay->setCurrentItem( __pqTreeWidgetItem_current );
165 QTreeWidgetItem* __pqTreeWidgetItem_current = __poLandmarkOverlay->currentItem();
166 if( !__pqTreeWidgetItem_current )
return;
167 switch( __pqTreeWidgetItem_current->type() )
173 QTreeWidgetItem* __pqTreeWidgetItem_parent = __pqTreeWidgetItem_current->parent();
174 if( !__pqTreeWidgetItem_parent )
return;
175 int __iIndex = __pqTreeWidgetItem_parent->indexOfChild( __pqTreeWidgetItem_current );
176 if( __iIndex >= __pqTreeWidgetItem_parent->childCount()-1 )
return;
177 __pqTreeWidgetItem_parent->removeChild( __pqTreeWidgetItem_current );
178 __pqTreeWidgetItem_parent->insertChild( __iIndex+1, __pqTreeWidgetItem_current );
179 __poLandmarkOverlay->setCurrentItem( __pqTreeWidgetItem_current );
192 __poLandmarkOverlayActionsView->exec();
193 delete __poLandmarkOverlayActionsView;
void setProjectModified()
Sets the status of the project to modified (data have changed and need saving)
void updateChart()
Update the (current) chart content (on screen)
[UI] Landmark overlay container
virtual void showEdit()
Displays this object's edit widget/view.
[UI] Landmark overlay's actions view
void slotAdd()
[UI:Slot] Slot to add a new container
QPushButton * pqPushButtonLoad
[UI:Button] Load
CLandmarkOverlayListView(QWidget *_pqParent=0)
void slotLoad()
[UI:Slot] Slot to load overlay's content from file
CLandmarkOverlay * poLandmarkOverlay
Landmark overlay.
QPushButton * pqPushButtonUp
[UI:Button] Up
void slotActions()
[UI:Slot] Slot to show additional actions
QPushButton * pqPushButtonActions
[UI:Button] Actions
QPushButton * pqPushButtonDown
[UI:Button] Down
QPushButton * pqPushButtonAdd
[UI:Button] Add
void slotDown()
[UI:Slot] Slot to move overlay's content down
void slotUp()
[UI:Slot] Slot to move overlay's content up
void constructLayout()
Constructs the layout of the user-interface.
[UI] Landmark overlay container
CLandmarkContainer * addContainer(const QString &_rqsName)
Add a new landmarks set (container) to this overlay.
CLandmarkContainer * load(const QString &_rqsFilename)
Load this object's content from the given file and returns the last loaded container (0 if none)
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)
QString newChildName(const QString &_rqsName, int __iZeroPrefix=0, bool __bForceSuffix=false) const
Returns a valid name for a new sibling of this object.
void forceRedraw()
Forces this overlay's rendering (not matter its cache content)
static void registerLandmarkOverlay(CLandmarkOverlay *_poLandmarkOverlay)
static CMainWindow * useMainWindow()
static CChartTable * useChartTable()
static CLandmarkOverlay * useLandmarkOverlay()