diff options
author | David Schulz <david.schulz@digia.com> | 2012-11-23 09:31:03 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-23 17:04:00 +0100 |
commit | dae8d2505d6b6c591429768c10ae3ca190679d41 (patch) | |
tree | 8feab16aa3ae17e410c0ef222a5ec6b79962eb65 /examples/widgets/graphicsview/chip | |
parent | cbf3771e86272c10519394627784d6c1088f3a3b (diff) |
QtBase: examples/widgets/graphicsview/ codestyle
Change-Id: I501066b5eb5a1557d510e0ec20b5270e8c12704a
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'examples/widgets/graphicsview/chip')
-rw-r--r-- | examples/widgets/graphicsview/chip/chip.h | 9 | ||||
-rw-r--r-- | examples/widgets/graphicsview/chip/main.cpp | 2 | ||||
-rw-r--r-- | examples/widgets/graphicsview/chip/mainwindow.cpp | 5 | ||||
-rw-r--r-- | examples/widgets/graphicsview/chip/mainwindow.h | 13 | ||||
-rw-r--r-- | examples/widgets/graphicsview/chip/view.cpp | 8 | ||||
-rw-r--r-- | examples/widgets/graphicsview/chip/view.h | 10 |
6 files changed, 25 insertions, 22 deletions
diff --git a/examples/widgets/graphicsview/chip/chip.h b/examples/widgets/graphicsview/chip/chip.h index 7e98b24502..c90d314e7d 100644 --- a/examples/widgets/graphicsview/chip/chip.h +++ b/examples/widgets/graphicsview/chip/chip.h @@ -42,8 +42,8 @@ #ifndef CHIP_H #define CHIP_H -#include <QtGui/QColor> -#include <QtWidgets/QGraphicsItem> +#include <QColor> +#include <QGraphicsItem> class Chip : public QGraphicsItem { @@ -60,9 +60,10 @@ protected: void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); private: - int x, y; + int x; + int y; QColor color; QVector<QPointF> stuff; }; -#endif +#endif // CHIP_H diff --git a/examples/widgets/graphicsview/chip/main.cpp b/examples/widgets/graphicsview/chip/main.cpp index 0f660f5fc4..cb1ad418ad 100644 --- a/examples/widgets/graphicsview/chip/main.cpp +++ b/examples/widgets/graphicsview/chip/main.cpp @@ -43,7 +43,7 @@ #include <QApplication> -int main(int argc, char **argv) +int main(int argc, char *argv[]) { Q_INIT_RESOURCE(images); diff --git a/examples/widgets/graphicsview/chip/mainwindow.cpp b/examples/widgets/graphicsview/chip/mainwindow.cpp index 1987f535a2..c9e5f82f88 100644 --- a/examples/widgets/graphicsview/chip/mainwindow.cpp +++ b/examples/widgets/graphicsview/chip/mainwindow.cpp @@ -39,11 +39,12 @@ ** ****************************************************************************/ +#include "chip.h" #include "mainwindow.h" #include "view.h" -#include "chip.h" -#include <QtWidgets> +#include <QHBoxLayout> +#include <QSplitter> MainWindow::MainWindow(QWidget *parent) : QWidget(parent) diff --git a/examples/widgets/graphicsview/chip/mainwindow.h b/examples/widgets/graphicsview/chip/mainwindow.h index 00e006f900..c615b78da1 100644 --- a/examples/widgets/graphicsview/chip/mainwindow.h +++ b/examples/widgets/graphicsview/chip/mainwindow.h @@ -42,13 +42,12 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include <QtWidgets/qwidget.h> +#include <QWidget> -QT_FORWARD_DECLARE_CLASS(QGraphicsScene) -QT_FORWARD_DECLARE_CLASS(QGraphicsView) -QT_FORWARD_DECLARE_CLASS(QLabel) -QT_FORWARD_DECLARE_CLASS(QSlider) -QT_FORWARD_DECLARE_CLASS(QSplitter) +QT_BEGIN_NAMESPACE +class QGraphicsScene; +class QSplitter; +QT_END_NAMESPACE class MainWindow : public QWidget { @@ -65,4 +64,4 @@ private: QSplitter *h2Splitter; }; -#endif +#endif // MAINWINDOW_H diff --git a/examples/widgets/graphicsview/chip/view.cpp b/examples/widgets/graphicsview/chip/view.cpp index 56ad17b9e8..cb83175744 100644 --- a/examples/widgets/graphicsview/chip/view.cpp +++ b/examples/widgets/graphicsview/chip/view.cpp @@ -41,7 +41,6 @@ #include "view.h" -#include <QtWidgets> #ifndef QT_NO_PRINTER #include <QPrinter> #include <QPrintDialog> @@ -178,8 +177,10 @@ View::View(const QString &name, QWidget *parent) connect(resetButton, SIGNAL(clicked()), this, SLOT(resetView())); connect(zoomSlider, SIGNAL(valueChanged(int)), this, SLOT(setupMatrix())); connect(rotateSlider, SIGNAL(valueChanged(int)), this, SLOT(setupMatrix())); - connect(graphicsView->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(setResetButtonEnabled())); - connect(graphicsView->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(setResetButtonEnabled())); + connect(graphicsView->verticalScrollBar(), SIGNAL(valueChanged(int)), + this, SLOT(setResetButtonEnabled())); + connect(graphicsView->horizontalScrollBar(), SIGNAL(valueChanged(int)), + this, SLOT(setResetButtonEnabled())); connect(selectModeButton, SIGNAL(toggled(bool)), this, SLOT(togglePointerMode())); connect(dragModeButton, SIGNAL(toggled(bool)), this, SLOT(togglePointerMode())); connect(antialiasButton, SIGNAL(toggled(bool)), this, SLOT(toggleAntialiasing())); @@ -276,4 +277,3 @@ void View::rotateRight() { rotateSlider->setValue(rotateSlider->value() + 10); } - diff --git a/examples/widgets/graphicsview/chip/view.h b/examples/widgets/graphicsview/chip/view.h index 5fc9bed630..b6cdc41200 100644 --- a/examples/widgets/graphicsview/chip/view.h +++ b/examples/widgets/graphicsview/chip/view.h @@ -45,9 +45,11 @@ #include <QFrame> #include <QGraphicsView> -QT_FORWARD_DECLARE_CLASS(QLabel) -QT_FORWARD_DECLARE_CLASS(QSlider) -QT_FORWARD_DECLARE_CLASS(QToolButton) +QT_BEGIN_NAMESPACE +class QLabel; +class QSlider; +class QToolButton; +QT_END_NAMESPACE class View; @@ -101,4 +103,4 @@ private: QSlider *rotateSlider; }; -#endif +#endif // VIEW_H |