diff options
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qradiobutton.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/qradiobutton.h | 1 | ||||
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 38 | ||||
-rw-r--r-- | tests/auto/qradiobutton/tst_qradiobutton.cpp | 6 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 32 |
6 files changed, 42 insertions, 45 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 6db583a..d1c5fd2 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -7015,7 +7015,7 @@ void QGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *event) setSelected(true); } } - } else if (!(flags() & ItemIsMovable) && !isSelected()) { + } else if (!(flags() & ItemIsMovable)) { event->ignore(); } if (d_ptr->isWidget) { diff --git a/src/gui/widgets/qradiobutton.cpp b/src/gui/widgets/qradiobutton.cpp index 20b6c720..56bd709 100644 --- a/src/gui/widgets/qradiobutton.cpp +++ b/src/gui/widgets/qradiobutton.cpp @@ -207,6 +207,14 @@ QSize QRadioButton::sizeHint() const /*! \reimp */ +QSize QRadioButton::minimumSizeHint() const +{ + return sizeHint(); +} + +/*! + \reimp +*/ bool QRadioButton::hitButton(const QPoint &pos) const { QStyleOptionButton opt; diff --git a/src/gui/widgets/qradiobutton.h b/src/gui/widgets/qradiobutton.h index 887b747..b7031e2 100644 --- a/src/gui/widgets/qradiobutton.h +++ b/src/gui/widgets/qradiobutton.h @@ -62,6 +62,7 @@ public: explicit QRadioButton(const QString &text, QWidget *parent=0); QSize sizeHint() const; + QSize minimumSizeHint() const; protected: bool event(QEvent *e); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 6e7c83c..03ce45a 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -294,7 +294,6 @@ private slots: void explicitlyEnabled(); void selected(); void selected2(); - void selected3(); void selected_group(); void selected_textItem(); void selected_multi(); @@ -1454,43 +1453,6 @@ void tst_QGraphicsItem::selected2() } } -void tst_QGraphicsItem::selected3() -{ - QGraphicsScene scene; - QGraphicsItem *item1 = scene.addRect(QRectF(0, 0, 100, 100)); - item1->setFlag(QGraphicsItem::ItemIsSelectable); - - QGraphicsItem *item2 = scene.addRect(QRectF(100, 100, 100, 100)); - item2->setFlag(QGraphicsItem::ItemIsSelectable); - - item1->setSelected(true); - QGraphicsView view(&scene); - view.show(); - QTest::qWaitForWindowShown(&view); - - QVERIFY(item1->isSelected()); - QVERIFY(!item2->isSelected()); - - // Right click on a selected item should not clear the selection - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, view.mapFromScene(item1->boundingRect().center())); - QVERIFY(item1->isSelected()); - QCOMPARE(scene.selectedItems().count(), 1); - - // Right click on an unselected item should clear the selection - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, view.mapFromScene(item2->boundingRect().center())); - QVERIFY(!item1->isSelected()); - QCOMPARE(scene.selectedItems().count(), 0); - - item2->setSelected(true); - QVERIFY(item2->isSelected()); - QCOMPARE(scene.selectedItems().count(), 1); - - // Right click on the scene background should clear the selection - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, view.mapFromScene(QPointF(0, 110))); - QVERIFY(!item2->isSelected()); - QCOMPARE(scene.selectedItems().count(), 0); -} - void tst_QGraphicsItem::selected_group() { QGraphicsScene scene; diff --git a/tests/auto/qradiobutton/tst_qradiobutton.cpp b/tests/auto/qradiobutton/tst_qradiobutton.cpp index c074496..531ebab 100644 --- a/tests/auto/qradiobutton/tst_qradiobutton.cpp +++ b/tests/auto/qradiobutton/tst_qradiobutton.cpp @@ -58,6 +58,7 @@ public: private slots: void task190739_focus(); + void minimumSizeHint(); private: }; @@ -96,6 +97,11 @@ void tst_QRadioButton::task190739_focus() } +void tst_QRadioButton::minimumSizeHint() +{ + QRadioButton button(tr("QRadioButtons sizeHint is the same as it's minimumSizeHint")); + QCOMPARE(button.sizeHint(), button.minimumSizeHint()); +} QTEST_MAIN(tst_QRadioButton) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 687f8a1..2fe2da2 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1880,6 +1880,22 @@ QString Configure::findFileInPaths(const QString &fileName, const QString &paths return QString(); } +static QString mingwPaths(const QString &mingwPath, const QString &pathName) +{ + QString ret; + QDir mingwDir = QFileInfo(mingwPath).dir(); + const QFileInfoList subdirs = mingwDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); + for (int i = 0 ;i < subdirs.length(); ++i) { + const QFileInfo &fi = subdirs.at(i); + const QString name = fi.fileName(); + if (name == pathName) + ret += fi.absoluteFilePath() + ';'; + else if (name.contains("mingw")) + ret += fi.absoluteFilePath() + QDir::separator() + pathName + ';'; + } + return ret; +} + bool Configure::findFile( const QString &fileName ) { const QString file = fileName.toLower(); @@ -1890,18 +1906,22 @@ bool Configure::findFile( const QString &fileName ) QString paths; if (file.endsWith(".h")) { if (!mingwPath.isNull()) { - if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) + if (!findFileInPaths(file, mingwPaths(mingwPath, "include")).isNull()) return true; //now let's try the additional compiler path - QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32"); - foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) { - if (!findFileInPaths(file, version.absoluteFilePath() + QLatin1String("/include")).isNull()) - return true; + + const QFileInfoList mingwConfigs = QDir(mingwPath + QLatin1String("/../lib/gcc")).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); + for (int i = 0; i < mingwConfigs.length(); ++i) { + const QDir mingwLibDir = mingwConfigs.at(i).absoluteFilePath(); + foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) { + if (!findFileInPaths(file, version.absoluteFilePath() + QLatin1String("/include")).isNull()) + return true; + } } } paths = QString::fromLocal8Bit(getenv("INCLUDE")); } else if ( file.endsWith( ".lib" ) || file.endsWith( ".a" ) ) { - if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull()) + if (!mingwPath.isNull() && !findFileInPaths(file, mingwPaths(mingwPath, "lib")).isNull()) return true; paths = QString::fromLocal8Bit(getenv("LIB")); } else { |