Widgets: Remove declaration of built-in and automatic metatypes.

These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Ibe8e2ec867afb4051a3c7eef806d9cd86945928b
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Stephen Kelly 2013-01-03 10:23:56 +01:00 committed by The Qt Project
parent fbd3cd8679
commit ba82958af9
38 changed files with 1 additions and 91 deletions

View File

@ -50,7 +50,6 @@
#include <QVBoxLayout>
#include <QSizeGrip>
Q_DECLARE_METATYPE(QSize)
QT_FORWARD_DECLARE_CLASS(QDialog)

View File

@ -1660,7 +1660,6 @@ Q_DECLARE_METATYPE(Operation *)
Q_DECLARE_METATYPE(SetPage *)
Q_DECLARE_METATYPE(SetStyle *)
Q_DECLARE_METATYPE(SetOption *)
Q_DECLARE_METATYPE(QList<Operation *>)
class TestGroup
{

View File

@ -309,7 +309,6 @@ typedef QList<ItemDesc> ItemList;
Q_DECLARE_METATYPE(ItemList);
typedef QList<QSizeF> SizeList;
Q_DECLARE_METATYPE(SizeList);
// This will be called before the first test function is executed.
@ -2223,7 +2222,6 @@ void tst_QGraphicsGridLayout::defaultStretchFactors()
}
typedef QList<QRectF> RectList;
Q_DECLARE_METATYPE(RectList);
void tst_QGraphicsGridLayout::alignment2_data()
{

View File

@ -67,11 +67,7 @@
#include <float.h>
#include <QStyleHints>
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QRectF>)
Q_DECLARE_METATYPE(QPainterPath)
Q_DECLARE_METATYPE(QPointF)
Q_DECLARE_METATYPE(QRectF)
#include "../../../qtest-config.h"

View File

@ -1053,8 +1053,6 @@ void tst_QGraphicsLinearLayout::itemSpacing()
*/
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
Q_DECLARE_METATYPE(qreal)
void tst_QGraphicsLinearLayout::setStretchFactor_data()
{

View File

@ -370,7 +370,6 @@ void tst_QGraphicsPixmapItem::shape()
}
Q_DECLARE_METATYPE(SubQGraphicsPixmapItem::Extension)
Q_DECLARE_METATYPE(QVariant)
void tst_QGraphicsPixmapItem::extension_data()
{
QTest::addColumn<QVariant>("variant");

View File

@ -44,7 +44,6 @@
#include <qgraphicsitem.h>
#include <qpen.h>
Q_DECLARE_METATYPE(QPolygonF)
class tst_QGraphicsPolygonItem : public QObject
{
@ -292,7 +291,6 @@ void tst_QGraphicsPolygonItem::shape()
QCOMPARE(item.shape(), shape);
}
Q_DECLARE_METATYPE(QVariant)
void tst_QGraphicsPolygonItem::extension_data()
{
QTest::addColumn<QVariant>("variant");

View File

@ -2747,7 +2747,6 @@ void tst_QGraphicsProxyWidget::autoShow()
}
Q_DECLARE_METATYPE(QList<QRectF>)
void tst_QGraphicsProxyWidget::windowOpacity()
{
QGraphicsScene scene;

View File

@ -63,12 +63,8 @@
#define Q_CHECK_PAINTEVENTS
#endif
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QRectF>)
Q_DECLARE_METATYPE(QMatrix)
Q_DECLARE_METATYPE(Qt::FocusReason)
Q_DECLARE_METATYPE(QPainterPath)
Q_DECLARE_METATYPE(QPointF)
Q_DECLARE_METATYPE(QRectF)
Q_DECLARE_METATYPE(Qt::AspectRatioMode)
Q_DECLARE_METATYPE(Qt::ItemSelectionMode)

View File

@ -69,13 +69,7 @@
#include "../../../qtest-config.h"
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QRectF>)
Q_DECLARE_METATYPE(QMatrix)
Q_DECLARE_METATYPE(QPainterPath)
Q_DECLARE_METATYPE(QPointF)
Q_DECLARE_METATYPE(QPolygonF)
Q_DECLARE_METATYPE(QRectF)
Q_DECLARE_METATYPE(Qt::ScrollBarPolicy)
#ifdef Q_OS_MAC

View File

@ -45,12 +45,7 @@
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QRectF>)
Q_DECLARE_METATYPE(QMatrix)
Q_DECLARE_METATYPE(QPainterPath)
Q_DECLARE_METATYPE(QPointF)
Q_DECLARE_METATYPE(QRectF)
Q_DECLARE_METATYPE(Qt::ScrollBarPolicy)
static void _scrollBarRanges_data_1(int offset)

View File

