summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-05-25 10:13:15 +0200
committerMartin Smith <msmith@trolltech.com>2009-05-25 10:13:15 +0200
commit58f0112b11e42ece4c7fa3456ae46e8c86fa0bd6 (patch)
tree4d2e96c0970f1cfe26fb9ac024decf041f38cece /src/gui
parent878ccb0645e7f1416daeddd6acdc37fea16b5e25 (diff)
parent531274c741aed51946398a30a7be691ef98999bf (diff)
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp3
-rw-r--r--src/gui/itemviews/qstyleditemdelegate.cpp3
-rw-r--r--src/gui/styles/qgtkstyle.cpp13
3 files changed, 11 insertions, 8 deletions
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index 3b7eb2dcdb..a748199b1c 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -47,6 +47,7 @@
#include <qbrush.h>
#include <qlineedit.h>
#include <qtextedit.h>
+#include <qplaintextedit.h>
#include <qpainter.h>
#include <qpalette.h>
#include <qpoint.h>
@@ -1194,7 +1195,7 @@ bool QItemDelegate::eventFilter(QObject *object, QEvent *event)
case Qt::Key_Enter:
case Qt::Key_Return:
#ifndef QT_NO_TEXTEDIT
- if (qobject_cast<QTextEdit*>(editor))
+ if (qobject_cast<QTextEdit *>(editor) || qobject_cast<QPlainTextEdit *>(editor))
return false; // don't filter enter key events for QTextEdit
// We want the editor to be able to process the key press
// before committing the data (e.g. so it can do
diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp
index be0971b016..7f2c8eda0e 100644
--- a/src/gui/itemviews/qstyleditemdelegate.cpp
+++ b/src/gui/itemviews/qstyleditemdelegate.cpp
@@ -47,6 +47,7 @@
#include <qbrush.h>
#include <qlineedit.h>
#include <qtextedit.h>
+#include <qplaintextedit.h>
#include <qpainter.h>
#include <qpalette.h>
#include <qpoint.h>
@@ -646,7 +647,7 @@ bool QStyledItemDelegate::eventFilter(QObject *object, QEvent *event)
case Qt::Key_Enter:
case Qt::Key_Return:
#ifndef QT_NO_TEXTEDIT
- if (qobject_cast<QTextEdit*>(editor))
+ if (qobject_cast<QTextEdit *>(editor) || qobject_cast<QPlainTextEdit *>(editor))
return false; // don't filter enter key events for QTextEdit
// We want the editor to be able to process the key press
// before committing the data (e.g. so it can do
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index ca71da2f1d..86653df8da 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -140,10 +140,7 @@ static const char * const dock_widget_restore_xpm[] =
class QGtkStyleFilter : public QObject
{
public:
- QGtkStyleFilter() {
- qApp->installEventFilter(this);
- }
-
+ QGtkStyleFilter() {}
private:
bool eventFilter(QObject *obj, QEvent *e);
};
@@ -167,7 +164,12 @@ class QGtkStylePrivate : public QCleanlooksStylePrivate
public:
QGtkStylePrivate()
: QCleanlooksStylePrivate()
- {}
+ {
+ QGtk::initGtkWidgets();
+ if (QGtk::isThemeAvailable())
+ qApp->installEventFilter(&filter);
+
+ }
QGtkStyleFilter filter;
};
@@ -243,7 +245,6 @@ static QString uniqueName(const QString &key, const QStyleOption *option, const
QGtkStyle::QGtkStyle()
: QCleanlooksStyle(*new QGtkStylePrivate)
{
- QGtk::initGtkWidgets();
}
/*!