summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2010-05-27 12:15:54 +0200
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 13:06:01 +0300
commit569123b25689d3007b53e3031dac79758d05f12f (patch)
tree0947f9d19db0820780663bba7b30740850bcf57c
parent46028848c063488bc64af7ed0dabd1c89fc09593 (diff)
downloadqt4-tools-569123b25689d3007b53e3031dac79758d05f12f.tar.gz
Fixed a crash when creating QGtkStyle before QApplication
Task-number: QTBUG-10758 Reviewed-by: ogoffart (cherry picked from commit bc5e4da28c1ffbc0da1cbfcaa1e6236ff4c2d4e3)
-rw-r--r--src/gui/styles/qgtkstyle.cpp2
-rw-r--r--src/gui/styles/qgtkstyle_p.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 4aa8f9f0c1..022cfa1cc4 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -325,6 +325,7 @@ void QGtkStyle::polish(QApplication *app)
qt_filedialog_save_filename_hook = &QGtkStylePrivate::saveFilename;
qt_filedialog_open_filenames_hook = &QGtkStylePrivate::openFilenames;
qt_filedialog_existing_directory_hook = &QGtkStylePrivate::openDirectory;
+ qApp->installEventFilter(&d->filter);
}
}
}
@@ -345,6 +346,7 @@ void QGtkStyle::unpolish(QApplication *app)
qt_filedialog_save_filename_hook = 0;
qt_filedialog_open_filenames_hook = 0;
qt_filedialog_existing_directory_hook = 0;
+ qApp->removeEventFilter(&d->filter);
}
}
diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp
index b1ac61a4e3..e42f550f17 100644
--- a/src/gui/styles/qgtkstyle_p.cpp
+++ b/src/gui/styles/qgtkstyle_p.cpp
@@ -278,8 +278,6 @@ void QGtkStylePrivate::init()
{
resolveGtk();
initGtkWidgets();
- if (isThemeAvailable())
- qApp->installEventFilter(&filter);
}
GtkWidget* QGtkStylePrivate::gtkWidget(const QString &path)