@ -1891,7 +1891,6 @@ enum WhichSize {
typedef QPair<int, QVariant> Inst;
Q_DECLARE_METATYPE(Inst)
Q_DECLARE_METATYPE(QVector<Inst>)
void tst_QGraphicsWidget::setSizes_data()
{

View File

@ -989,7 +989,6 @@ public:
};
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
void tst_QAbstractItemView::setItemDelegate_data()
{

View File

@ -121,10 +121,6 @@ void tst_QDirModel::getSetCheck()
QCOMPARE(true, obj1.lazyChildCount());
}
Q_DECLARE_METATYPE(QModelIndex)
Q_DECLARE_METATYPE(QModelIndexList)
void tst_QDirModel::cleanupTestCase()
{
QDir current;

View File

@ -56,10 +56,8 @@
#include <qdebug.h>
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
typedef QList<bool> BoolList;
Q_DECLARE_METATYPE(BoolList)
class protected_QHeaderView : public QHeaderView
{

View File

@ -928,7 +928,6 @@ public:
};
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
void tst_QListView::selection_data()
{

View File

@ -166,8 +166,6 @@ private:
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
Q_DECLARE_METATYPE(QVariantList)
tst_QListWidget::tst_QListWidget(): testWidget(0), rcParent(8), rcFirst(8,0), rcLast(8,0)
{

View File

@ -54,10 +54,8 @@
#endif
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
typedef QList<bool> BoolList;
Q_DECLARE_METATYPE(BoolList)
class tst_QTableView : public QObject
{
@ -787,7 +785,6 @@ void tst_QTableView::headerSections()
}
typedef QPair<int,int> IntPair;
Q_DECLARE_METATYPE(IntPair)
void tst_QTableView::moveCursor_data()
{
@ -1849,7 +1846,6 @@ void tst_QTableView::selectColumn()
QCOMPARE(view.selectionModel()->selectedIndexes().at(i).column(), column);
}
Q_DECLARE_METATYPE(QRect)
void tst_QTableView::visualRect_data()
{
QTest::addColumn<int>("rowCount");
@ -2925,7 +2921,6 @@ void tst_QTableView::span()
}
typedef QVector<QRect> SpanList;
Q_DECLARE_METATYPE(SpanList)
void tst_QTableView::spans_data()
{

View File

@ -110,10 +110,7 @@ typedef QPair<int, int> IntPair;
typedef QList<int> IntList;
typedef QList<IntPair> IntIntList;
Q_DECLARE_METATYPE(IntList)
Q_DECLARE_METATYPE(IntIntList)
Q_DECLARE_METATYPE(QTableWidgetSelectionRange)
Q_DECLARE_METATYPE(QModelIndex)
// Testing get/set functions

View File

@ -45,7 +45,6 @@
#include <QtWidgets/QtWidgets>
#include <private/qabstractitemview_p.h>
Q_DECLARE_METATYPE(QModelIndex)
#ifndef QT_NO_DRAGANDDROP
Q_DECLARE_METATYPE(QAbstractItemView::DragDropMode)
#endif
@ -1798,7 +1797,6 @@ public:
};
typedef QList<QPoint> PointList;
Q_DECLARE_METATYPE(PointList)
void tst_QTreeView::setSelection_data()
{

View File

@ -215,9 +215,6 @@ void tst_QTreeWidget::getSetCheck()
typedef QList<int> IntList;
typedef QList<IntList> ListIntList;
Q_DECLARE_METATYPE(IntList)
Q_DECLARE_METATYPE(ListIntList)
Q_DECLARE_METATYPE(QModelIndex)
Q_DECLARE_METATYPE(Qt::Orientation)
typedef QTreeWidgetItem TreeItem;

View File

@ -513,7 +513,6 @@ int Qt42Style::pixelMetric(PixelMetric metric, const QStyleOption * option /*= 0
typedef QList<QPoint> PointList;
Q_DECLARE_METATYPE(PointList)
class SizeHinterFrame : public QLabel

View File

@ -4311,8 +4311,6 @@ void tst_QWidget::qobject_castInDestroyedSlot()
QVERIFY(checker.wasQWidget == true);
}
Q_DECLARE_METATYPE(QList<QRect>)
// Since X11 WindowManager operations are all async, and we have no way to know if the window
// manager has finished playing with the window geometry, this test can't be reliable on X11.

View File

@ -113,7 +113,6 @@ private:
};
Q_DECLARE_METATYPE(QList<Qt::Key>)
Q_DECLARE_METATYPE(QPoint)
void tst_QAbstractSlider::initTestCase()
{

View File

@ -371,8 +371,6 @@ void tst_QComboBox::getSetCheck()
typedef QList<QVariant> VariantList;
typedef QList<QIcon> IconList;
Q_DECLARE_METATYPE(VariantList)
Q_DECLARE_METATYPE(IconList)
Q_DECLARE_METATYPE(QComboBox::InsertPolicy)
tst_QComboBox::tst_QComboBox()
@ -1726,7 +1724,6 @@ void tst_QComboBox::findText()
typedef QList<int> IntList;
typedef QList<Qt::Key> KeyList;
Q_DECLARE_METATYPE(IntList)
Q_DECLARE_METATYPE(KeyList)
void tst_QComboBox::flaggedItems_data()

View File

@ -53,8 +53,6 @@
#include <QGridLayout>
#include <QPainter>
Q_DECLARE_METATYPE(QCommandLinkButton*)
class tst_QCommandLinkButton : public QObject
{
Q_OBJECT

View File

@ -93,13 +93,9 @@
#endif
Q_DECLARE_METATYPE(QDate);
Q_DECLARE_METATYPE(Qt::Key);
Q_DECLARE_METATYPE(Qt::KeyboardModifiers);
Q_DECLARE_METATYPE(Qt::KeyboardModifier);
Q_DECLARE_METATYPE(QDateTime);
Q_DECLARE_METATYPE(QTime);
Q_DECLARE_METATYPE(QList<int>);
#if defined(Q_OS_WINCE)
#ifndef SPI_GETPLATFORMTYPE
@ -291,9 +287,6 @@ private:
typedef QList<QTime> TimeList;
typedef QList<Qt::Key> KeyList;
Q_DECLARE_METATYPE(TimeList)
Q_DECLARE_METATYPE(KeyList)
// Testing get/set functions
void tst_QDateTimeEdit::getSetCheck()
{
@ -3449,9 +3442,7 @@ void tst_QDateTimeEdit::deleteCalendarWidget()
typedef QPair<Qt::Key, Qt::KeyboardModifier> KeyPair;
typedef QList<KeyPair> KeyPairList;
Q_DECLARE_METATYPE(QLocale)
Q_DECLARE_METATYPE(KeyPair)
Q_DECLARE_METATYPE(KeyPairList)
static inline KeyPair key(Qt::Key key, Qt::KeyboardModifier modifier = Qt::NoModifier) {
return KeyPair(key, modifier);

View File

@ -47,11 +47,9 @@
#include <qdialogbuttonbox.h>
#include <limits.h>
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QDialogButtonBox::ButtonRole)
Q_DECLARE_METATYPE(QDialogButtonBox::StandardButton)
Q_DECLARE_METATYPE(QDialogButtonBox::StandardButtons)
Q_DECLARE_METATYPE(QAbstractButton*)
class tst_QDialogButtonBox : public QObject
{

View File

@ -155,7 +155,6 @@ private:
};
typedef QList<double> DoubleList;
Q_DECLARE_METATYPE(DoubleList)
tst_QDoubleSpinBox::tst_QDoubleSpinBox()

View File

@ -318,7 +318,6 @@ private:
};
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
Q_DECLARE_METATYPE(QLineEdit::EchoMode)
// Testing get/set functions

View File

@ -67,8 +67,6 @@ static const Qt::WindowFlags DefaultWindowFlags
| Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
Q_DECLARE_METATYPE(QMdiArea::WindowOrder)
Q_DECLARE_METATYPE(QMdiSubWindow *)
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QTabWidget::TabPosition)
static bool tabBetweenSubWindowsIn(QMdiArea *mdiArea, int tabCount = -1, bool reverse = false)

View File

@ -65,9 +65,7 @@
//Used in copyAvailable
typedef QPair<Qt::Key, Qt::KeyboardModifier> keyPairType;
typedef QList<keyPairType> pairListType;
Q_DECLARE_METATYPE(pairListType);
Q_DECLARE_METATYPE(keyPairType);
Q_DECLARE_METATYPE(QList<bool>);
QT_FORWARD_DECLARE_CLASS(QPlainTextEdit)

View File

@ -54,8 +54,6 @@
#include <QStyleFactory>
#include <QTabWidget>
Q_DECLARE_METATYPE(QPushButton*)
class tst_QPushButton : public QObject
{
Q_OBJECT

View File

@ -148,8 +148,6 @@ private:
};
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
Q_DECLARE_METATYPE(QLocale)
// Testing get/set functions
void tst_QSpinBox::getSetCheck()

View File

@ -168,7 +168,6 @@ void tst_QSplitter::cleanupTestCase()
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
void tst_QSplitter::setSizes()
{

View File

@ -435,7 +435,6 @@ void tst_QTabBar::tabButton()
typedef QList<int> IntList;
Q_DECLARE_METATYPE(QTabBar::SelectionBehavior)
Q_DECLARE_METATYPE(IntList)
#define ONE(x) (IntList() << x)
void tst_QTabBar::selectionBehaviorOnRemove_data()
{

View File

@ -73,10 +73,7 @@
//Used in copyAvailable
typedef QPair<Qt::Key, Qt::KeyboardModifier> keyPairType;
typedef QList<keyPairType> pairListType;
Q_DECLARE_METATYPE(pairListType);
Q_DECLARE_METATYPE(keyPairType);
Q_DECLARE_METATYPE(QList<bool>);
Q_DECLARE_METATYPE(QList<int>);
QT_FORWARD_DECLARE_CLASS(QTextEdit)

View File

@ -117,8 +117,6 @@ void tst_QToolButton::getSetCheck()
delete var4;
}
Q_DECLARE_METATYPE(QAction*)
void tst_QToolButton::triggered()
{
qRegisterMetaType<QAction *>("QAction *");