summaryrefslogtreecommitdiffstats
path: root/src/widget
diff options
context:
space:
mode:
authorRJ Ryan <rryan@mixxx.org>2013-11-30 19:19:10 -0500
committerRJ Ryan <rryan@mixxx.org>2013-11-30 19:19:10 -0500
commit4845e95acb542120191f309e050d785699730048 (patch)
tree34796d4c030011d77ee083713b4a302875b94bf3 /src/widget
parent64e7966c2a2b83b136b56086b6c8de2bb3dcdcd0 (diff)
Header/include cleanups across the codebase.
* Eliminate all instances of including QtCore, QtGui, or QtXml. * Replace all old-style Qt header inclusions with new-style (e.g. #include <application.h>). * Include QtDebug instead of QDebug. * Update many classes to include the Qt classes they use in their header and implementation file. This speeds up compile and link performance and reduces the size of the compiled object files. My build directory dropped by 50MB.
Diffstat (limited to 'src/widget')
-rw-r--r--src/widget/hexspinbox.cpp14
-rw-r--r--src/widget/hexspinbox.h4
-rw-r--r--src/widget/wdisplay.h12
-rw-r--r--src/widget/wknob.h9
-rw-r--r--src/widget/wlibrarysidebar.cpp7
-rw-r--r--src/widget/wlibrarysidebar.h10
-rw-r--r--src/widget/wnumber.cpp8
-rw-r--r--src/widget/wnumber.h6
-rw-r--r--src/widget/wnumberpos.h4
-rw-r--r--src/widget/wpushbutton.cpp14
-rw-r--r--src/widget/wpushbutton.h7
-rw-r--r--src/widget/wslidercomposed.cpp11
-rw-r--r--src/widget/wslidercomposed.h11
-rw-r--r--src/widget/wspinny.cpp1
-rw-r--r--src/widget/wstatuslight.h10
-rw-r--r--src/widget/wtracktableview.cpp6
-rw-r--r--src/widget/wvumeter.cpp16
-rw-r--r--src/widget/wvumeter.h10
-rw-r--r--src/widget/wwaveformviewer.cpp4
-rw-r--r--src/widget/wwidget.cpp5
20 files changed, 89 insertions, 80 deletions
diff --git a/src/widget/hexspinbox.cpp b/src/widget/hexspinbox.cpp
index e3f25c4c53..68825a2a90 100644
--- a/src/widget/hexspinbox.cpp
+++ b/src/widget/hexspinbox.cpp
@@ -1,6 +1,4 @@
-#include <qvalidator.h>
-
-#include "hexspinbox.h"
+#include "widget/hexspinbox.h"
HexSpinBox::HexSpinBox(QWidget *parent)
: QSpinBox(parent)
@@ -9,12 +7,12 @@ HexSpinBox::HexSpinBox(QWidget *parent)
setRange(0, 255);
}
-QString HexSpinBox::textFromValue(int value) const
+QString HexSpinBox::textFromValue(int value) const
{
- //Construct a hex string formatted like 0x0f.
- return QString("0x") + QString("%1").arg(value,
+ //Construct a hex string formatted like 0x0f.
+ return QString("0x") + QString("%1").arg(value,
2, //Field width (makes "F" become "0F")
- 16,
+ 16,
QLatin1Char('0')).toUpper();
}
@@ -27,6 +25,6 @@ int HexSpinBox::valueFromText(const QString& text) const
QValidator::State HexSpinBox::validate ( QString & input, int & pos ) const
{
const QRegExp regExp("^0(x|X)[0-9A-Fa-f]+");
- QRegExpValidator validator(regExp, NULL);
+ QRegExpValidator validator(regExp, NULL);
return validator.validate(input, pos);
}
diff --git a/src/widget/hexspinbox.h b/src/widget/hexspinbox.h
index c7a795cf0d..a8b8e4511c 100644
--- a/src/widget/hexspinbox.h
+++ b/src/widget/hexspinbox.h
@@ -1,8 +1,8 @@
#ifndef HEXSPINBOX_H
#define HEXSPINBOX_H
-#include <qspinbox.h>
-#include <qvalidator.h>
+#include <QSpinBox>
+#include <QValidator>
class HexSpinBox : public QSpinBox
{
diff --git a/src/widget/wdisplay.h b/src/widget/wdisplay.h
index c55e1407b0..466e45b93a 100644
--- a/src/widget/wdisplay.h
+++ b/src/widget/wdisplay.h
@@ -18,11 +18,11 @@
#ifndef WDISPLAY_H
#define WDISPLAY_H
-#include "wwidget.h"
-#include <qpixmap.h>
-#include <qstring.h>
-//Added by qt3to4:
+#include <QPixmap>
#include <QPaintEvent>
+#include <QString>
+
+#include "widget/wwidget.h"
/**
*@author Tue & Ken Haste Andersen
@@ -30,13 +30,13 @@
class WDisplay : public WWidget {
Q_OBJECT
-public:
+public:
WDisplay(QWidget *parent=0);
~WDisplay();
void setup(QDomNode node);
void setPositions(int iNoPos);
void setPixmap(int iPos, const QString &filename);
-
+
private:
/** Set position number to zero and deallocate pixmaps */
void resetPositions();
diff --git a/src/widget/wknob.h b/src/widget/wknob.h
index 85bae3c28b..512172ccee 100644
--- a/src/widget/wknob.h
+++ b/src/widget/wknob.h
@@ -18,12 +18,13 @@
#ifndef WKNOB_H
#define WKNOB_H
-#include "wabstractcontrol.h"
-#include <qpixmap.h>
-#include <qstring.h>
-//Added by qt3to4:
+#include <QPixmap>
+#include <QString>
#include <QPaintEvent>
#include <QMouseEvent>
+#include <QWheelEvent>
+
+#include "widget/wabstractcontrol.h"
/**
*@author Tue & Ken Haste Andersen
diff --git a/src/widget/wlibrarysidebar.cpp b/src/widget/wlibrarysidebar.cpp
index 83f9dccabb..90d4edc7cc 100644
--- a/src/widget/wlibrarysidebar.cpp
+++ b/src/widget/wlibrarysidebar.cpp
@@ -1,9 +1,10 @@
-#include <QtCore>
-#include <QtGui>
+#include "widget/wlibrarysidebar.h"
+
#include <QHeaderView>
+#include <QUrl>
+#include <QtDebug>
#include "library/sidebarmodel.h"
-#include "widget/wlibrarysidebar.h"
const int expand_time = 250;
diff --git a/src/widget/wlibrarysidebar.h b/src/widget/wlibrarysidebar.h
index ae7d8edf5b..465fe0cbdd 100644
--- a/src/widget/wlibrarysidebar.h
+++ b/src/widget/wlibrarysidebar.h
@@ -1,9 +1,15 @@
#ifndef WLIBRARYSIDEBAR_H
#define WLIBRARYSIDEBAR_H
-#include <QtGui>
-#include <QTreeView>
#include <QBasicTimer>
+#include <QContextMenuEvent>
+#include <QDragEnterEvent>
+#include <QDragMoveEvent>
+#include <QKeyEvent>
+#include <QModelIndex>
+#include <QPoint>
+#include <QTimerEvent>
+#include <QTreeView>
class WLibrarySidebar : public QTreeView {
Q_OBJECT
diff --git a/src/widget/wnumber.cpp b/src/widget/wnumber.cpp
index f6fc182fc7..2dd0d11d04 100644
--- a/src/widget/wnumber.cpp
+++ b/src/widget/wnumber.cpp
@@ -15,13 +15,15 @@
* *
***************************************************************************/
-#include "wnumber.h"
-#include "wskincolor.h"
+#include "widget/wnumber.h"
+
#include <math.h>
-#include <qfont.h>
+#include <QFont>
#include <QLabel>
#include <QVBoxLayout>
+#include "widget/wskincolor.h"
+
WNumber::WNumber(QWidget * parent) : WWidget(parent)
{
m_pLabel = new QLabel(this);
diff --git a/src/widget/wnumber.h b/src/widget/wnumber.h
index 62f13b7545..284e8884d3 100644
--- a/src/widget/wnumber.h
+++ b/src/widget/wnumber.h
@@ -18,9 +18,9 @@
#ifndef WNUMBER_H
#define WNUMBER_H
-#include "wwidget.h"
-#include <qlabel.h>
-#include <qevent.h>
+#include <QLabel>
+
+#include "widget/wwidget.h"
/**
*@author Tue & Ken Haste Andersen
diff --git a/src/widget/wnumberpos.h b/src/widget/wnumberpos.h
index 36d842ec86..bbce3d3f40 100644
--- a/src/widget/wnumberpos.h
+++ b/src/widget/wnumberpos.h
@@ -3,6 +3,8 @@
#ifndef WNUMBERPOS_H
#define WNUMBERPOS_H
+#include <QMouseEvent>
+
#include "wnumber.h"
class ControlObjectThreadWidget;
@@ -41,4 +43,4 @@ class WNumberPos : public WNumber {
ControlObjectThreadWidget* m_pTrackSampleRate;
};
-#endif \ No newline at end of file
+#endif
diff --git a/src/widget/wpushbutton.cpp b/src/widget/wpushbutton.cpp
index 764b165755..10029a9e0c 100644
--- a/src/widget/wpushbutton.cpp
+++ b/src/widget/wpushbutton.cpp
@@ -15,18 +15,20 @@
* *
***************************************************************************/
-#include "wpushbutton.h"
-#include "wpixmapstore.h"
-#include "controlobject.h"
-#include "controlpushbutton.h"
-#include "control/controlbehavior.h"
-//Added by qt3to4:
+#include "widget/wpushbutton.h"
+
+#include <QPainter>
#include <QPixmap>
#include <QtDebug>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QApplication>
+#include "widget/wpixmapstore.h"
+#include "controlobject.h"
+#include "controlpushbutton.h"
+#include "control/controlbehavior.h"
+
const int PB_SHORTKLICKTIME = 200;
WPushButton::WPushButton(QWidget * parent) :
diff --git a/src/widget/wpushbutton.h b/src/widget/wpushbutton.h
index 77153a792e..6449a50419 100644
--- a/src/widget/wpushbutton.h
+++ b/src/widget/wpushbutton.h
@@ -18,12 +18,13 @@
#ifndef WPUSHBUTTON_H
#define WPUSHBUTTON_H
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qstring.h>
+#include <QPaintEvent>
+#include <QPixmap>
+#include <QString>
#include <QPaintEvent>
#include <QMouseEvent>
#include <QFocusEvent>
+#include <QTimer>
#include "widget/wwidget.h"
#include "controlpushbutton.h"
diff --git a/src/widget/wslidercomposed.cpp b/src/widget/wslidercomposed.cpp
index 2e85499d9f..5c7911440c 100644
--- a/src/widget/wslidercomposed.cpp
+++ b/src/widget/wslidercomposed.cpp
@@ -15,16 +15,13 @@
* *
***************************************************************************/
-#include "wslidercomposed.h"
-#include <qpixmap.h>
+#include "widget/wslidercomposed.h"
+
#include <QtDebug>
-#include <qpainter.h>
-//Added by qt3to4:
-#include <QMouseEvent>
-#include <QPaintEvent>
#include <QPainter>
+
#include "defs.h"
-#include "wpixmapstore.h"
+#include "widget/wpixmapstore.h"
WSliderComposed::WSliderComposed(QWidget * parent)
: WAbstractControl(parent),
diff --git a/src/widget/wslidercomposed.h b/src/widget/wslidercomposed.h
index 4fbaacf83e..6186b93d6b 100644
--- a/src/widget/wslidercomposed.h
+++ b/src/widget/wslidercomposed.h
@@ -18,12 +18,15 @@
#ifndef WSLIDERCOMPOSED_H
#define WSLIDERCOMPOSED_H
-#include "wabstractcontrol.h"
-#include <qstring.h>
-#include <qpixmap.h>
-//Added by qt3to4:
+#include <QString>
+#include <QWidget>
+#include <QDomNode>
+#include <QWheelEvent>
#include <QPaintEvent>
#include <QMouseEvent>
+
+#include "widget/wabstractcontrol.h"
+
/**
* A widget for a slider composed of a background pixmap and a handle.
*
diff --git a/src/widget/wspinny.cpp b/src/widget/wspinny.cpp
index 746cb69385..180aab76b3 100644
--- a/src/widget/wspinny.cpp
+++ b/src/widget/wspinny.cpp
@@ -2,6 +2,7 @@
#include <QtDebug>
#include <QApplication>
+#include <QUrl>
#include "mathstuff.h"
#include "wimagestore.h"
diff --git a/src/widget/wstatuslight.h b/src/widget/wstatuslight.h
index aad96ee7fa..f01b844ead 100644
--- a/src/widget/wstatuslight.h
+++ b/src/widget/wstatuslight.h
@@ -20,11 +20,13 @@
#ifndef WSTATUSLIGHT_H
#define WSTATUSLIGHT_H
-#include "wwidget.h"
-#include <qpixmap.h>
-#include <qstring.h>
-//Added by qt3to4:
#include <QPaintEvent>
+#include <QWidget>
+#include <QString>
+#include <QDomNode>
+#include <QPixmap>
+
+#include "widget/wwidget.h"
/**
*@author John Sully
diff --git a/src/widget/wtracktableview.cpp b/src/widget/wtracktableview.cpp
index 561d1b951e..cda36d6124 100644
--- a/src/widget/wtracktableview.cpp
+++ b/src/widget/wtracktableview.cpp
@@ -1,9 +1,7 @@
-#include <QItemDelegate>
-#include <QtCore>
-#include <QtGui>
-#include <QtXml>
#include <QModelIndex>
#include <QInputDialog>
+#include <QDesktopServices>
+#include <QUrl>
#include "widget/wwidget.h"
#include "widget/wskincolor.h"
diff --git a/src/widget/wvumeter.cpp b/src/widget/wvumeter.cpp
index 42c43f3c57..dcdcccdf5e 100644
--- a/src/widget/wvumeter.cpp
+++ b/src/widget/wvumeter.cpp
@@ -15,22 +15,21 @@
* *
***************************************************************************/
-#include "wvumeter.h"
-#include "wpixmapstore.h"
-//Added by qt3to4:
+#include "widget/wvumeter.h"
+
#include <QPaintEvent>
-#include <QtGui>
-#include <QtCore>
+#include <QPainter>
#include <QtDebug>
#include <QPixmap>
+#include "widget/wpixmapstore.h"
+#include "util/timer.h"
+
#define DEFAULT_FALLTIME 20
#define DEFAULT_FALLSTEP 1
#define DEFAULT_HOLDTIME 400
#define DEFAULT_HOLDSIZE 5
-#include "util/timer.h"
-
WVuMeter::WVuMeter(QWidget * parent) :
WWidget(parent),
m_iNoPos(0),
@@ -193,6 +192,3 @@ void WVuMeter::paintEvent(QPaintEvent *)
}
}
}
-
-
-
diff --git a/src/widget/wvumeter.h b/src/widget/wvumeter.h
index 6047d96e1b..b70deaaa73 100644
--- a/src/widget/wvumeter.h
+++ b/src/widget/wvumeter.h
@@ -18,12 +18,14 @@
#ifndef WVUMETER_H
#define WVUMETER_H
-#include "wwidget.h"
-#include <qpixmap.h>
-#include <qstring.h>
-//Added by qt3to4:
+#include "widget/wwidget.h"
+
+#include <QPixmap>
+#include <QString>
#include <QPaintEvent>
#include <QTime>
+#include <QWidget>
+#include <QDomNode>
/**
*@author Tue & Ken Haste Andersen
diff --git a/src/widget/wwaveformviewer.cpp b/src/widget/wwaveformviewer.cpp
index 774c8889a2..c70b6275dd 100644
--- a/src/widget/wwaveformviewer.cpp
+++ b/src/widget/wwaveformviewer.cpp
@@ -1,6 +1,6 @@
-#include <QDebug>
-#include <QtXml/QDomNode>
+#include <QtDebug>
+#include <QDomNode>
#include <QEvent>
#include <QDragEnterEvent>
#include <QUrl>
diff --git a/src/widget/wwidget.cpp b/src/widget/wwidget.cpp
index 144c3759bf..2a3627bac3 100644
--- a/src/widget/wwidget.cpp
+++ b/src/widget/wwidget.cpp
@@ -15,15 +15,12 @@
* *
***************************************************************************/
-
-#include <QtGui>
#include <QtDebug>
-#include "wwidget.h"
+#include "widget/wwidget.h"
#include "controlobject.h"
#include "controlobjectthreadwidget.h"
-
// Static member variable definition
QString WWidget::m_qPath;