From 47b1a3853d76a5abc5f32b02ccd1d83df3aa601a Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 18 Mar 2010 16:10:51 +0100 Subject: Initialize the graphics system before creating the style. Previously if the style was creating any pixmaps they were going to the createDefaultPixmapData() function which creates a default platform pixmap without considering the graphics system. If these pixmaps are used they may end up going through a suboptimal code path because they are not the same type of pixmap that is expected by the graphics system. The fix here is to intialize the graphics system before the style is created. Reviewed-by: Trond --- src/gui/kernel/qapplication.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 4fe3900..e480696 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -892,6 +892,14 @@ void QApplicationPrivate::initialize() { QWidgetPrivate::mapper = new QWidgetMapper; QWidgetPrivate::allWidgets = new QWidgetSet; + +#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) + // initialize the graphics system - on X11 this is initialized inside + // qt_init() in qapplication_x11.cpp because of several reasons. + // On QWS, the graphics system is set by the QScreen plugin. + graphics_system = QGraphicsSystemFactory::create(graphics_system_name); +#endif + if (qt_appType != QApplication::Tty) (void) QApplication::style(); // trigger creation of application style // trigger registering of QVariant's GUI types @@ -926,12 +934,6 @@ void QApplicationPrivate::initialize() // Set up which span functions should be used in raster engine... qInitDrawhelperAsm(); -#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) - // initialize the graphics system - on X11 this is initialized inside - // qt_init() in qapplication_x11.cpp because of several reasons. - // On QWS, the graphics system is set by the QScreen plugin. - graphics_system = QGraphicsSystemFactory::create(graphics_system_name); -#endif #ifndef QT_NO_WHEELEVENT QApplicationPrivate::wheel_scroll_lines = 3; #endif -- cgit v0.12