summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp18
-rw-r--r--src/corelib/kernel/qcoreapplication.h14
-rw-r--r--src/corelib/kernel/qmetatype.cpp41
-rw-r--r--src/corelib/kernel/qmetatype.h19
-rw-r--r--src/corelib/kernel/qobject.cpp1
-rw-r--r--src/corelib/kernel/qobject.h4
-rw-r--r--src/corelib/kernel/qvariant.h45
7 files changed, 69 insertions, 73 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 902902f087..c323d44de7 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -596,23 +596,6 @@ void QCoreApplication::flush()
\a argc must be greater than zero and \a argv must contain at least
one valid character string.
*/
-QCoreApplication::QCoreApplication(int &argc, char **argv)
- : QObject(*new QCoreApplicationPrivate(argc, argv, 0x040000))
-{
- init();
- QCoreApplicationPrivate::eventDispatcher->startingUp();
-#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_LIBRARY)
- // Refresh factoryloader, as text codecs are requested during lib path
- // resolving process and won't be therefore properly loaded.
- // Unknown if this is symbian specific issue.
- QFactoryLoader::refreshAll();
-#endif
-
-#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
- d_func()->symbianInit();
-#endif
-}
-
QCoreApplication::QCoreApplication(int &argc, char **argv, int _internal)
: QObject(*new QCoreApplicationPrivate(argc, argv, _internal))
{
@@ -2203,7 +2186,6 @@ QStringList QCoreApplication::arguments()
;
else if (l1arg == "-style" ||
l1arg == "-session" ||
- l1arg == "-graphicssystem" ||
l1arg == "-testability")
++a;
else
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 024c5096c9..929e4a9836 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -84,16 +84,7 @@ public:
#endif
};
-#if defined(QT_BUILD_CORE_LIB) || defined(qdoc)
- QCoreApplication(int &argc, char **argv); // ### Qt5 remove
-#endif
-#if !defined(qdoc)
- QCoreApplication(int &argc, char **argv, int
-#if !defined(QT_BUILD_CORE_LIB)
- = ApplicationFlags
-#endif
- );
-#endif
+ QCoreApplication(int &argc, char **argv, int = ApplicationFlags);
~QCoreApplication();
@@ -218,10 +209,13 @@ private:
friend class QEventDispatcherUNIXPrivate;
friend class QApplication;
friend class QApplicationPrivate;
+ friend class QGuiApplication;
+ friend class QGuiApplicationPrivate;
friend class QETWidget;
friend class Q3AccelManager;
friend class QShortcutMap;
friend class QWidget;
+ friend class QWidgetWindow;
friend class QWidgetPrivate;
friend bool qt_sendSpontaneousEvent(QObject*, QEvent*);
friend Q_CORE_EXPORT QString qAppName();
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index bdc96c638b..97afe5965a 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -265,19 +265,16 @@ static const struct { const char * typeName; int typeNameLength; int type; } typ
QT_ADD_STATIC_METATYPE("QEasingCurve", QMetaType::QEasingCurve),
/* All GUI types */
- QT_ADD_STATIC_METATYPE("QColorGroup", 63),
QT_ADD_STATIC_METATYPE("QFont", QMetaType::QFont),
QT_ADD_STATIC_METATYPE("QPixmap", QMetaType::QPixmap),
QT_ADD_STATIC_METATYPE("QBrush", QMetaType::QBrush),
QT_ADD_STATIC_METATYPE("QColor", QMetaType::QColor),
QT_ADD_STATIC_METATYPE("QPalette", QMetaType::QPalette),
- QT_ADD_STATIC_METATYPE("QIcon", QMetaType::QIcon),
QT_ADD_STATIC_METATYPE("QImage", QMetaType::QImage),
QT_ADD_STATIC_METATYPE("QPolygon", QMetaType::QPolygon),
QT_ADD_STATIC_METATYPE("QRegion", QMetaType::QRegion),
QT_ADD_STATIC_METATYPE("QBitmap", QMetaType::QBitmap),
QT_ADD_STATIC_METATYPE("QCursor", QMetaType::QCursor),
- QT_ADD_STATIC_METATYPE("QSizePolicy", QMetaType::QSizePolicy),
QT_ADD_STATIC_METATYPE("QKeySequence", QMetaType::QKeySequence),
QT_ADD_STATIC_METATYPE("QPen", QMetaType::QPen),
QT_ADD_STATIC_METATYPE("QTextLength", QMetaType::QTextLength),
@@ -290,6 +287,10 @@ static const struct { const char * typeName; int typeNameLength; int type; } typ
QT_ADD_STATIC_METATYPE("QVector4D", QMetaType::QVector4D),
QT_ADD_STATIC_METATYPE("QQuaternion", QMetaType::QQuaternion),
+ /* All Widgets types */
+ QT_ADD_STATIC_METATYPE("QIcon", QMetaType::QIcon),
+ QT_ADD_STATIC_METATYPE("QSizePolicy", QMetaType::QSizePolicy),
+
/* All Metatype builtins */
QT_ADD_STATIC_METATYPE("void*", QMetaType::VoidStar),
QT_ADD_STATIC_METATYPE("long", QMetaType::Long),
@@ -338,6 +339,7 @@ struct QMetaTypeGuiHelper
#endif
};
Q_CORE_EXPORT const QMetaTypeGuiHelper *qMetaTypeGuiHelper = 0;
+Q_CORE_EXPORT const QMetaTypeGuiHelper *qMetaTypeWidgetsHelper = 0;
class QCustomTypeInfo
{
@@ -399,14 +401,17 @@ void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp,
*/
const char *QMetaType::typeName(int type)
{
- enum { GuiTypeCount = LastGuiType - FirstGuiType };
+ enum { GuiTypeCount = LastGuiType - FirstGuiType,
+ WidgetsTypeCount = LastWidgetsType - FirstWidgetsType };
if (type >= 0 && type <= LastCoreType) {
return types[type].typeName;
} else if (type >= FirstGuiType && type <= LastGuiType) {
return types[type - FirstGuiType + LastCoreType + 1].typeName;
+ } else if (type >= FirstWidgetsType && type <= LastWidgetsType) {
+ return types[type - FirstWidgetsType + GuiTypeCount + LastCoreType + 2].typeName;
} else if (type >= FirstCoreExtType && type <= LastCoreExtType) {
- return types[type - FirstCoreExtType + GuiTypeCount + LastCoreType + 2].typeName;
+ return types[type - FirstCoreExtType + GuiTypeCount + WidgetsTypeCount + LastCoreType + 3].typeName;
} else if (type >= User) {
const QVector<QCustomTypeInfo> * const ct = customTypes();
QReadLocker locker(customTypesLock());
@@ -768,13 +773,11 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
case QMetaType::QBrush:
case QMetaType::QColor:
case QMetaType::QPalette:
- case QMetaType::QIcon:
case QMetaType::QImage:
case QMetaType::QPolygon:
case QMetaType::QRegion:
case QMetaType::QBitmap:
case QMetaType::QCursor:
- case QMetaType::QSizePolicy:
case QMetaType::QKeySequence:
case QMetaType::QPen:
case QMetaType::QTextLength:
@@ -790,6 +793,12 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
return false;
qMetaTypeGuiHelper[type - FirstGuiType].saveOp(stream, data);
break;
+ case QMetaType::QIcon:
+ case QMetaType::QSizePolicy:
+ if (!qMetaTypeWidgetsHelper)
+ return false;
+ qMetaTypeWidgetsHelper[type - FirstWidgetsType].saveOp(stream, data);
+ break;
default: {
const QVector<QCustomTypeInfo> * const ct = customTypes();
if (!ct)
@@ -973,13 +982,11 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
case QMetaType::QBrush:
case QMetaType::QColor:
case QMetaType::QPalette:
- case QMetaType::QIcon:
case QMetaType::QImage:
case QMetaType::QPolygon:
case QMetaType::QRegion:
case QMetaType::QBitmap:
case QMetaType::QCursor:
- case QMetaType::QSizePolicy:
case QMetaType::QKeySequence:
case QMetaType::QPen:
case QMetaType::QTextLength:
@@ -995,6 +1002,12 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
return false;
qMetaTypeGuiHelper[type - FirstGuiType].loadOp(stream, data);
break;
+ case QMetaType::QIcon:
+ case QMetaType::QSizePolicy:
+ if (!qMetaTypeWidgetsHelper)
+ return false;
+ qMetaTypeWidgetsHelper[type - FirstWidgetsType].loadOp(stream, data);
+ break;
default: {
const QVector<QCustomTypeInfo> * const ct = customTypes();
if (!ct)
@@ -1224,6 +1237,10 @@ void *QMetaType::construct(int type, const void *copy)
if (!qMetaTypeGuiHelper)
return 0;
constr = qMetaTypeGuiHelper[type - FirstGuiType].constr;
+ } else if (type >= FirstWidgetsType && type <= LastWidgetsType) {
+ if (!qMetaTypeWidgetsHelper)
+ return 0;
+ constr = qMetaTypeWidgetsHelper[type - FirstWidgetsType].constr;
} else {
const QVector<QCustomTypeInfo> * const ct = customTypes();
QReadLocker locker(customTypesLock());
@@ -1386,6 +1403,12 @@ void QMetaType::destroy(int type, void *data)
if (!qMetaTypeGuiHelper)
return;
destr = qMetaTypeGuiHelper[type - FirstGuiType].destr;
+ } else if (type >= FirstWidgetsType && type <= LastWidgetsType) {
+ Q_ASSERT(qMetaTypeWidgetsHelper);
+
+ if (!qMetaTypeWidgetsHelper)
+ return;
+ destr = qMetaTypeWidgetsHelper[type - FirstWidgetsType].destr;
} else {
QReadLocker locker(customTypesLock());
if (type < User || !ct || ct->count() <= type - User)
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index a2bb7d1597..8e7848aef0 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -71,18 +71,19 @@ public:
QLine = 23, QLineF = 24, QPoint = 25, QPointF = 26, QRegExp = 27,
QVariantHash = 28, QEasingCurve = 29, LastCoreType = QEasingCurve,
- FirstGuiType = 63 /* QColorGroup */,
-#ifdef QT3_SUPPORT
- QColorGroup = 63,
-#endif
+ FirstGuiType = 64 /* QFont */,
QFont = 64, QPixmap = 65, QBrush = 66, QColor = 67, QPalette = 68,
- QIcon = 69, QImage = 70, QPolygon = 71, QRegion = 72, QBitmap = 73,
- QCursor = 74, QSizePolicy = 75, QKeySequence = 76, QPen = 77,
- QTextLength = 78, QTextFormat = 79, QMatrix = 80, QTransform = 81,
- QMatrix4x4 = 82, QVector2D = 83, QVector3D = 84, QVector4D = 85,
- QQuaternion = 86,
+ QImage = 69, QPolygon = 70, QRegion = 71, QBitmap = 72,
+ QCursor = 73, QKeySequence = 74, QPen = 75,
+ QTextLength = 76, QTextFormat = 77, QMatrix = 78, QTransform = 79,
+ QMatrix4x4 = 80, QVector2D = 81, QVector3D = 82, QVector4D = 83,
+ QQuaternion = 84,
LastGuiType = QQuaternion,
+ FirstWidgetsType = 120, /* QIcon */
+ QIcon = 120, QSizePolicy = 121,
+ LastWidgetsType = QSizePolicy,
+
FirstCoreExtType = 128 /* VoidStar */,
VoidStar = 128, Long = 129, Short = 130, Char = 131, ULong = 132,
UShort = 133, UChar = 134, Float = 135, QObjectStar = 136, QWidgetStar = 137,
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 357cfd3f33..9f3c63c588 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -157,6 +157,7 @@ QObjectPrivate::QObjectPrivate(int version)
#endif
metaObject = 0;
hasGuards = false;
+ isWindow = false;
}
QObjectPrivate::~QObjectPrivate()
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 0ad73f5fe9..be2f5cbf6e 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -102,7 +102,8 @@ public:
uint inEventHandler : 1; //only used if QT_JAMBI_BUILD
uint inThreadChangeEvent : 1;
uint hasGuards : 1; //true iff there is one or more QPointer attached to this object
- uint unused : 22;
+ uint isWindow : 1; //for QWindow
+ uint unused : 21;
int postedEvents;
QMetaObject *metaObject; // assert dynamic
};
@@ -144,6 +145,7 @@ public:
void setObjectName(const QString &name);
inline bool isWidgetType() const { return d_ptr->isWidget; }
+ inline bool isWindowType() const { return d_ptr->isWindow; }
inline bool signalsBlocked() const { return d_ptr->blockSig; }
bool blockSignals(bool b);
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 1b8cb7fd0b..345272ee36 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -127,40 +127,33 @@ class Q_CORE_EXPORT QVariant
LastCoreType = EasingCurve,
// value 62 is internally reserved
-#ifdef QT3_SUPPORT
- ColorGroup = 63,
-#endif
Font = 64,
Pixmap = 65,
Brush = 66,
Color = 67,
Palette = 68,
- Icon = 69,
- Image = 70,
- Polygon = 71,
- Region = 72,
- Bitmap = 73,
- Cursor = 74,
- SizePolicy = 75,
- KeySequence = 76,
- Pen = 77,
- TextLength = 78,
- TextFormat = 79,
- Matrix = 80,
- Transform = 81,
- Matrix4x4 = 82,
- Vector2D = 83,
- Vector3D = 84,
- Vector4D = 85,
- Quaternion = 86,
+ Image = 69,
+ Polygon = 70,
+ Region = 71,
+ Bitmap = 72,
+ Cursor = 73,
+ KeySequence = 74,
+ Pen = 75,
+ TextLength = 76,
+ TextFormat = 77,
+ Matrix = 78,
+ Transform = 79,
+ Matrix4x4 = 80,
+ Vector2D = 81,
+ Vector3D = 82,
+ Vector4D = 83,
+ Quaternion = 84,
LastGuiType = Quaternion,
+ Icon = 120,
+ SizePolicy = 121,
+
UserType = 127,
-#ifdef QT3_SUPPORT
- IconSet = Icon,
- CString = ByteArray,
- PointArray = Polygon,
-#endif
LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
};