24 #include <QHBoxLayout>
26 #include <QPushButton>
27 #include <QScrollArea>
28 #include <QStackedWidget>
29 #include <QVBoxLayout>
87 QVBoxLayout* __pqVBoxLayout =
new QVBoxLayout();
91 __qFontHeader.setPixelSize( 16 );
92 __qFontHeader.setBold(
true );
93 QHBoxLayout* __pqHBoxLayoutHeader =
new QHBoxLayout();
94 QLabel* __pqLabelIcon =
new QLabel();
95 __pqLabelIcon->setPixmap( QPixmap(
":icons/32x32/track.png" ) );
96 __pqLabelIcon->setToolTip( tr(
"Track") );
97 __pqHBoxLayoutHeader->addWidget( __pqLabelIcon, 0, Qt::AlignTop );
102 __pqHBoxLayoutHeader->addWidget(
poTextName, 1 );
103 __pqVBoxLayout->addLayout( __pqHBoxLayoutHeader );
107 QTabWidget* __poTabWidget =
new QTabWidget();
108 __poTabWidget->setTabPosition( QTabWidget::South );
109 __poTabWidget->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
112 QWidget* __poWidgetSummary =
new QWidget();
113 QVBoxLayout* __pqVBoxLayoutSummary =
new QVBoxLayout();
114 __qFontData.setPixelSize( 20 );
123 poTextLengthRL->setToolTip( tr(
"Length (rhumb-lines along track)") );
136 __poWidgetSummary->setLayout( __pqVBoxLayoutSummary );
137 __poTabWidget->addTab( __poWidgetSummary, tr(
"Summary") );
140 QScrollArea* __poScrollAreaInfo =
new QScrollArea();
141 __poScrollAreaInfo->setStyleSheet(
".QScrollArea, .QWidget { BACKGROUND-COLOR: rgba(0, 0, 0, 0); BORDER: none; }" );
142 __poScrollAreaInfo->setWidgetResizable(
true );
143 QWidget* __poWidgetInfo =
new QWidget();
144 QVBoxLayout* __pqVBoxLayoutInfo =
new QVBoxLayout();
145 __qFontData.setPixelSize( 12 );
146 __qFontData.setBold(
true );
153 __qFontData.setBold(
false );
160 __qFontData.setPixelSize( 10 );
168 poUrl->setToolTip( tr(
"URL") );
169 poUrl->setFont( __qFontData );
170 poUrl->setIndent( 10 );
172 __pqVBoxLayoutInfo->addWidget(
poUrl, 1 );
173 __poWidgetInfo->setLayout( __pqVBoxLayoutInfo );
174 __poScrollAreaInfo->setWidget( __poWidgetInfo );
175 __poTabWidget->addTab( __poScrollAreaInfo, tr(
"Info") );
178 __pqVBoxLayout->addWidget( __poTabWidget, 1 );
181 QFrame* __pqFrameSeparator =
new QFrame();
182 __pqFrameSeparator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
183 __pqVBoxLayout->addWidget( __pqFrameSeparator );
186 QHBoxLayout* __pqHBoxLayoutButtons =
new QHBoxLayout();
192 __pqHBoxLayoutButtons->addWidget(
new QLabel(), 1, Qt::AlignRight );
193 __pqVBoxLayout->addLayout( __pqHBoxLayoutButtons );
196 COverlayObjectDetailView::setLayout( __pqVBoxLayout );
209 int __iCountPoints = 0;
210 int __iCount = __poTrackContainer->childCount();
211 for(
int __i = 0; __i < __iCount; __i++ )
212 __iCountPoints += __poTrackContainer->child( __i )->childCount();
269 bool __bVisible = __poTrackContainer->
isVisible();
271 if( __bVisible != __poTrackContainer->
isVisible() )
282 CDataPosition __oDataPositionLower( 180, 90, 999999 ), __oDataPositionUpper( -180, -90, -999999 );
285 for(
int __i = 0; __i < __iCount; __i++ )
287 CDataPosition __oDataPositionLower_aux, __oDataPositionUpper_aux;
289 if( __iCountBox_aux )
291 __iCountBox += __iCountBox_aux;
292 __oDataPositionLower.setPosition( std::min( __oDataPositionLower.getLongitude(), __oDataPositionLower_aux.
getLongitude() ),
293 std::min( __oDataPositionLower.getLatitude(), __oDataPositionLower_aux.
getLatitude() ),
294 std::min( __oDataPositionLower.getElevation(), __oDataPositionLower_aux.
getElevation() ) );
316 if( __qsFilename.isEmpty() )
return;
317 QFileInfo __qFileInfo( __qsFilename );
318 if( __qFileInfo.suffix().isEmpty() ) __qsFilename +=
".qvct";
319 QStringList __qsListExtensions; __qsListExtensions <<
"qvct" <<
"gpx";
331 __pqMutexDataChange->lock();
332 __poTrackOverlay->removeChild( __poTrackContainer );
333 __pqMutexDataChange->unlock();
334 delete __poTrackContainer;
335 QTreeWidgetItem* __pqTreeWidgetItem = __poTrackOverlay->currentItem();
336 if( __pqTreeWidgetItem ) __poTrackOverlay->
showDetail( __pqTreeWidgetItem );
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]
double getLongitude() const
Returns this position's longitude, in degrees.
double getElevation() const
Returns this position's elevation, in meters.
double getLatitude() const
Returns this position's latitude, in degrees.
void setPosition(double _fdLongitude, double _fdLatitude, double _fdElevation=UNDEFINED_ELEVATION)
Sets new coordinates.
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.
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 disableContent()
Disables the content (controls) of the underlying widget.
COverlayText * poTextDescription
[UI:Label] Description
virtual void refreshContent()
Refreshes the content of the underlying widget.
COverlayText * poTextType
[UI:Label] Type
virtual void enableContent()
Enables the content (controls) of the underlying widget.
COverlayText * poTextContent
[UI:Label] Content (items summary)
void slotSave()
[UI:Slot] Slot to save this container to file
COverlayUrl * poUrl
[UI:Label] URL
void slotEdit()
[UI:Slot] Slot to display edit view
QPushButton * pqPushButtonVisible
[UI:Button] Visibility status
void constructLayout()
Constructs the layout of the user-interface.
COverlayText * poTextName
[UI:Label] Name
COverlayText * poTextLengthRL
[UI:Label] Length (rhumb-line)
QPushButton * pqPushButtonCenter
[UI:Button] Center (on chart)
virtual void resetContent()
Resets (clears) the content of the underlying widget.
void slotDelete()
[UI:Slot] Slot to delete (this container)
COverlayText * poTextComment
[UI:Label] Comment
QPushButton * pqPushButtonSave
[UI:Button] Save
COverlayText * poTextTimeElapsed
[UI:Label] Elapsed time
QPushButton * pqPushButtonEdit
[UI:Button] Edit
void slotToggleVisible()
[UI:Slot] Slot to modify the visibility status
QPushButton * pqPushButtonDelete
[UI:Button] Delete
void slotPositionCenter()
[UI:Slot] Slot to center chart (on container's items position)
CTrackContainerDetailView(QWidget *_pqParent=0)
[UI] Track overlay container
QString getUrl() const
Returns this track's URL.
QString getType() const
Returns this track's type.
QString getDescription() const
Returns this track's description.
virtual void toggleVisibility()
double getLengthRL()
Returns the track's (rhumb-line) length.
virtual COverlay * useOverlay()
Returns this object's (base) overlay.
double getTimeElapsed()
Returns the track's elapsed time.
QString getComment() const
Returns this track's comment.
[UI] Track overlay container
@ VISIBLE
Track visibility status.
virtual void showDetail(const QTreeWidgetItem *_pqTreeWidgetItem) const
Displays the given overlay object's details (in the appropriate widget/view)
void save(const QString &_rqsFilename, CTrackContainer *_poTrackContainer=0) const
Save this object's content (container) to the given file (all selected items if no container is given...
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 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 CMainWindow * useMainWindow()
static CChartTable * useChartTable()
static CTrackOverlay * useTrackOverlay()