summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-08-26 10:29:43 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-08-26 10:29:43 (GMT)
commit81143869c2d2a9246d2247f1985e8ec00074391f (patch)
treedac3abc3be65aa66502a357efeb2ad62ba39b1b1 /src/gui/widgets
parentce737d384897640725ff8b646632a108b7308cec (diff)
parent9f5b3ad02302dd7e0ec06aa6a73c61bd2c8f287d (diff)
downloadQt-81143869c2d2a9246d2247f1985e8ec00074391f.zip
Qt-81143869c2d2a9246d2247f1985e8ec00074391f.tar.gz
Qt-81143869c2d2a9246d2247f1985e8ec00074391f.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qlinecontrol_p.h2
-rw-r--r--src/gui/widgets/qlineedit.cpp2
-rw-r--r--src/gui/widgets/qlineedit.h1
-rw-r--r--src/gui/widgets/qlineedit_p.cpp8
-rw-r--r--src/gui/widgets/qlineedit_p.h2
-rw-r--r--src/gui/widgets/qmenu.cpp2
-rw-r--r--src/gui/widgets/qmenu_mac.mm13
-rw-r--r--src/gui/widgets/qplaintextedit.cpp2
8 files changed, 15 insertions, 17 deletions
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index adea742..0db6279 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -349,7 +349,7 @@ Q_SIGNALS:
protected:
virtual void timerEvent(QTimerEvent *event);
-private slots:
+private Q_SLOTS:
void _q_clipboardChanged();
void _q_deleteSelected();
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index f36a995..059aaf1 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -2002,7 +2002,7 @@ QMenu *QLineEdit::createStandardContextMenu()
action = popup->addAction(QLineEdit::tr("Delete"));
action->setEnabled(!d->control->isReadOnly() && !d->control->text().isEmpty() && d->control->hasSelectedText());
- connect(action, SIGNAL(triggered()), SLOT(_q_deleteSelected()));
+ connect(action, SIGNAL(triggered()), d->control, SLOT(_q_deleteSelected()));
popup->addSeparator();
diff --git a/src/gui/widgets/qlineedit.h b/src/gui/widgets/qlineedit.h
index 03d4376..cd37ad0 100644
--- a/src/gui/widgets/qlineedit.h
+++ b/src/gui/widgets/qlineedit.h
@@ -267,7 +267,6 @@ private:
Q_DISABLE_COPY(QLineEdit)
Q_DECLARE_PRIVATE(QLineEdit)
Q_PRIVATE_SLOT(d_func(), void _q_handleWindowActivate())
- Q_PRIVATE_SLOT(d_func(), void _q_deleteSelected())
Q_PRIVATE_SLOT(d_func(), void _q_textEdited(const QString &))
Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged(int, int))
#ifndef QT_NO_COMPLETER
diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp
index cec34da..4218630 100644
--- a/src/gui/widgets/qlineedit_p.cpp
+++ b/src/gui/widgets/qlineedit_p.cpp
@@ -93,10 +93,6 @@ void QLineEditPrivate::_q_completionHighlighted(QString newText)
#endif // QT_NO_COMPLETER
-void QLineEditPrivate::_q_clipboardChanged()
-{
-}
-
void QLineEditPrivate::_q_handleWindowActivate()
{
Q_Q(QLineEdit);
@@ -104,10 +100,6 @@ void QLineEditPrivate::_q_handleWindowActivate()
control->deselect();
}
-void QLineEditPrivate::_q_deleteSelected()
-{
-}
-
void QLineEditPrivate::_q_textEdited(const QString &text)
{
Q_Q(QLineEdit);
diff --git a/src/gui/widgets/qlineedit_p.h b/src/gui/widgets/qlineedit_p.h
index 3521dcb..260bc19 100644
--- a/src/gui/widgets/qlineedit_p.h
+++ b/src/gui/widgets/qlineedit_p.h
@@ -122,9 +122,7 @@ public:
QRect adjustedContentsRect() const;
- void _q_clipboardChanged();
void _q_handleWindowActivate();
- void _q_deleteSelected();
void _q_textEdited(const QString &);
void _q_cursorPositionChanged(int, int);
#ifdef QT_KEYPAD_NAVIGATION
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index f0f425f..4734d22 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -368,7 +368,9 @@ QRect QMenuPrivate::actionRect(QAction *act) const
return actionRects.at(index);
}
+#if defined(Q_WS_MAC)
static const qreal MenuFadeTimeInSec = 0.150;
+#endif
void QMenuPrivate::hideUpToMenuBar()
{
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 47a8042..8e28abe 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -607,6 +607,13 @@ static inline void syncNSMenuItemVisiblity(NSMenuItem *menuItem, bool actionVisi
[menuItem setHidden:!actionVisibility];
}
+static inline void syncNSMenuItemEnabled(NSMenuItem *menuItem, bool enabled)
+{
+ [menuItem setEnabled:NO];
+ [menuItem setEnabled:YES];
+ [menuItem setEnabled:enabled];
+}
+
static inline void syncMenuBarItemsVisiblity(const QMenuBarPrivate::QMacMenuBarPrivate *mac_menubar)
{
const QList<QMacMenuAction *> &menubarActions = mac_menubar->actionItems;
@@ -659,12 +666,12 @@ void qt_mac_set_modal_state_helper_recursive(OSMenuRef menu, OSMenuRef merge, bo
// The item should follow what the QAction has.
if ([item tag]) {
QAction *action = reinterpret_cast<QAction *>([item tag]);
- [item setEnabled:action->isEnabled()];
+ syncNSMenuItemEnabled(item, action->isEnabled());
} else {
- [item setEnabled:YES];
+ syncNSMenuItemEnabled(item, YES);
}
} else {
- [item setEnabled:NO];
+ syncNSMenuItemEnabled(item, NO);
}
}
}
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index e025876..4ea18f8 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -379,7 +379,7 @@ void QPlainTextDocumentLayout::layoutBlock(const QTextBlock &block)
tl->beginLayout();
qreal availableWidth = d->width;
if (availableWidth <= 0) {
- availableWidth = INT_MAX; // similar to text edit with pageSize.width == 0
+ availableWidth = qreal(INT_MAX); // similar to text edit with pageSize.width == 0
}
availableWidth -= 2*margin + extraMargin;
while (1) {