summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-28 10:45:43 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-28 10:45:43 (GMT)
commit169a352dd796d79ba48dfd4d79966617a14452e4 (patch)
tree750db6cfdaec443ad49672b7e598ada16ba29d80 /src/gui/widgets
parent06dfdf230dfcebbf955cdb6bd302fad88fe0398f (diff)
parente0a2a4d343902e96e51df1fabeaaf543f4cd2a47 (diff)
downloadQt-169a352dd796d79ba48dfd4d79966617a14452e4.zip
Qt-169a352dd796d79ba48dfd4d79966617a14452e4.tar.gz
Qt-169a352dd796d79ba48dfd4d79966617a14452e4.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (324 commits) changes-4.7.0 updated Update Polish translation Revert "QDialog: user-moved dialog would not show on the same place after hide" MediaServices; Don't look at the debug info when looking for plugins. Cocoa: Native QFileDialog has problems selecting name filter Mac: improve mac native events autotest API Ensure text document is created before we access it. Fix attempted invocation of non-existent timerActivated() slot. Plugins documentation. Fix up qdocs for mediaservices namespace. Fix update issue when an item has an effect and child. Fix QDeclarativeTextInput and QGraphicsView in regards of input methods hints. Disallow "Qt" as namespace import Don't "adjust" the z value of a delegate that has been cached. Correctly inherit extension properties Autotests More QDeclarativeNetworkAccessManagerFactory doc clarification. Fix QDeclarativeNetworkAccessManagerFactory docs. Don't crash on invalid model remove signal. Ensure scheduled layout can occur before testing. ...
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp1
-rw-r--r--src/gui/widgets/qlinecontrol.cpp2
-rw-r--r--src/gui/widgets/qmenu.cpp2
-rw-r--r--src/gui/widgets/qmenu_mac.mm21
-rw-r--r--src/gui/widgets/qtabbar.cpp15
-rw-r--r--src/gui/widgets/qtabbar_p.h2
6 files changed, 26 insertions, 17 deletions
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 73ec53e..8cffebd 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -983,6 +983,7 @@ bool QAbstractScrollArea::event(QEvent *e)
case QEvent::StyleChange:
case QEvent::LayoutDirectionChange:
case QEvent::ApplicationLayoutDirectionChange:
+ case QEvent::LayoutRequest:
d->layoutChildren();
// fall through
default:
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 42df800..d027b91 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -1350,6 +1350,7 @@ bool QLineControl::processEvent(QEvent* ev)
#endif
switch(ev->type()){
#ifndef QT_NO_GRAPHICSVIEW
+ case QEvent::GraphicsSceneMouseDoubleClick:
case QEvent::GraphicsSceneMouseMove:
case QEvent::GraphicsSceneMouseRelease:
case QEvent::GraphicsSceneMousePress:{
@@ -1439,6 +1440,7 @@ void QLineControl::processMouseEvent(QMouseEvent* ev)
moveCursor(cursor, mark);
break;
}
+ case QEvent::GraphicsSceneMouseDoubleClick:
case QEvent::MouseButtonDblClick:
if (ev->button() == Qt::LeftButton) {
selectWordAtPos(xToPos(ev->pos().x()));
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index c157a2f..e0f1402 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -1834,7 +1834,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
QSize size = sizeHint();
QRect screen;
#ifndef QT_NO_GRAPHICSVIEW
- bool isEmbedded = d->nearestGraphicsProxyWidget(this);
+ bool isEmbedded = !bypassGraphicsProxyWidget(this) && d->nearestGraphicsProxyWidget(this);
if (isEmbedded)
screen = d->popupGeometry(this);
else
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 6a0eb53..e8400d6 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -665,6 +665,7 @@ void qt_mac_set_modal_state_helper_recursive(OSMenuRef menu, OSMenuRef merge, bo
}
}
#else
+ bool modalWindowOnScreen = qApp->activeModalWidget() != 0;
for (NSMenuItem *item in [menu itemArray]) {
OSMenuRef submenu = [item submenu];
if (submenu != merge) {
@@ -674,10 +675,20 @@ 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]);
- syncNSMenuItemEnabled(item, action->isEnabled());
- } else {
- syncNSMenuItemEnabled(item, YES);
- }
+ syncNSMenuItemEnabled(item, action->isEnabled());
+ } else {
+ syncNSMenuItemEnabled(item, YES);
+ }
+ // We sneak in some extra code here to handle a menu problem:
+ // If there is no window on screen, we cannot set 'nil' as
+ // menu item target, because then cocoa will disable the item
+ // (guess it assumes that there will be no first responder to
+ // catch the trigger anyway?) OTOH, If we have a modal window,
+ // then setting the menu loader as target will make cocoa not
+ // deliver the trigger because the loader is then seen as modally
+ // shaddowed). So either way there are shortcomings. Instead, we
+ // decide the target as late as possible:
+ [item setTarget:modalWindowOnScreen ? nil : getMenuLoader()];
} else {
syncNSMenuItemEnabled(item, NO);
}
@@ -1820,7 +1831,7 @@ void QMenuBarPrivate::macDestroyMenuBar()
menubars()->remove(tlw);
mac_menubar = 0;
- if (qt_mac_current_menubar.qmenubar == q) {
+ if (!qt_mac_current_menubar.qmenubar || qt_mac_current_menubar.qmenubar == q) {
#ifdef QT_MAC_USE_COCOA
QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader();
[loader removeActionsFromAppMenu];
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 7559311..d03a2f4 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -580,16 +580,10 @@ void QTabBarPrivate::layoutTab(int index)
}
}
-void QTabBarPrivate::layoutWidgets(int index)
+void QTabBarPrivate::layoutWidgets(int start)
{
Q_Q(QTabBar);
- int start = 0;
- int end = q->count();
- if (index != -1) {
- start = qMax(index, 0);
- end = qMin(end, start + 1);
- }
- for (int i = start; i < end; ++i) {
+ for (int i = start; i < q->count(); ++i) {
layoutTab(i);
}
}
@@ -1171,8 +1165,9 @@ void QTabBar::setCurrentIndex(int index)
update();
d->makeVisible(index);
d->tabList[index].lastTab = oldIndex;
- d->layoutWidgets(oldIndex);
- d->layoutWidgets(index);
+ if (oldIndex >= 0 && oldIndex < count())
+ d->layoutTab(oldIndex);
+ d->layoutTab(index);
#ifdef QT3_SUPPORT
emit selected(index);
#endif
diff --git a/src/gui/widgets/qtabbar_p.h b/src/gui/widgets/qtabbar_p.h
index 83636e6..37741f7 100644
--- a/src/gui/widgets/qtabbar_p.h
+++ b/src/gui/widgets/qtabbar_p.h
@@ -178,7 +178,7 @@ public:
void refresh();
void layoutTabs();
- void layoutWidgets(int index = -1);
+ void layoutWidgets(int start = 0);
void layoutTab(int index);
void updateMacBorderMetrics();
void setupMovableTab();