summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-05-07 20:56:32 +0200
committerLars Knoll <lars.knoll@nokia.com>2011-05-07 20:56:32 +0200
commit7ff96330ed28b957a80d294a43748c8051c0e483 (patch)
tree435ad1eebe666d8e8eee21cd888d183899b7ef4f /src
parentd3d078aa4ba2aeebb0998e75cd9d5b980db7fbfe (diff)
get QtWidgets to link
some more changes, mainly exporting methods from QtGui to get QtWidgets to link.
Diffstat (limited to 'src')
-rw-r--r--src/gui/guikernel/guikernel.pri1
-rw-r--r--src/gui/guikernel/qevent.h3
-rw-r--r--src/gui/guikernel/qguiapplication.cpp26
-rw-r--r--src/gui/guikernel/qkeymapper_p.h2
-rw-r--r--src/gui/guikernel/qplatformcursor_qpa.h2
-rw-r--r--src/gui/painting/qcssutil_p.h4
-rw-r--r--src/gui/painting/qmemrotate.cpp12
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h2
-rw-r--r--src/gui/painting/qprinter.cpp4
-rw-r--r--src/gui/painting/qprinter_p.h2
-rw-r--r--src/gui/painting/qprinterinfo_unix.cpp2
-rw-r--r--src/gui/text/qcssparser_p.h2
-rw-r--r--src/gui/text/qtextcursor_p.h2
-rw-r--r--src/gui/text/qtextengine_p.h2
-rw-r--r--src/widgets/kernel/qapplication.cpp13
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp6
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp8
17 files changed, 51 insertions, 42 deletions
diff --git a/src/gui/guikernel/guikernel.pri b/src/gui/guikernel/guikernel.pri
index 9d9f12634a..8e41b55049 100644
--- a/src/gui/guikernel/guikernel.pri
+++ b/src/gui/guikernel/guikernel.pri
@@ -8,6 +8,7 @@ KERNEL_P= guikernel
HEADERS += \
guikernel/qclipboard.h \
guikernel/qcursor.h \
+ guikernel/qcursor_p.h \
guikernel/qevent.h \
guikernel/qevent_p.h \
guikernel/qkeysequence.h \
diff --git a/src/gui/guikernel/qevent.h b/src/gui/guikernel/qevent.h
index 061ac88d4a..45b11d4795 100644
--- a/src/gui/guikernel/qevent.h
+++ b/src/gui/guikernel/qevent.h
@@ -273,7 +273,8 @@ protected:
bool m_erased;
};
-class QUpdateLaterEvent : public QEvent
+// ### Qt5: make internal
+class Q_GUI_EXPORT QUpdateLaterEvent : public QEvent
{
public:
QUpdateLaterEvent(const QRegion& paintRegion);
diff --git a/src/gui/guikernel/qguiapplication.cpp b/src/gui/guikernel/qguiapplication.cpp
index 8f81500823..86fb7f5e1d 100644
--- a/src/gui/guikernel/qguiapplication.cpp
+++ b/src/gui/guikernel/qguiapplication.cpp
@@ -64,6 +64,7 @@
#include "private/qwindowsysteminterface_qpa_p.h"
#include "private/qwindow_p.h"
#include "private/qkeymapper_p.h"
+#include "private/qcursor_p.h"
#include <QtGui/QPixmap>
@@ -73,7 +74,7 @@
QT_BEGIN_NAMESPACE
-bool qt_is_gui_used = true;
+Q_GUI_EXPORT bool qt_is_gui_used = true;
Qt::MouseButtons QGuiApplicationPrivate::mouse_buttons = Qt::NoButton;
Qt::KeyboardModifiers QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier;
@@ -111,6 +112,11 @@ QWindowList QGuiApplicationPrivate::window_list;
Q_GLOBAL_STATIC(QMutex, applicationFontMutex)
QFont *QGuiApplicationPrivate::app_font = 0;
+extern int qRegisterGuiVariant();
+extern int qUnregisterGuiVariant();
+extern void qInitDrawhelperAsm();
+extern void qInitImageConversions();
+
static bool qt_detectRTLLanguage()
{
return force_reverse ^
@@ -153,6 +159,8 @@ QGuiApplication::~QGuiApplication()
delete QGuiApplicationPrivate::app_pal;
QGuiApplicationPrivate::app_pal = 0;
+ qUnregisterGuiVariant();
+
#ifndef QT_NO_CURSOR
d->cursor_list.clear();
#endif
@@ -264,8 +272,20 @@ void QGuiApplicationPrivate::init()
init_platform(QLatin1String(platformName), platformPluginPath);
init_plugins(pluginList);
+ // Set up which span functions should be used in raster engine...
+ qInitDrawhelperAsm();
+ // and QImage conversion functions
+ qInitImageConversions();
+
QFont::initialize();
+#ifndef QT_NO_CURSOR
+ QCursorData::initialize();
+#endif
+
+ // trigger registering of QVariant's GUI types
+ qRegisterGuiVariant();
+
is_app_running = true;
}
@@ -279,6 +299,10 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
QFont::cleanup();
+#ifndef QT_NO_CURSOR
+ QCursorData::cleanup();
+#endif
+
layout_direction = Qt::LeftToRight;
}
diff --git a/src/gui/guikernel/qkeymapper_p.h b/src/gui/guikernel/qkeymapper_p.h
index 9eff42f88c..03ba092dec 100644
--- a/src/gui/guikernel/qkeymapper_p.h
+++ b/src/gui/guikernel/qkeymapper_p.h
@@ -67,7 +67,7 @@
QT_BEGIN_NAMESPACE
class QKeyMapperPrivate;
-class QKeyMapper : public QObject
+class Q_GUI_EXPORT QKeyMapper : public QObject
{
Q_OBJECT
public:
diff --git a/src/gui/guikernel/qplatformcursor_qpa.h b/src/gui/guikernel/qplatformcursor_qpa.h
index 18698b6457..48e13bb954 100644
--- a/src/gui/guikernel/qplatformcursor_qpa.h
+++ b/src/gui/guikernel/qplatformcursor_qpa.h
@@ -73,7 +73,7 @@ private:
class QPlatformCursor;
-class QPlatformCursorPrivate {
+class Q_GUI_EXPORT QPlatformCursorPrivate {
public:
static QList<QWeakPointer<QPlatformCursor> > getInstances() { return instances; }
static QList<QWeakPointer<QPlatformCursor> > instances;
diff --git a/src/gui/painting/qcssutil_p.h b/src/gui/painting/qcssutil_p.h
index 80606b4cb9..ab1abc99cf 100644
--- a/src/gui/painting/qcssutil_p.h
+++ b/src/gui/painting/qcssutil_p.h
@@ -71,10 +71,10 @@ extern void qDrawRoundedCorners(QPainter *p, qreal x1, qreal y1, qreal x2, qreal
const QSizeF& r1, const QSizeF& r2,
QCss::Edge edge, QCss::BorderStyle s, QBrush c);
-extern void qDrawBorder(QPainter *p, const QRect &rect, const QCss::BorderStyle *styles,
+extern void Q_GUI_EXPORT qDrawBorder(QPainter *p, const QRect &rect, const QCss::BorderStyle *styles,
const int *borders, const QBrush *colors, const QSize *radii);
-extern void qNormalizeRadii(const QRect &br, const QSize *radii,
+extern void Q_GUI_EXPORT qNormalizeRadii(const QRect &br, const QSize *radii,
QSize *tlr, QSize *trr, QSize *blr, QSize *brr);
QT_END_NAMESPACE
diff --git a/src/gui/painting/qmemrotate.cpp b/src/gui/painting/qmemrotate.cpp
index fe524aff3b..c7002e2162 100644
--- a/src/gui/painting/qmemrotate.cpp
+++ b/src/gui/painting/qmemrotate.cpp
@@ -512,34 +512,34 @@ inline void qt_memrotate90_template<quint18, quint32>(const quint32 *src,
}
#define QT_IMPL_MEMROTATE(srctype, desttype) \
-void qt_memrotate90(const srctype *src, int w, int h, int sstride, \
+Q_GUI_EXPORT void qt_memrotate90(const srctype *src, int w, int h, int sstride, \
desttype *dest, int dstride) \
{ \
qt_memrotate90_template(src, w, h, sstride, dest, dstride); \
} \
-void qt_memrotate180(const srctype *src, int w, int h, int sstride, \
+Q_GUI_EXPORT void qt_memrotate180(const srctype *src, int w, int h, int sstride, \
desttype *dest, int dstride) \
{ \
qt_memrotate180_template(src, w, h, sstride, dest, dstride); \
} \
-void qt_memrotate270(const srctype *src, int w, int h, int sstride, \
+Q_GUI_EXPORT void qt_memrotate270(const srctype *src, int w, int h, int sstride, \
desttype *dest, int dstride) \
{ \
qt_memrotate270_template(src, w, h, sstride, dest, dstride); \
}
#define QT_IMPL_SIMPLE_MEMROTATE(srctype, desttype) \
-void qt_memrotate90(const srctype *src, int w, int h, int sstride, \
+Q_GUI_EXPORT void qt_memrotate90(const srctype *src, int w, int h, int sstride, \
desttype *dest, int dstride) \
{ \
qt_memrotate90_tiled_unpacked<desttype,srctype>(src, w, h, sstride, dest, dstride); \
} \
-void qt_memrotate180(const srctype *src, int w, int h, int sstride, \
+Q_GUI_EXPORT void qt_memrotate180(const srctype *src, int w, int h, int sstride, \
desttype *dest, int dstride) \
{ \
qt_memrotate180_template(src, w, h, sstride, dest, dstride); \
} \
-void qt_memrotate270(const srctype *src, int w, int h, int sstride, \
+Q_GUI_EXPORT void qt_memrotate270(const srctype *src, int w, int h, int sstride, \
desttype *dest, int dstride) \
{ \
qt_memrotate270_tiled_unpacked<desttype,srctype>(src, w, h, sstride, dest, dstride); \
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index 0cffabea23..78f5d5b791 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -128,7 +128,7 @@ public:
/*******************************************************************************
* QRasterPaintEngine
*/
-class QRasterPaintEngine : public QPaintEngineEx
+class Q_GUI_EXPORT QRasterPaintEngine : public QPaintEngineEx
{
Q_DECLARE_PRIVATE(QRasterPaintEngine)
public:
diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp
index e5e254fa68..4a0b8d1d66 100644
--- a/src/gui/painting/qprinter.cpp
+++ b/src/gui/painting/qprinter.cpp
@@ -114,7 +114,7 @@ static const float qt_paperSizes[][2] = {
};
/// return the multiplier of converting from the unit value to postscript-points.
-double qt_multiplierForUnit(QPrinter::Unit unit, int resolution)
+Q_GUI_EXPORT double qt_multiplierForUnit(QPrinter::Unit unit, int resolution)
{
switch(unit) {
case QPrinter::Millimeter:
@@ -136,7 +136,7 @@ double qt_multiplierForUnit(QPrinter::Unit unit, int resolution)
}
// not static: it's needed in qpagesetupdialog_unix.cpp
-QSizeF qt_printerPaperSize(QPrinter::Orientation orientation,
+Q_GUI_EXPORT QSizeF qt_printerPaperSize(QPrinter::Orientation orientation,
QPrinter::PaperSize paperSize,
QPrinter::Unit unit,
int resolution)
diff --git a/src/gui/painting/qprinter_p.h b/src/gui/painting/qprinter_p.h
index f112b882e9..c6e325f38f 100644
--- a/src/gui/painting/qprinter_p.h
+++ b/src/gui/painting/qprinter_p.h
@@ -70,7 +70,7 @@ class QPrintEngine;
class QPreviewPaintEngine;
class QPicture;
-class QPrinterPrivate
+class Q_GUI_EXPORT QPrinterPrivate
{
Q_DECLARE_PUBLIC(QPrinter)
public:
diff --git a/src/gui/painting/qprinterinfo_unix.cpp b/src/gui/painting/qprinterinfo_unix.cpp
index e81f4ad743..488299bd44 100644
--- a/src/gui/painting/qprinterinfo_unix.cpp
+++ b/src/gui/painting/qprinterinfo_unix.cpp
@@ -741,7 +741,7 @@ void qt_parseQconfig(QList<QPrinterDescription> *printers)
} while (!ts.atEnd());
}
-int qt_getLprPrinters(QList<QPrinterDescription>& printers)
+Q_GUI_EXPORT int qt_getLprPrinters(QList<QPrinterDescription>& printers)
{
QByteArray etcLpDefault;
qt_parsePrintcap(&printers, QLatin1String("/etc/printcap"));
diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h
index 5ede553aa5..4fc720fcef 100644
--- a/src/gui/text/qcssparser_p.h
+++ b/src/gui/text/qcssparser_p.h
@@ -633,7 +633,7 @@ enum StyleSheetOrigin {
StyleSheetOrigin_Inline
};
-struct StyleSheet
+struct Q_GUI_EXPORT StyleSheet
{
StyleSheet() : origin(StyleSheetOrigin_Unspecified), depth(0) { }
QVector<StyleRule> styleRules; //only contains rules that are not indexed
diff --git a/src/gui/text/qtextcursor_p.h b/src/gui/text/qtextcursor_p.h
index 566495e1a3..9d9d79ff5d 100644
--- a/src/gui/text/qtextcursor_p.h
+++ b/src/gui/text/qtextcursor_p.h
@@ -61,7 +61,7 @@
QT_BEGIN_NAMESPACE
-class QTextCursorPrivate : public QSharedData
+class Q_GUI_EXPORT QTextCursorPrivate : public QSharedData
{
public:
QTextCursorPrivate(QTextDocumentPrivate *p);
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index c476485c1d..bea39e55c5 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -644,7 +644,7 @@ private:
int beginningOfLine(int lineNum);
};
-class QStackTextEngine : public QTextEngine {
+class Q_GUI_EXPORT QStackTextEngine : public QTextEngine {
public:
enum { MemSize = 256*40/sizeof(void *) };
QStackTextEngine(const QString &string, const QFont &f);
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 4e7119fdf9..059c06d162 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -916,10 +916,6 @@ QApplication::QApplication(Display *dpy, int &argc, char **argv,
#endif // Q_WS_X11
-extern void qInitDrawhelperAsm();
-extern void qInitImageConversions();
-extern int qRegisterGuiVariant();
-extern int qUnregisterGuiVariant();
#ifndef QT_NO_STATEMACHINE
extern int qRegisterGuiStateMachine();
extern int qUnregisterGuiStateMachine();
@@ -937,8 +933,6 @@ void QApplicationPrivate::initialize()
if (qt_appType != QApplication::Tty)
(void) QApplication::style(); // trigger creation of application style
- // trigger registering of QVariant's GUI types
- qRegisterGuiVariant();
#ifndef QT_NO_STATEMACHINE
// trigger registering of QStateMachine's GUI types
qRegisterGuiStateMachine();
@@ -966,11 +960,6 @@ void QApplicationPrivate::initialize()
#endif //QT_AUTO_MAXIMIZE_THRESHOLD
#endif //Q_WS_WINCE
- // Set up which span functions should be used in raster engine...
- qInitDrawhelperAsm();
- // and QImage conversion functions
- qInitImageConversions();
-
#ifndef QT_NO_WHEELEVENT
QApplicationPrivate::wheel_scroll_lines = 3;
#endif
@@ -1160,8 +1149,6 @@ QApplication::~QApplication()
// trigger unregistering of QStateMachine's GUI types
qUnregisterGuiStateMachine();
#endif
- // trigger unregistering of QVariant's GUI types
- qUnregisterGuiVariant();
}
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index f3e033c787..3930dc8d68 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -393,9 +393,6 @@ void qt_init(QApplicationPrivate *, int type)
qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
QColormap::initialize();
-#ifndef QT_NO_CURSOR
-// QCursorData::initialize();
-#endif
qApp->setObjectName(appName);
@@ -407,9 +404,6 @@ void qt_init(QApplicationPrivate *, int type)
void qt_cleanup()
{
QPixmapCache::clear();
-#ifndef QT_NO_CURSOR
- QCursorData::cleanup();
-#endif
QColormap::cleanup();
delete QApplicationPrivate::inputContext;
QApplicationPrivate::inputContext = 0;
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 84272e23fb..750b408bd9 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -978,8 +978,9 @@ QRenderRule::QRenderRule(const QVector<Declaration> &declarations, const QWidget
hintValue = (int) decl.colorValue().rgba();
} else if (hintName.endsWith(QLatin1String("size"))) {
hintValue = decl.sizeValue();
- } else if (hintName.endsWith(QLatin1String("icon"))) {
- hintValue = decl.iconValue();
+ // ### Qt5
+// } else if (hintName.endsWith(QLatin1String("icon"))) {
+// hintValue = decl.iconValue();
} else if (hintName == QLatin1String("button-layout")
&& decl.d->values.count() != 0 && decl.d->values.at(0).type == Value::String) {
hintValue = subControlLayout(decl.d->values.at(0).variant.toString());
@@ -2508,7 +2509,8 @@ void QStyleSheetStyle::setProperties(QWidget *w)
}
QVariant v;
switch (value.type()) {
- case QVariant::Icon: v = decl.iconValue(); break;
+ // ### Qt 5
+// case QVariant::Icon: v = decl.iconValue(); break;
case QVariant::Image: v = QImage(decl.uriValue()); break;
case QVariant::Pixmap: v = QPixmap(decl.uriValue()); break;
case QVariant::Rect: v = decl.rectValue(); break;