21 #include <QHBoxLayout>
23 #include <QPushButton>
24 #include <QScrollArea>
25 #include <QStackedWidget>
26 #include <QVBoxLayout>
90 QVBoxLayout* __pqVBoxLayout =
new QVBoxLayout();
94 __qFontHeader.setPixelSize( 16 );
95 __qFontHeader.setBold(
true );
96 QHBoxLayout* __pqHBoxLayoutHeader =
new QHBoxLayout();
97 QLabel* __pqLabelIcon =
new QLabel();
98 __pqLabelIcon->setPixmap( QPixmap(
":icons/32x32/route.png" ) );
99 __pqLabelIcon->setToolTip( tr(
"Route") );
100 __pqHBoxLayoutHeader->addWidget( __pqLabelIcon, 0, Qt::AlignTop );
105 __pqHBoxLayoutHeader->addWidget(
poTextName, 1 );
106 __pqVBoxLayout->addLayout( __pqHBoxLayoutHeader );
110 QTabWidget* __poTabWidget =
new QTabWidget();
111 __poTabWidget->setTabPosition( QTabWidget::South );
112 __poTabWidget->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
115 QWidget* __poWidgetSummary =
new QWidget();
116 QVBoxLayout* __pqVBoxLayoutSummary =
new QVBoxLayout();
117 __qFontData.setPixelSize( 20 );
126 poTextLengthRL->setToolTip( tr(
"Length (rhumb-lines along route)") );
132 __poWidgetSummary->setLayout( __pqVBoxLayoutSummary );
133 __poTabWidget->addTab( __poWidgetSummary, tr(
"Summary") );
136 QScrollArea* __poScrollAreaInfo =
new QScrollArea();
137 __poScrollAreaInfo->setStyleSheet(
".QScrollArea, .QWidget { BACKGROUND-COLOR: rgba(0, 0, 0, 0); BORDER: none; }" );
138 __poScrollAreaInfo->setWidgetResizable(
true );
139 QWidget* __poWidgetInfo =
new QWidget();
140 QVBoxLayout* __pqVBoxLayoutInfo =
new QVBoxLayout();
141 __qFontData.setPixelSize( 12 );
142 __qFontData.setBold(
true );
149 __qFontData.setBold(
false );
156 __qFontData.setPixelSize( 10 );
164 poUrl->setToolTip( tr(
"URL") );
165 poUrl->setFont( __qFontData );
166 poUrl->setIndent( 10 );
168 __pqVBoxLayoutInfo->addWidget(
poUrl, 1 );
169 __poWidgetInfo->setLayout( __pqVBoxLayoutInfo );
170 __poScrollAreaInfo->setWidget( __poWidgetInfo );
171 __poTabWidget->addTab( __poScrollAreaInfo, tr(
"Info") );
174 __pqVBoxLayout->addWidget( __poTabWidget, 1 );
177 QFrame* __pqFrameSeparator =
new QFrame();
178 __pqFrameSeparator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
179 __pqVBoxLayout->addWidget( __pqFrameSeparator );
182 QHBoxLayout* __pqHBoxLayoutButtons =
new QHBoxLayout();
189 __pqVBoxLayout->addLayout( __pqHBoxLayoutButtons );
192 COverlayObjectDetailView::setLayout( __pqVBoxLayout );
206 poTextContent->
setText( QString::number( __poRouteContainer->childCount() )+
" "+tr(
"Waypoint(s)") );
261 bool __bVisible = __poRouteContainer->
isVisible();
263 if( __bVisible != __poRouteContainer->
isVisible() )
292 if( __qsFilename.isEmpty() )
return;
293 QFileInfo __qFileInfo( __qsFilename );
294 if( __qFileInfo.suffix().isEmpty() ) __qsFilename +=
".qvct";
295 QStringList __qsListExtensions; __qsListExtensions <<
"qvct" <<
"gpx";
307 __pqMutexDataChange->lock();
308 __poRouteOverlay->removeChild( __poRouteContainer );
309 __pqMutexDataChange->unlock();
310 delete __poRouteContainer;
311 QTreeWidgetItem* __pqTreeWidgetItem = __poRouteOverlay->currentItem();
312 if( __pqTreeWidgetItem ) __poRouteOverlay->
showDetail( __pqTreeWidgetItem );
323 if( !__poRoutePoint )
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)
virtual void resetContent()
Resets (clears) the content of the underlying widget.
void slotSave()
[UI:Slot] Slot to save this container to file
QPushButton * pqPushButtonEdit
[UI:Button] Edit
virtual void disableContent()
Disables the content (controls) of the underlying widget.
COverlayText * poTextContent
[UI:Label] Content (items summary)
virtual void enableContent()
Enables the content (controls) of the underlying widget.
void slotAddPoint()
[UI:Slot] Slot to add new (route) point
CRouteContainerDetailView(QWidget *_pqParent=0)
COverlayText * poTextDescription
[UI:Label] Description
void slotPositionCenter()
[UI:Slot] Slot to center chart (on container's items position)
COverlayUrl * poUrl
[UI:Label] URL
COverlayText * poTextLengthRL
[UI:Label] Length (rhumb-line)
void slotDelete()
[UI:Slot] Slot to delete (this container)
QPushButton * pqPushButtonCenter
[UI:Button] Center (on chart)
COverlayText * poTextComment
[UI:Label] Comment
QPushButton * pqPushButtonDelete
[UI:Button] Delete
COverlayText * poTextName
[UI:Label] Name
QPushButton * pqPushButtonAddPoint
[UI:Button] Add new waypoint
QPushButton * pqPushButtonVisible
[UI:Button] Visibility status
void constructLayout()
Constructs the layout of the user-interface.
QPushButton * pqPushButtonSave
[UI:Button] Save
void slotToggleVisible()
[UI:Slot] Slot to modify the visibility status
virtual void refreshContent()
Refreshes the content of the underlying widget.
void slotEdit()
[UI:Slot] Slot to display edit view
COverlayText * poTextType
[UI:Label] Type
[UI] Route overlay container
virtual void toggleVisibility()
QString getUrl() const
Returns this route's URL.
double getLengthRL()
Returns the route's (rhumb-line) length.
QString getType() const
Returns this route's type.
QString getDescription() const
Returns this route's description.
virtual COverlay * useOverlay()
Returns this object's (base) overlay.
QString getComment() const
Returns this route's comment.
[UI] Route overlay container
virtual void showDetail(const QTreeWidgetItem *_pqTreeWidgetItem) const
Displays the given overlay object's details (in the appropriate widget/view)
@ VISIBLE
Route visibility status.
void save(const QString &_rqsFilename, CRouteContainer *_poRouteContainer=0) const
Save this object's content (container) to the given file (all selected items if no container is given...
[UI] Route overlay point (item) / waypoint
virtual void showEdit()
Displays this object's edit widget/view.
static QString toString(double _fdValue, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static QMutex * useMutexDataChange()
static CRouteOverlay * useRouteOverlay()
static CMainWindow * useMainWindow()
static CChartTable * useChartTable()