summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-13 09:49:43 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-13 09:49:49 (GMT)
commit6e209bb09f3feef210bc65f94cf8f58dd8e3b4a9 (patch)
tree94da799a697ebf32a98ccc13a53adfb2569f7c16 /src/gui/kernel
parentb664d54867139b371e158f1c63076c4a970cbb2a (diff)
parent4f2dcef95299f2da628b30607021e8deb1d868b6 (diff)
downloadQt-6e209bb09f3feef210bc65f94cf8f58dd8e3b4a9.zip
Qt-6e209bb09f3feef210bc65f94cf8f58dd8e3b4a9.tar.gz
Qt-6e209bb09f3feef210bc65f94cf8f58dd8e3b4a9.tar.bz2
Merge oslo-staging-2/4.6 into upstream/4.6
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qaction.cpp26
-rw-r--r--src/gui/kernel/qaction_p.h2
-rw-r--r--src/gui/kernel/qapplication.cpp3
-rw-r--r--src/gui/kernel/qgesturemanager.cpp1
-rw-r--r--src/gui/kernel/qkeysequence.cpp20
-rw-r--r--src/gui/kernel/qt_x11_p.h2
6 files changed, 39 insertions, 15 deletions
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index 6f3cbaf..3eaf2e1 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -100,6 +100,21 @@ QActionPrivate::~QActionPrivate()
{
}
+bool QActionPrivate::showStatusText(QWidget *widget, const QString &str)
+{
+#ifdef QT_NO_STATUSTIP
+ Q_UNUSED(widget);
+ Q_UNUSED(str);
+#else
+ if(QObject *object = widget ? widget : parent) {
+ QStatusTipEvent tip(str);
+ QApplication::sendEvent(object, &tip);
+ return true;
+ }
+#endif
+ return false;
+}
+
void QActionPrivate::sendDataChanged()
{
Q_Q(QAction);
@@ -1206,16 +1221,7 @@ QAction::setData(const QVariant &data)
bool
QAction::showStatusText(QWidget *widget)
{
-#ifdef QT_NO_STATUSTIP
- Q_UNUSED(widget);
-#else
- if(QObject *object = widget ? widget : parent()) {
- QStatusTipEvent tip(statusTip());
- QApplication::sendEvent(object, &tip);
- return true;
- }
-#endif
- return false;
+ return d_func()->showStatusText(widget, statusTip());
}
/*!
diff --git a/src/gui/kernel/qaction_p.h b/src/gui/kernel/qaction_p.h
index 2527a02..f7b035b 100644
--- a/src/gui/kernel/qaction_p.h
+++ b/src/gui/kernel/qaction_p.h
@@ -75,6 +75,8 @@ public:
QActionPrivate();
~QActionPrivate();
+ bool showStatusText(QWidget *w, const QString &str);
+
QPointer<QActionGroup> group;
QString text;
QString iconText;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 987aa26..4b8f6a0 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -791,7 +791,8 @@ void QApplicationPrivate::construct(
}
//make sure the plugin is loaded
- qt_guiPlatformPlugin();
+ if (qt_is_gui_used)
+ qt_guiPlatformPlugin();
#endif
}
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 3d4bb8c..192f9ac 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -601,6 +601,7 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures,
Qt::GestureType gestureType = gesture->gestureType();
Q_ASSERT(gestureType != Qt::CustomGesture);
+ Q_UNUSED(gestureType);
if (target) {
if (gesture->state() == Qt::GestureStarted) {
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 1a76083..89c18fb 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1014,9 +1014,12 @@ bool QKeySequence::isEmpty() const
*/
QKeySequence QKeySequence::mnemonic(const QString &text)
{
+ QKeySequence ret;
+
if(qt_sequence_no_mnemonics)
- return QKeySequence();
+ return ret;
+ bool found = false;
int p = 0;
while (p >= 0) {
p = text.indexOf(QLatin1Char('&'), p) + 1;
@@ -1025,13 +1028,22 @@ QKeySequence QKeySequence::mnemonic(const QString &text)
if (text.at(p) != QLatin1Char('&')) {
QChar c = text.at(p);
if (c.isPrint()) {
- c = c.toUpper();
- return QKeySequence(c.unicode() + Qt::ALT);
+ if (!found) {
+ c = c.toUpper();
+ ret = QKeySequence(c.unicode() + Qt::ALT);
+#ifdef QT_NO_DEBUG
+ return ret;
+#else
+ found = true;
+ } else {
+ qWarning(qPrintable(QString::fromLatin1("QKeySequence::mnemonic: \"%1\" contains multiple occurences of '&'").arg(text)));
+#endif
+ }
}
}
p++;
}
- return QKeySequence();
+ return ret;
}
/*!
diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h
index 9f08dc6..9e4cf60 100644
--- a/src/gui/kernel/qt_x11_p.h
+++ b/src/gui/kernel/qt_x11_p.h
@@ -163,7 +163,9 @@ extern "C" {
#endif // QT_NO_XRENDER
#ifndef QT_NO_XSYNC
+extern "C" {
# include "X11/extensions/sync.h"
+}
#endif
// #define QT_NO_XKB