21 #include <QHBoxLayout>
23 #include <QPushButton>
24 #include <QScrollArea>
25 #include <QStackedWidget>
27 #include <QVBoxLayout>
99 QVBoxLayout* __pqVBoxLayout =
new QVBoxLayout();
103 __qFontHeader.setPixelSize( 16 );
104 __qFontHeader.setBold(
true );
105 QHBoxLayout* __pqHBoxLayoutHeader =
new QHBoxLayout();
106 QLabel* __pqLabelIcon =
new QLabel();
107 __pqLabelIcon->setPixmap( QPixmap(
":icons/32x32/vessel.png" ) );
108 __pqLabelIcon->setToolTip( tr(
"Flotilla") );
109 __pqHBoxLayoutHeader->addWidget( __pqLabelIcon, 0, Qt::AlignTop );
114 __pqHBoxLayoutHeader->addWidget(
poTextName, 1 );
115 __pqVBoxLayout->addLayout( __pqHBoxLayoutHeader );
119 QTabWidget* __poTabWidget =
new QTabWidget();
120 __poTabWidget->setTabPosition( QTabWidget::South );
121 __poTabWidget->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
124 QWidget* __poWidgetSummary =
new QWidget();
125 QVBoxLayout* __pqVBoxLayoutSummary =
new QVBoxLayout();
126 __qFontData.setPixelSize( 20 );
134 __poWidgetSummary->setLayout( __pqVBoxLayoutSummary );
135 __poTabWidget->addTab( __poWidgetSummary, tr(
"Summary") );
138 QScrollArea* __poScrollAreaInfo =
new QScrollArea();
139 __poScrollAreaInfo->setStyleSheet(
".QScrollArea, .QWidget { BACKGROUND-COLOR: rgba(0, 0, 0, 0); BORDER: none; }" );
140 __poScrollAreaInfo->setWidgetResizable(
true );
141 QWidget* __poWidgetInfo =
new QWidget();
142 QVBoxLayout* __pqVBoxLayoutInfo =
new QVBoxLayout();
143 __qFontData.setPixelSize( 12 );
144 __qFontData.setBold(
true );
151 __qFontData.setBold(
false );
158 __qFontData.setPixelSize( 10 );
166 poUrl->setToolTip( tr(
"URL") );
167 poUrl->setFont( __qFontData );
168 poUrl->setIndent( 10 );
170 __pqVBoxLayoutInfo->addWidget(
poUrl, 1 );
171 __poWidgetInfo->setLayout( __pqVBoxLayoutInfo );
172 __poScrollAreaInfo->setWidget( __poWidgetInfo );
173 __poTabWidget->addTab( __poScrollAreaInfo, tr(
"Info") );
176 __pqVBoxLayout->addWidget( __poTabWidget, 1 );
179 QFrame* __pqFrameSeparator =
new QFrame();
180 __pqFrameSeparator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
181 __pqVBoxLayout->addWidget( __pqFrameSeparator );
184 QHBoxLayout* __pqHBoxLayoutButtons =
new QHBoxLayout();
192 __pqVBoxLayout->addLayout( __pqHBoxLayoutButtons );
195 COverlayObjectDetailView::setLayout( __pqVBoxLayout );
209 poTextContent->
setText( QString::number( __poVesselContainer->childCount() - ( __poVesselContainer->
isDynamic() ? 1 : 0 ) )+
" "+tr(
"Vessel(s)") );
216 bool __bDynamic = __poVesselContainer->
isDynamic();
267 bool __bVisible = __poVesselContainer->
isVisible();
269 if( __bVisible != __poVesselContainer->
isVisible() )
298 if( __qsFilename.isEmpty() )
return;
299 QFileInfo __qFileInfo( __qsFilename );
300 if( __qFileInfo.suffix().isEmpty() ) __qsFilename +=
".qvct";
301 QStringList __qsListExtensions; __qsListExtensions <<
"qvct";
313 __pqMutexDataChange->lock();
314 __poVesselOverlay->removeChild( __poVesselContainer );
315 __pqMutexDataChange->unlock();
316 delete __poVesselContainer;
317 QTreeWidgetItem* __pqTreeWidgetItem = __poVesselOverlay->currentItem();
318 if( __pqTreeWidgetItem ) __poVesselOverlay->
showDetail( __pqTreeWidgetItem );
330 __poVesselContainerDeviceCreateView->exec();
331 if( __poVesselContainerDevice )
334 __pqMutexDataChange->lock();
336 __pqMutexDataChange->unlock();
338 __poVesselContainerDevice->
showEdit();
343 delete __poVesselContainerDeviceCreateView;
351 if( !__poVesselPoint )
return;
void setProjectModified()
Sets the status of the project to modified (data have changed and need saving)
void setScaleArea(const CDataPosition &_roGeoPosition1, const CDataPosition &_roGeoPosition2, double _fdScaleCorrection=1.0)
Sets the reference scale factor to display the given (geographical) area (defined by its opposite cor...
void updateChart()
Update the (current) chart content (on screen)
void setGeoPosition(const CDataPosition &_roGeoPosition, bool _bSkipCurrent=false)
Sets the reference chart (geographical) position.
(Geographical) Position data [long,lat,elev]
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)
[UI] Generic overlay object's detail view
COverlayObject * poOverlayObject
Overlay object being displayed.
virtual COverlay * useOverlay()=0
Returns this object's (base) overlay.
QString getName() const
Returns this object's name.
QString newChildName(const QString &_rqsName, int _iZeroPrefix=0, bool _bForceSuffix=false) const
Returns a valid (non-duplicate) name for a new sibling of this object.
static int getPositionBox(const QTreeWidgetItem *_pqTreeWidgetItem, CDataPosition *_poDataPositionLower, CDataPosition *_poDataPositionUpper, int _iIndexMin=0, int _iIndexMax=-1)
Returns the minimal geographical positions box containing the points in the given overlay/container.
[UI] Overlay-specific text label
void setText(const QString &_rqsText)
[override] QLabel::setText( const QString& )
void resetText()
Resets (clears) the underlying QLabel's text.
[UI] Overlay-specific URL label
void setText(const QString &_rqsText)
bool isVisible() const
Returns the point's (marker) visibility status.
void forceRedraw()
Forces this overlay's rendering (not matter its cache content)
QPushButton * pqPushButtonSetDevice
[UI:Button] Set device (dynamic flotilla)
virtual void disableContent()
Disables the content (controls) of the underlying widget.
void slotPositionCenter()
[UI:Slot] Slot to center chart (on container's items position)
COverlayText * poTextComment
[UI:Label] Comment
virtual void resetContent()
Resets (clears) the content of the underlying widget.
void slotToggleVisible()
[UI:Slot] Slot to modify the visibility status
virtual void refreshContent()
Refreshes the content of the underlying widget.
COverlayText * poTextType
[UI:Label] Type
void slotSave()
[UI:Slot] Slot to save this container to file
void slotAddPoint()
[UI:Slot] Slot to add new (vessel) point
QPushButton * pqPushButtonAddPoint
[UI:Button] Add new vessel
void slotDelete()
[UI:Slot] Slot to delete (this container)
QPushButton * pqPushButtonSave
[UI:Button] Save
virtual void enableContent()
Enables the content (controls) of the underlying widget.
void constructLayout()
Constructs the layout of the user-interface.
CVesselContainerDetailView(QWidget *_pqParent=0)
QPushButton * pqPushButtonVisible
[UI:Button] Visibility status
QPushButton * pqPushButtonDelete
[UI:Button] Delete
void slotSetDevice()
[UI:Slot] Slot to set device (dynamic flotilla)
COverlayText * poTextContent
[UI:Label] Content (items summary)
QPushButton * pqPushButtonEdit
[UI:Button] Edit
COverlayText * poTextName
[UI:Label] Name
COverlayText * poTextDescription
[UI:Label] Description
COverlayUrl * poUrl
[UI:Label] URL
void slotEdit()
[UI:Slot] Slot to display edit view
QPushButton * pqPushButtonCenter
[UI:Button] Center (on chart)
[UI] Generic overlay object's pick (select) view
virtual void showEdit()
Displays this object's edit widget/view.
[UI] Vessel overlay container / flotilla
virtual COverlay * useOverlay()
Returns this object's (base) overlay.
bool isDynamic()
Returns this flotilla's dynamic status.
QString getUrl() const
Returns this flotilla's URL.
QString getComment() const
Returns this flotilla's comment.
QString getType() const
Returns this flotilla's type.
virtual void toggleVisibility()
QString getDescription() const
Returns this flotilla's description.
[UI] Vessel overlay container
void save(const QString &_rqsFilename, CVesselContainer *_poVesselContainer=0) const
Save this object's content (container) to the given file (all selected items if no container is given...
@ VISIBLE
Vessel visibility status.
virtual void showDetail(const QTreeWidgetItem *_pqTreeWidgetItem) const
Displays the given overlay object's details (in the appropriate widget/view)
[UI] Vessel overlay point (item) / vessel
virtual void showEdit()
Displays this object's edit widget/view.
static CVesselOverlay * useVesselOverlay()
static QMutex * useMutexDataChange()
static CMainWindow * useMainWindow()
static CChartTable * useChartTable()