diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-09-02 08:49:42 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-09-02 08:49:42 (GMT) |
commit | 528bf2ca27ee3782f59844f985bf926ff3a51c96 (patch) | |
tree | 9f5e4b043939c40459ce425ccbedbb75750063a9 | |
parent | cd84cbc19df1f6ea02119ca89107645803e9c630 (diff) | |
parent | b0214670579bfabfa8f02647f579d3834968802c (diff) | |
download | Qt-528bf2ca27ee3782f59844f985bf926ff3a51c96.zip Qt-528bf2ca27ee3782f59844f985bf926ff3a51c96.tar.gz Qt-528bf2ca27ee3782f59844f985bf926ff3a51c96.tar.bz2 |
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6
-rw-r--r-- | src/gui/widgets/qdockarealayout.cpp | 8 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 4 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 1 | ||||
-rw-r--r-- | tests/auto/qmainwindow/tst_qmainwindow.cpp | 19 |
5 files changed, 30 insertions, 4 deletions
diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index 3d1d3b1..3920ae9 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -2601,28 +2601,28 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list, center_rect.setBottom(rect.bottom() - docks[QInternal::BottomDock].rect.height() - sep); QSize left_hint = docks[QInternal::LeftDock].size(); - if (!left_hint.isValid()) + if (left_hint.isNull()) left_hint = docks[QInternal::LeftDock].sizeHint(); QSize left_min = docks[QInternal::LeftDock].minimumSize(); QSize left_max = docks[QInternal::LeftDock].maximumSize(); left_hint = left_hint.boundedTo(left_max).expandedTo(left_min); QSize right_hint = docks[QInternal::RightDock].size(); - if (!right_hint.isValid()) + if (right_hint.isNull()) right_hint = docks[QInternal::RightDock].sizeHint(); QSize right_min = docks[QInternal::RightDock].minimumSize(); QSize right_max = docks[QInternal::RightDock].maximumSize(); right_hint = right_hint.boundedTo(right_max).expandedTo(right_min); QSize top_hint = docks[QInternal::TopDock].size(); - if (!top_hint.isValid()) + if (top_hint.isNull()) top_hint = docks[QInternal::TopDock].sizeHint(); QSize top_min = docks[QInternal::TopDock].minimumSize(); QSize top_max = docks[QInternal::TopDock].maximumSize(); top_hint = top_hint.boundedTo(top_max).expandedTo(top_min); QSize bottom_hint = docks[QInternal::BottomDock].size(); - if (!bottom_hint.isValid()) + if (bottom_hint.isNull()) bottom_hint = docks[QInternal::BottomDock].sizeHint(); QSize bottom_min = docks[QInternal::BottomDock].minimumSize(); QSize bottom_max = docks[QInternal::BottomDock].maximumSize(); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 599b2a9..179936d 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -1209,7 +1209,11 @@ bool QDirectFBScreen::connect(const QString &displaySpec) "Unable to get screen!", result); return false; } +#ifdef QT_NO_DIRECTFB_WM + result = d_ptr->primarySurface->GetSize(d_ptr->primarySurface, &w, &h); +#else result = d_ptr->dfbScreen->GetSize(d_ptr->dfbScreen, &w, &h); +#endif if (result != DFB_OK) { DirectFBError("QDirectFBScreen::connect: " "Unable to get screen size!", result); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index e288199..9a966a1 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -431,11 +431,13 @@ IDirectFBSurface *QDirectFBWindowSurface::directFBSurface() const IDirectFBSurface *QDirectFBWindowSurface::surfaceForWidget(const QWidget *widget, QRect *rect) const { Q_ASSERT(widget); +#ifndef QT_NO_DIRECTFB_WM if (!dfbSurface) { if (sibling && (!sibling->sibling || sibling->dfbSurface)) return sibling->surfaceForWidget(widget, rect); return 0; } +#endif QWidget *win = window(); Q_ASSERT(win); if (rect) { diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index bdb6e98..d9b5efb 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -3698,6 +3698,7 @@ void tst_QGraphicsView::task259503_scrollingArtifacts() { qDebug() << event->region(); qDebug() << updateRegion; + QEXPECT_FAIL("", "", Continue); QCOMPARE(event->region(), updateRegion); } } diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp index ffa5853..0049c8d 100644 --- a/tests/auto/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp @@ -107,6 +107,7 @@ private slots: void setCursor(); void addToolbarAfterShow(); void centralWidgetSize(); + void dockWidgetSize(); }; // Testing get/set functions @@ -1677,6 +1678,24 @@ void tst_QMainWindow::centralWidgetSize() QCOMPARE(widget.size(), widget.sizeHint()); } +void tst_QMainWindow::dockWidgetSize() +{ + QMainWindow mainWindow; + mainWindow.menuBar()->addMenu("menu"); + + MyWidget widget; + mainWindow.setCentralWidget(&widget); + + QDockWidget dock; + dock.setWidget(new MyWidget); + mainWindow.addDockWidget(Qt::TopDockWidgetArea, &dock); + + mainWindow.show(); + QTest::qWait(100); + QCOMPARE(widget.size(), widget.sizeHint()); + QCOMPARE(dock.widget()->size(), dock.widget()->sizeHint()); +} + QTEST_MAIN(tst_QMainWindow) #include "tst_qmainwindow.moc" |