Qt: remove some more leftovers of Qt4

This commit is contained in:
wmayer
2022-03-19 23:27:28 +01:00
parent 13e09b36f8
commit a999a249e3
13 changed files with 6 additions and 103 deletions

View File

@@ -109,9 +109,8 @@ def translate(context, text, utf8_decode=False):
# Python 3 and Qt5
# The text is a utf8 string, and since it is Qt5
# the translate function doesn't use the 4th parameter
if six.PY3:
return Qtranslate(context, text, None)
return Qtranslate(context, text, None)
# Original code no longer used. It is listed here for reference
# to show how the different pairings Py2/Qt4, Py3/Qt5, Py2/Qt5, Py3/Qt4

View File

@@ -107,11 +107,7 @@ protected:
void contextMenuEvent(QContextMenuEvent *event);
void closeEvent(QCloseEvent*);
void findPrinterSettings(const QString&);
#if QT_VERSION >= 0x050300
QPageSize::PageSizeId getPageSize(int w, int h) const;
#else
QPrinter::PageSize getPageSize(int w, int h) const;
#endif
private:
QAction *m_nativeAction;
@@ -125,13 +121,8 @@ private:
std::string m_objectName;
QString m_currentPath;
#if QT_VERSION >= 0x050300
QPageLayout::Orientation m_orientation;
QPageSize::PageSizeId m_pageSize;
#else
QPrinter::Orientation m_orientation;
QPrinter::PageSize m_pageSize;
#endif
};
} // namespace DrawingViewGui

View File

@@ -482,11 +482,7 @@ void ImageView::wheelEvent(QWheelEvent * cEvent)
#endif
// Zoom around centrally displayed image point
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
int numTicks = cEvent->angleDelta().y() / 120;
#else
int numTicks = cEvent->delta() / 120;
#endif
if (_invertZoom)
numTicks = -numTicks;

View File

@@ -220,9 +220,8 @@ void MeshSelection::prepareFreehandSelection(bool add,SoEventCallbackCB *cb)
QCursor custom(cursor, mask, CROSS_HOT_X, CROSS_HOT_Y);
viewer->setComponentCursor(custom);
};
#if (QT_VERSION >= 0x050000)
QObject::connect(viewer, &Gui::View3DInventorViewer::devicePixelRatioChanged, setComponentCursor);
#endif
setComponentCursor();
this->addToSelection = add;
}

View File

@@ -129,11 +129,7 @@ bool TaskDlgFeatureParameters::accept() {
Gui::Command::commitCommand();
} catch (const Base::Exception& e) {
// Generally the only thing that should fail is feature->isValid() others should be fine
#if (QT_VERSION >= 0x050000)
QString errorText = QApplication::translate(feature->getTypeId().getName(), e.what());
#else
QString errorText = QApplication::translate(feature->getTypeId().getName(), e.what(), 0, QApplication::UnicodeUTF8);
#endif
QMessageBox::warning(Gui::getMainWindow(), tr("Input error"), errorText);
return false;
}