Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add navigation widget and compiled succesfully.
- Loading branch information
1 parent
8d64301
commit f87043d
Showing
5 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include <QGridLayout> | ||
#include <QPushButton> | ||
#include <QDial> | ||
|
||
#include "qgs3dnavigationwidget.h" | ||
|
||
Qgs3DNavigationWidget::Qgs3DNavigationWidget(QWidget *parent) : QWidget(parent) | ||
{ | ||
// Zoom in button | ||
mZoomInButton = new QPushButton(this); | ||
mZoomInButton->setText(QStringLiteral("+")); | ||
mZoomInButton->setToolTip(QStringLiteral("Zoom In")); | ||
mZoomInButton->setAutoRepeat(true); | ||
|
||
// Zoom out button | ||
mZoomOutButton = new QPushButton(this); | ||
mZoomOutButton->setText(QStringLiteral("-")); | ||
mZoomOutButton->setToolTip(QStringLiteral("Zoom Out")); | ||
mZoomOutButton->setAutoRepeat(true); | ||
|
||
// Tilt up button | ||
mTiltUpButton = new QPushButton(this); | ||
mTiltUpButton->setText(QString::fromUtf8("\u25B3")); | ||
mTiltUpButton->setToolTip(QStringLiteral("Tilt Up")); | ||
mTiltUpButton->setAutoRepeat(true); | ||
|
||
// Tilt down button | ||
mTiltDownButton = new QPushButton(this); | ||
mTiltDownButton ->setText(QString::fromUtf8("\u25BD")); | ||
mTiltDownButton->setToolTip(QStringLiteral("Tilt Down")); | ||
mTiltDownButton->setAutoRepeat(true); | ||
|
||
// Rotate scene dial | ||
mRotateSceneDial = new QDial(this); | ||
mRotateSceneDial->setWrapping(true); | ||
mRotateSceneDial->setMaximum(359); | ||
mRotateSceneDial->setValue(180); | ||
|
||
QGridLayout *gridLayout = new QGridLayout(this); | ||
gridLayout->addWidget(mTiltUpButton, 0, 0); | ||
gridLayout->addWidget(mTiltDownButton, 3, 0); | ||
gridLayout->addWidget(mZoomInButton, 0, 3); | ||
gridLayout->addWidget(mZoomOutButton, 3, 3); | ||
gridLayout->addWidget(mRotateSceneDial, 1, 1, 2, 2); | ||
|
||
} | ||
|
||
Qgs3DNavigationWidget::~Qgs3DNavigationWidget() | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/*************************************************************************** | ||
qgs3dnavigationwidget.h | ||
-------------------------------------- | ||
Date : July 2017 | ||
Copyright : (C) 2017 by Martin Dobias | ||
Email : wonder dot sk at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGS3DNAVIGATIONWIDGET_H | ||
#define QGS3DNAVIGATIONWIDGET_H | ||
|
||
#include <QWidget> | ||
#include <QPushButton> | ||
#include <QDial> | ||
#include <QGridLayout> | ||
|
||
class Qgs3DNavigationWidget : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
Qgs3DNavigationWidget(QWidget *parent = nullptr); | ||
~Qgs3DNavigationWidget(); | ||
|
||
signals: | ||
|
||
public slots: | ||
|
||
private: | ||
QPushButton *mZoomInButton = nullptr; | ||
QPushButton *mZoomOutButton = nullptr; | ||
QPushButton *mTiltUpButton = nullptr; | ||
QPushButton *mTiltDownButton = nullptr; | ||
QDial *mRotateSceneDial = nullptr; | ||
}; | ||
|
||
#endif // QGS3DNAVIGATIONWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters