Skip to content

Commit

Permalink
Remove include of QtGui in favor of individual includes
Browse files Browse the repository at this point in the history
The reason for removing instances of "#include <QtGui>" is twofold:

1) Including it will probably include more than is actually needed. Plus,
   it hide what is actually needed, especially if in a header

2) Qt 5 splits Gui into Gui and Widgets, so being explict about what is
   needed gets around this problem
  • Loading branch information
simonsonc committed Mar 16, 2014
1 parent 1c0d5e2 commit 690e7b0
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/app/composer/qgsatlascompositionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* *
***************************************************************************/

#include <QMessageBox>

#include "qgsatlascompositionwidget.h"
#include "qgsatlascomposition.h"
#include "qgscomposition.h"
Expand Down
1 change: 1 addition & 0 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
#include <QPaintEngine>
#include <QProgressBar>
#include <QProgressDialog>
#include <QShortcut>


// sort function for QList<QAction*>, e.g. menu listings
Expand Down
2 changes: 2 additions & 0 deletions src/app/composer/qgscomposer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class QResizeEvent;
class QFile;
class QSizeGrip;
class QUndoView;
class QComboBox;
class QLabel;

/** \ingroup MapComposer
* \brief A gui for composing a printable map.
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* *
***************************************************************************/

#include <QtGui>
#include <QDockWidget>
#include <QMessageBox>

#include "qgsattributetabledialog.h"
#include "qgsattributetablemodel.h"
Expand Down
18 changes: 9 additions & 9 deletions src/app/qgsundowidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#ifndef QGSUNDOWIDGET_H
#define QGSUNDOWIDGET_H

#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDockWidget>
#include <QtGui/QGridLayout>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QWidget>
#include <QVariant>
#include <QAction>
#include <QApplication>
#include <QButtonGroup>
#include <QDockWidget>
#include <QGridLayout>
#include <QPushButton>
#include <QSpacerItem>
#include <QWidget>
#include <QUndoView>
#include <QUndoStack>

Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposereffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#ifndef QGSCOMPOSEREFFECT_H
#define QGSCOMPOSEREFFECT_H

#include <QtGui>
#include <QGraphicsEffect>
#include <QPainter>

class CORE_EXPORT QgsComposerEffect : public QGraphicsEffect
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposerlabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <QDate>
#include <QDomElement>
#include <QPainter>
#include <QSettings>
#include <QTimer>
#include <QWebFrame>
#include <QWebPage>
#include <QEventLoop>
Expand Down
1 change: 1 addition & 0 deletions src/core/composer/qgscomposerlegendstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "qgscomposition.h"
#include <QFont>
#include <QMap>
#include <QSettings>
#include <QString>
#include <QDomElement>
#include <QDomDocument>
Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposermousehandles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include <QGraphicsView>
#include <QGraphicsSceneHoverEvent>
#include <QPainter>
#include <QWidget>

Expand Down
1 change: 1 addition & 0 deletions src/core/composer/qgscomposertable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "qgscomposertable.h"
#include "qgslogger.h"
#include <QPainter>
#include <QSettings>

QgsComposerTable::QgsComposerTable( QgsComposition* composition )
: QgsComposerItem( composition )
Expand Down
1 change: 1 addition & 0 deletions src/core/composer/qgspaperitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "qgsstylev2.h"
#include "qgslogger.h"
#include <QGraphicsRectItem>
#include <QGraphicsView>
#include <QPainter>

//QgsPaperGrid
Expand Down
1 change: 0 additions & 1 deletion src/gui/attributetable/qgsattributetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "qgsexpression.h"
#include "qgsmaplayeractionregistry.h"

#include <QtGui>
#include <QVariant>

#include <limits>
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgscomposerview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <QClipboard>
#include <QMimeData>
#include <QGridLayout>
#include <QScrollBar>
#include <QDesktopWidget>

#include "qgsapplication.h"
#include "qgscomposerview.h"
Expand Down
8 changes: 7 additions & 1 deletion src/gui/symbology-ng/characterwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@
**
****************************************************************************/

#include <QtGui>
#include <QFontDatabase>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QPainter>
#include <QPen>
#include <QPoint>
#include <QToolTip>

#include "characterwidget.h"

Expand Down

0 comments on commit 690e7b0

Please sign in to comment.