Skip to content

Commit dbd7d4f

Browse files
authored
Increase minimum Qt version to 5.12.0 (openscad#5276)
https://bugreports.qt.io/browse/QTBUG-65592 was duplicated by: https://bugreports.qt.io/browse/QTBUG-67069 and then by: https://bugreports.qt.io/browse/QTBUG-70571 which was fixed by: https://code.qt.io/cgit/qt/qtbase.git/commit/?id=e2d79b496335e8d8666014e900930c66cf722eb6 Reverts: 36bc309 ("Add workaround for jumping dock widgets.", 2018-12-08)
1 parent 660dd12 commit dbd7d4f

File tree

6 files changed

+3
-34
lines changed

6 files changed

+3
-34
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ if(NOT HEADLESS)
591591
message(STATUS "DBus input driver disabled per user request.")
592592
endif()
593593
else()
594-
find_package(Qt5 5.4 COMPONENTS Core Widgets Multimedia OpenGL Concurrent Network Svg REQUIRED QUIET)
594+
find_package(Qt5 5.12 COMPONENTS Core Widgets Multimedia OpenGL Concurrent Network Svg REQUIRED QUIET)
595595
message(STATUS "Qt5: ${Qt5_VERSION}")
596596

597597
if (Qt5_POSITION_INDEPENDENT_CODE)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Follow the instructions for the platform you're compiling on below.
104104

105105
* A C++ compiler supporting C++17
106106
* [cmake (3.5 ->)](https://cmake.org/)
107-
* [Qt (5.4 ->)](https://qt.io/)
107+
* [Qt (5.12 ->)](https://qt.io/)
108108
* [QScintilla2 (2.9 ->)](https://riverbankcomputing.com/software/qscintilla/)
109109
* [CGAL (5.4 ->)](https://www.cgal.org/)
110110
* [GMP (5.x)](https://gmplib.org/)

src/gui/OpenSCADApp.cc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,10 @@ OpenSCADApp::~OpenSCADApp()
2424

2525
#include <QMessageBox>
2626

27-
// See: https://bugreports.qt.io/browse/QTBUG-65592
28-
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
29-
void OpenSCADApp::workaround_QTBUG_65592(QObject *o, QEvent *e)
30-
{
31-
QMainWindow *mw;
32-
if (o->isWidgetType() && e->type() == QEvent::MouseButtonPress && (mw = qobject_cast<QMainWindow *>(o))) {
33-
for (auto& ch : mw->children()) {
34-
if (auto dw = qobject_cast<QDockWidget *>(ch)) {
35-
auto pname = "_wa-QTBUG-65592";
36-
auto v = dw->property(pname);
37-
if (v.isNull()) {
38-
dw->setProperty(pname, true);
39-
mw->restoreDockWidget(dw);
40-
auto area = mw->dockWidgetArea(dw);
41-
auto orient = area == Qt::TopDockWidgetArea || area == Qt::BottomDockWidgetArea ? Qt::Horizontal : Qt::Vertical;
42-
mw->resizeDocks({dw}, {orient == Qt::Horizontal ? dw->width() : dw->height() }, orient);
43-
}
44-
}
45-
}
46-
}
47-
}
48-
#else
49-
void OpenSCADApp::workaround_QTBUG_65592(QObject *, QEvent *) { }
50-
#endif // if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
51-
5227
bool OpenSCADApp::notify(QObject *object, QEvent *event)
5328
{
5429
QString msg;
5530
try {
56-
workaround_QTBUG_65592(object, event);
5731
return QApplication::notify(object, event);
5832
} catch (const std::exception& e) {
5933
msg = e.what();

src/gui/OpenSCADApp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class OpenSCADApp : public QApplication
1414
~OpenSCADApp() override;
1515

1616
bool notify(QObject *object, QEvent *event) override;
17-
void workaround_QTBUG_65592(QObject *object, QEvent *event);
1817
void requestOpenFile(const QString& filename);
1918

2019
public slots:

src/gui/qt-obsolete.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#pragma once
22

3-
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
4-
#define setTabStopDistance setTabStopWidth
5-
#endif
6-
73
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
84
#define Q_WHEEL_EVENT_POSITION(e) ((e)->pos())
95
#else

src/utils/version_check.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676

7777
#ifndef OPENSCAD_NOGUI
7878
#include <QtCore/qglobal.h>
79-
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
79+
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
8080
#error QT library missing or version too old. See README.md. To force compile, run qmake CONFIG+=skip-version-check
8181
#endif // QT
8282
#endif

0 commit comments

Comments
 (0)