From 7b74d88b3f3df27d3f74e88e2ceed75b65bce2e5 2015-04-01 08:31:55 From: Christian Kandeler Date: 2015-04-01 08:31:55 Subject: [PATCH] Fix compilation with namespaced Qt. Change-Id: I359bbf5c89bd23bb1b6db1aeed8a2a4aa2ca12bf Reviewed-by: Andre Poenitz --- diff --git a/examples/charts/audio/widget.h b/examples/charts/audio/widget.h index c442e51..edb6c8a 100644 --- a/examples/charts/audio/widget.h +++ b/examples/charts/audio/widget.h @@ -30,7 +30,10 @@ QT_CHARTS_END_NAMESPACE QT_CHARTS_USE_NAMESPACE class XYSeriesIODevice; + +QT_BEGIN_NAMESPACE class QAudioInput; +QT_END_NAMESPACE class Widget : public QWidget { diff --git a/examples/charts/callout/callout.h b/examples/charts/callout/callout.h index b4a0e35..10988c7 100644 --- a/examples/charts/callout/callout.h +++ b/examples/charts/callout/callout.h @@ -22,7 +22,9 @@ #include #include +QT_BEGIN_NAMESPACE class QGraphicsSceneMouseEvent; +QT_END_NAMESPACE class Callout : public QGraphicsItem { diff --git a/examples/charts/callout/view.h b/examples/charts/callout/view.h index 22fd2b2..c1a6e0d 100644 --- a/examples/charts/callout/view.h +++ b/examples/charts/callout/view.h @@ -21,14 +21,17 @@ #include #include +QT_BEGIN_NAMESPACE +class QGraphicsScene; +class QMouseEvent; +class QResizeEvent; +QT_END_NAMESPACE + QT_CHARTS_BEGIN_NAMESPACE class QChart; QT_CHARTS_END_NAMESPACE -class QGraphicsScene; -class QResizeEvent; class Callout; -class QMouseEvent; QT_CHARTS_USE_NAMESPACE diff --git a/examples/charts/chartthemes/themewidget.h b/examples/charts/chartthemes/themewidget.h index 3471773..a863a67 100644 --- a/examples/charts/chartthemes/themewidget.h +++ b/examples/charts/chartthemes/themewidget.h @@ -22,8 +22,10 @@ #include #include +QT_BEGIN_NAMESPACE class QComboBox; class QCheckBox; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE class QChartView; diff --git a/examples/charts/nesteddonuts/widget.h b/examples/charts/nesteddonuts/widget.h index 997a365..1f2e056 100644 --- a/examples/charts/nesteddonuts/widget.h +++ b/examples/charts/nesteddonuts/widget.h @@ -21,7 +21,9 @@ #include #include +QT_BEGIN_NAMESPACE class QTimer; +QT_END_NAMESPACE QT_CHARTS_USE_NAMESPACE diff --git a/examples/charts/piechartcustomization/brushtool.h b/examples/charts/piechartcustomization/brushtool.h index 71403f5..07a66ba 100644 --- a/examples/charts/piechartcustomization/brushtool.h +++ b/examples/charts/piechartcustomization/brushtool.h @@ -21,8 +21,10 @@ #include #include +QT_BEGIN_NAMESPACE class QPushButton; class QComboBox; +QT_END_NAMESPACE class BrushTool : public QWidget { diff --git a/examples/charts/piechartcustomization/mainwidget.h b/examples/charts/piechartcustomization/mainwidget.h index 5ca1b09..3d68bb7 100644 --- a/examples/charts/piechartcustomization/mainwidget.h +++ b/examples/charts/piechartcustomization/mainwidget.h @@ -21,11 +21,14 @@ #include #include +QT_BEGIN_NAMESPACE class QLineEdit; class QPushButton; class QCheckBox; class QComboBox; class QDoubleSpinBox; +QT_END_NAMESPACE + class PenTool; class BrushTool; class CustomSlice; diff --git a/examples/charts/piechartcustomization/pentool.h b/examples/charts/piechartcustomization/pentool.h index 009c58d..62776bc 100644 --- a/examples/charts/piechartcustomization/pentool.h +++ b/examples/charts/piechartcustomization/pentool.h @@ -21,9 +21,11 @@ #include #include +QT_BEGIN_NAMESPACE class QPushButton; class QDoubleSpinBox; class QComboBox; +QT_END_NAMESPACE class PenTool : public QWidget { diff --git a/examples/charts/qmloscilloscope/datasource.h b/examples/charts/qmloscilloscope/datasource.h index 6029700..16c1724 100644 --- a/examples/charts/qmloscilloscope/datasource.h +++ b/examples/charts/qmloscilloscope/datasource.h @@ -22,7 +22,9 @@ #include #include +QT_BEGIN_NAMESPACE class QQuickView; +QT_END_NAMESPACE QT_CHARTS_USE_NAMESPACE diff --git a/examples/charts/zoomlinechart/chart.h b/examples/charts/zoomlinechart/chart.h index b86a31e..b294146 100644 --- a/examples/charts/zoomlinechart/chart.h +++ b/examples/charts/zoomlinechart/chart.h @@ -21,7 +21,9 @@ #include +QT_BEGIN_NAMESPACE class QGestureEvent; +QT_END_NAMESPACE QT_CHARTS_USE_NAMESPACE diff --git a/src/charts/axis/datetimeaxis/qdatetimeaxis.h b/src/charts/axis/datetimeaxis/qdatetimeaxis.h index 5172b53..5da78e7 100644 --- a/src/charts/axis/datetimeaxis/qdatetimeaxis.h +++ b/src/charts/axis/datetimeaxis/qdatetimeaxis.h @@ -21,7 +21,9 @@ #include +QT_BEGIN_NAMESPACE class QDateTime; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/axis/logvalueaxis/qlogvalueaxis.h b/src/charts/axis/logvalueaxis/qlogvalueaxis.h index 6b73986..d1f26fd 100644 --- a/src/charts/axis/logvalueaxis/qlogvalueaxis.h +++ b/src/charts/axis/logvalueaxis/qlogvalueaxis.h @@ -21,7 +21,9 @@ #include +QT_BEGIN_NAMESPACE class QDateTime; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/axis/qabstractaxis_p.h b/src/charts/axis/qabstractaxis_p.h index 9a3f95e..edb699e 100644 --- a/src/charts/axis/qabstractaxis_p.h +++ b/src/charts/axis/qabstractaxis_p.h @@ -33,7 +33,9 @@ #include #include +QT_BEGIN_NAMESPACE class QGraphicsItem; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/barchart/qbarmodelmapper.h b/src/charts/barchart/qbarmodelmapper.h index 7bd1bae..d14d39e 100644 --- a/src/charts/barchart/qbarmodelmapper.h +++ b/src/charts/barchart/qbarmodelmapper.h @@ -22,7 +22,9 @@ #include #include +QT_BEGIN_NAMESPACE class QAbstractItemModel; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/barchart/qbarmodelmapper_p.h b/src/charts/barchart/qbarmodelmapper_p.h index 6e4f486..930d8fe 100644 --- a/src/charts/barchart/qbarmodelmapper_p.h +++ b/src/charts/barchart/qbarmodelmapper_p.h @@ -31,7 +31,9 @@ #include #include +QT_BEGIN_NAMESPACE class QModelIndex; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/boxplotchart/qboxplotmodelmapper.h b/src/charts/boxplotchart/qboxplotmodelmapper.h index 91ee6f6..0a179bf 100644 --- a/src/charts/boxplotchart/qboxplotmodelmapper.h +++ b/src/charts/boxplotchart/qboxplotmodelmapper.h @@ -22,7 +22,9 @@ #include #include +QT_BEGIN_NAMESPACE class QAbstractItemModel; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/boxplotchart/qboxplotmodelmapper_p.h b/src/charts/boxplotchart/qboxplotmodelmapper_p.h index efdf754..758f8ec 100644 --- a/src/charts/boxplotchart/qboxplotmodelmapper_p.h +++ b/src/charts/boxplotchart/qboxplotmodelmapper_p.h @@ -31,7 +31,9 @@ #include #include +QT_BEGIN_NAMESPACE class QModelIndex; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/chartbackground_p.h b/src/charts/chartbackground_p.h index 8fec472..8a5694f 100644 --- a/src/charts/chartbackground_p.h +++ b/src/charts/chartbackground_p.h @@ -31,7 +31,10 @@ #include #include +QT_BEGIN_NAMESPACE class QGraphicsDropShadowEffect; +QT_END_NAMESPACE + QT_CHARTS_BEGIN_NAMESPACE class ChartBackground: public QGraphicsRectItem diff --git a/src/charts/piechart/piechartitem_p.h b/src/charts/piechart/piechartitem_p.h index 3f952cc..4d6d84d 100644 --- a/src/charts/piechart/piechartitem_p.h +++ b/src/charts/piechart/piechartitem_p.h @@ -33,7 +33,10 @@ #include #include +QT_BEGIN_NAMESPACE class QGraphicsItem; +QT_END_NAMESPACE + QT_CHARTS_BEGIN_NAMESPACE class QPieSlice; class ChartPresenter; diff --git a/src/charts/piechart/qpiemodelmapper.h b/src/charts/piechart/qpiemodelmapper.h index dde48c9..9daf1e0 100644 --- a/src/charts/piechart/qpiemodelmapper.h +++ b/src/charts/piechart/qpiemodelmapper.h @@ -22,7 +22,9 @@ #include #include +QT_BEGIN_NAMESPACE class QAbstractItemModel; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/piechart/qpiemodelmapper_p.h b/src/charts/piechart/qpiemodelmapper_p.h index 0691042..9c94c38 100644 --- a/src/charts/piechart/qpiemodelmapper_p.h +++ b/src/charts/piechart/qpiemodelmapper_p.h @@ -31,7 +31,9 @@ #include #include +QT_BEGIN_NAMESPACE class QModelIndex; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/qabstractseries_p.h b/src/charts/qabstractseries_p.h index 1e72c23..160297c 100644 --- a/src/charts/qabstractseries_p.h +++ b/src/charts/qabstractseries_p.h @@ -32,7 +32,9 @@ #include #include +QT_BEGIN_NAMESPACE class QGraphicsItem; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/qchart.h b/src/charts/qchart.h index 1836f65..6634581 100644 --- a/src/charts/qchart.h +++ b/src/charts/qchart.h @@ -24,7 +24,9 @@ #include #include +QT_BEGIN_NAMESPACE class QGraphicsSceneResizeEvent; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/qchartview.h b/src/charts/qchartview.h index 37c45d9..6de8b6c 100644 --- a/src/charts/qchartview.h +++ b/src/charts/qchartview.h @@ -24,8 +24,10 @@ #include #include +QT_BEGIN_NAMESPACE class QGraphicsScene; class QRubberBand; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/qchartview_p.h b/src/charts/qchartview_p.h index 659b4fe..59de3dd 100644 --- a/src/charts/qchartview_p.h +++ b/src/charts/qchartview_p.h @@ -30,12 +30,14 @@ #include +QT_BEGIN_NAMESPACE class QGraphicsScene; -class ChartPresenter; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE class QChart; +class ChartPresenter; class QChartView; class QChartViewPrivate diff --git a/src/charts/scroller_p.h b/src/charts/scroller_p.h index 77b3352..d94d711 100644 --- a/src/charts/scroller_p.h +++ b/src/charts/scroller_p.h @@ -34,7 +34,9 @@ #include #include +QT_BEGIN_NAMESPACE class QGraphicsSceneMouseEvent; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/xychart/qxymodelmapper.h b/src/charts/xychart/qxymodelmapper.h index d0e0d9d..e357ebf 100644 --- a/src/charts/xychart/qxymodelmapper.h +++ b/src/charts/xychart/qxymodelmapper.h @@ -22,7 +22,9 @@ #include #include +QT_BEGIN_NAMESPACE class QAbstractItemModel; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/xychart/qxymodelmapper_p.h b/src/charts/xychart/qxymodelmapper_p.h index c38df0c..0c16396 100644 --- a/src/charts/xychart/qxymodelmapper_p.h +++ b/src/charts/xychart/qxymodelmapper_p.h @@ -31,9 +31,11 @@ #include #include +QT_BEGIN_NAMESPACE class QModelIndex; class QAbstractItemModel; class QPointF; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/src/charts/xychart/qxyseries.h b/src/charts/xychart/qxyseries.h index 4e3d876..53a7a93 100644 --- a/src/charts/xychart/qxyseries.h +++ b/src/charts/xychart/qxyseries.h @@ -24,7 +24,9 @@ #include #include +QT_BEGIN_NAMESPACE class QModelIndex; +QT_END_NAMESPACE QT_CHARTS_BEGIN_NAMESPACE diff --git a/tests/auto/inc/tst_definitions.h b/tests/auto/inc/tst_definitions.h index fe14ea1..e2e73af 100644 --- a/tests/auto/inc/tst_definitions.h +++ b/tests/auto/inc/tst_definitions.h @@ -23,6 +23,7 @@ #include #include +QT_BEGIN_NAMESPACE namespace QTest { // This was deprecated in Qt5. This is a small hack for the sake of compatibility. @@ -31,6 +32,7 @@ namespace QTest return QTest::qWaitForWindowExposed(window); } } +QT_END_NAMESPACE #define TRY_COMPARE(actual, expected) { \ do { \ diff --git a/tests/manual/boxplottester/mainwidget.h b/tests/manual/boxplottester/mainwidget.h index 5e65642..b4b4c42 100644 --- a/tests/manual/boxplottester/mainwidget.h +++ b/tests/manual/boxplottester/mainwidget.h @@ -29,7 +29,10 @@ #include #include +QT_BEGIN_NAMESPACE class QGridLayout; +QT_END_NAMESPACE + class CustomTableModel; class PenTool; diff --git a/tests/manual/boxplottester/pentool.h b/tests/manual/boxplottester/pentool.h index 009c58d..62776bc 100644 --- a/tests/manual/boxplottester/pentool.h +++ b/tests/manual/boxplottester/pentool.h @@ -21,9 +21,11 @@ #include #include +QT_BEGIN_NAMESPACE class QPushButton; class QDoubleSpinBox; class QComboBox; +QT_END_NAMESPACE class PenTool : public QWidget { diff --git a/tests/manual/chartviewer/grid.h b/tests/manual/chartviewer/grid.h index 74eec0e..42a6b8e 100644 --- a/tests/manual/chartviewer/grid.h +++ b/tests/manual/chartviewer/grid.h @@ -23,7 +23,10 @@ #include #include +QT_BEGIN_NAMESPACE class QGraphicsGridLayout; +QT_END_NAMESPACE + class Chart; QT_CHARTS_BEGIN_NAMESPACE diff --git a/tests/manual/chartviewer/view.h b/tests/manual/chartviewer/view.h index a5bac1b..b5cdcdc 100644 --- a/tests/manual/chartviewer/view.h +++ b/tests/manual/chartviewer/view.h @@ -20,8 +20,10 @@ #define VIEW_H #include +QT_BEGIN_NAMESPACE class QGraphicsScene; class QResizeEvent; +QT_END_NAMESPACE class View: public QGraphicsView { diff --git a/tests/manual/chartviewer/window.h b/tests/manual/chartviewer/window.h index 7419735..1c9f6ac 100644 --- a/tests/manual/chartviewer/window.h +++ b/tests/manual/chartviewer/window.h @@ -23,15 +23,17 @@ #include #include +QT_BEGIN_NAMESPACE class QCheckBox; +class QGraphicsLinearLayout; class QGraphicsRectItem; class QGraphicsScene; class QGraphicsWidget; +QT_END_NAMESPACE + class View; -class QGraphicsLinearLayout; class Chart; class Grid; -class QPushButton; QT_CHARTS_BEGIN_NAMESPACE class QChart; diff --git a/tests/manual/chartwidgettest/dataseriedialog.h b/tests/manual/chartwidgettest/dataseriedialog.h index f90b9ae..f5f1d74 100644 --- a/tests/manual/chartwidgettest/dataseriedialog.h +++ b/tests/manual/chartwidgettest/dataseriedialog.h @@ -21,8 +21,10 @@ #include +QT_BEGIN_NAMESPACE class QGroupBox; class QCheckBox; +QT_END_NAMESPACE class DataSerieDialog : public QDialog { diff --git a/tests/manual/chartwidgettest/mainwidget.h b/tests/manual/chartwidgettest/mainwidget.h index c27f811..b11bd53 100644 --- a/tests/manual/chartwidgettest/mainwidget.h +++ b/tests/manual/chartwidgettest/mainwidget.h @@ -24,9 +24,11 @@ #include #include +QT_BEGIN_NAMESPACE class QSpinBox; class QCheckBox; class QGridLayout; +QT_END_NAMESPACE QT_CHARTS_USE_NAMESPACE diff --git a/tests/manual/polarcharttest/mainwindow.h b/tests/manual/polarcharttest/mainwindow.h index 237e262..1e6f21c 100644 --- a/tests/manual/polarcharttest/mainwindow.h +++ b/tests/manual/polarcharttest/mainwindow.h @@ -28,14 +28,17 @@ #include #include +QT_BEGIN_NAMESPACE +class QBrush; +class QPen; + namespace Ui { class MainWindow; } +QT_END_NAMESPACE -QT_CHARTS_USE_NAMESPACE -class QBrush; -class QPen; +QT_CHARTS_USE_NAMESPACE class MainWindow : public QMainWindow {