diff --git a/QupZilla.pro b/QupZilla.pro index 8c3cebe74..0def652db 100644 --- a/QupZilla.pro +++ b/QupZilla.pro @@ -6,8 +6,8 @@ # #------------------------------------------------- -lessThan(QT_VERSION, 4.7) { - error("QupZilla requires at least Qt 4.7!") +lessThan(QT_VERSION, 5.4) { + error("QupZilla requires at least Qt 5.4!") } # Create plugins directory first on Mac / Linux diff --git a/src/defines.pri b/src/defines.pri index b10564c4e..95e9c5fd2 100644 --- a/src/defines.pri +++ b/src/defines.pri @@ -60,48 +60,6 @@ haiku-* { DEFINES *= NO_X11 } -# Check for pkg-config availability -!mac:unix:system(pkg-config --version > /dev/null) { - isEqual(QT_MAJOR_VERSION, 5) { - MODNAME = Qt5WebKitWidgets - } - else { - MODNAME = QtWebKit - } - - QTWEBKIT_VERSION = $$system(PKG_CONFIG_PATH="$$[QT_INSTALL_LIBS]/pkgconfig" pkg-config --modversion $$MODNAME) - QTWEBKIT_VERSION_MAJOR = $$section(QTWEBKIT_VERSION, ".", 0, 0) - QTWEBKIT_VERSION_MINOR = $$section(QTWEBKIT_VERSION, ".", 1, 1) - - isEqual(QT_MAJOR_VERSION, 5) { - greaterThan(QTWEBKIT_VERSION_MAJOR, 4) { - # There is one Qt5WebKitWidgets version now, which has same features as QtWebKit 2.3 - DEFINES *= USE_QTWEBKIT_2_2 USE_QTWEBKIT_2_3 - } - } - else { # Qt 4 - equals(QTWEBKIT_VERSION_MAJOR, 4):greaterThan(QTWEBKIT_VERSION_MINOR, 8) { - # 4.9.x = QtWebKit 2.2 - DEFINES *= USE_QTWEBKIT_2_2 - } - - equals(QTWEBKIT_VERSION_MAJOR, 4):greaterThan(QTWEBKIT_VERSION_MINOR, 9) { - # 4.10.x = QtWebKit 2.3 - DEFINES *= USE_QTWEBKIT_2_3 - } - } -} -else { - isEqual(QT_VERSION, 4.8.0)|greaterThan(QT_VERSION, 4.8.0) { - DEFINES *= USE_QTWEBKIT_2_2 - } - - isEqual(QT_MAJOR_VERSION, 5) { - DEFINES *= USE_QTWEBKIT_2_2 USE_QTWEBKIT_2_3 - } -} - - !mac:unix { binary_folder = /usr/bin library_folder = /usr/lib @@ -140,8 +98,7 @@ isEmpty(QMAKE_LRELEASE) { # Try to use lrelease from PATH unix:!exists($$QMAKE_LRELEASE) { - isEqual(QT_MAJOR_VERSION, 4): QMAKE_LRELEASE = lrelease-qt4 - else: QMAKE_LRELEASE = lrelease + QMAKE_LRELEASE = lrelease } } diff --git a/src/lib/3rdparty/lineedit.cpp b/src/lib/3rdparty/lineedit.cpp index a56bc45ea..2c4b339c8 100644 --- a/src/lib/3rdparty/lineedit.cpp +++ b/src/lib/3rdparty/lineedit.cpp @@ -27,10 +27,6 @@ #include #include -#if QT_VERSION < 0x050000 -#include -#endif - SideWidget::SideWidget(QWidget* parent) : QWidget(parent) { @@ -208,16 +204,6 @@ QMenu* LineEdit::createContextMenu() popup->addSeparator(); popup->addAction(m_editActions[SelectAll]); -#if !defined(QT_NO_IM) && QT_VERSION < 0x050000 - QInputContext* qic = inputContext(); - if (qic) { - QList imActions = qic->actions(); - for (int i = 0; i < imActions.size(); ++i) { - popup->addAction(imActions.at(i)); - } - } -#endif - // Hack to get QUnicodeControlCharacterMenu QMenu* tmp = createStandardContextMenu(); tmp->setParent(popup); diff --git a/src/lib/3rdparty/qtwin.cpp b/src/lib/3rdparty/qtwin.cpp index 0dc14cdad..8ea82ef33 100644 --- a/src/lib/3rdparty/qtwin.cpp +++ b/src/lib/3rdparty/qtwin.cpp @@ -84,11 +84,7 @@ public: void removeWidget(QWidget* widget) { widgets.removeAll(widget); } -#if (QT_VERSION < 0x050000) - bool winEvent(MSG* message, long* result); -#else bool nativeEvent(const QByteArray &eventType, void* _message, long* result); -#endif private: QWidgetList widgets; @@ -272,15 +268,10 @@ WindowNotifier* QtWin::windowNotifier() /* Notify all enabled windows that the DWM state changed */ -#if (QT_VERSION < 0x050000) -bool WindowNotifier::winEvent(MSG* message, long* result) -{ -#else bool WindowNotifier::nativeEvent(const QByteArray &eventType, void* _message, long* result) { Q_UNUSED(eventType) MSG* message = static_cast(_message); -#endif if (message && message->message == WM_DWMCOMPOSITIONCHANGED) { bool compositionEnabled = QtWin::isCompositionEnabled(); foreach (QWidget* widget, widgets) { @@ -296,11 +287,7 @@ bool WindowNotifier::nativeEvent(const QByteArray &eventType, void* _message, lo } } } -#if (QT_VERSION < 0x050000) - return QWidget::winEvent(message, result); -#else return QWidget::nativeEvent(eventType, _message, result); -#endif } #ifdef W7API diff --git a/src/lib/adblock/adblockrule.cpp b/src/lib/adblock/adblockrule.cpp index 24a224f63..37de3b1f6 100644 --- a/src/lib/adblock/adblockrule.cpp +++ b/src/lib/adblock/adblockrule.cpp @@ -59,7 +59,6 @@ // count .co.uk (and others) as second-level domain static QString toSecondLevelDomain(const QUrl &url) { -#if QT_VERSION >= 0x040800 const QString topLevelDomain = url.topLevelDomain(); const QString urlHost = url.host(); @@ -78,19 +77,6 @@ static QString toSecondLevelDomain(const QUrl &url) } return domain + topLevelDomain; -#else - QString domain = url.host(); - - if (domain.count(QL1C('.')) == 0) { - return QString(); - } - - while (domain.count(QL1C('.')) != 1) { - domain = domain.mid(domain.indexOf(QL1C('.')) + 1); - } - - return domain; -#endif } AdBlockRule::AdBlockRule(const QString &filter, AdBlockSubscription* subscription) diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp index 64efd06e9..6ac820416 100644 --- a/src/lib/app/browserwindow.cpp +++ b/src/lib/app/browserwindow.cpp @@ -89,10 +89,6 @@ #include #include -#if QT_VERSION < 0x050000 -#include "qwebkitversion.h" -#endif - #ifdef QZ_WS_X11 #include #include @@ -1671,15 +1667,10 @@ void BrowserWindow::applyBlurToMainWindow(bool force) QtWin::extendFrameIntoClientArea(this, leftMargin, topMargin, rightMargin, bottomMargin); } -#if (QT_VERSION < 0x050000) -bool BrowserWindow::winEvent(MSG* message, long* result) -{ -#else bool BrowserWindow::nativeEvent(const QByteArray &eventType, void* _message, long* result) { Q_UNUSED(eventType) MSG* message = static_cast(_message); -#endif if (message && message->message == WM_DWMCOMPOSITIONCHANGED) { Settings settings; settings.beginGroup("Browser-View-Settings"); @@ -1716,11 +1707,7 @@ bool BrowserWindow::nativeEvent(const QByteArray &eventType, void* _message, lon m_useTransparentBackground = false; } } -#if (QT_VERSION < 0x050000) - return QMainWindow::winEvent(message, result); -#else return QMainWindow::nativeEvent(eventType, _message, result); -#endif } void BrowserWindow::paintEvent(QPaintEvent* event) diff --git a/src/lib/app/browserwindow.h b/src/lib/app/browserwindow.h index 693651320..54dbc551c 100644 --- a/src/lib/app/browserwindow.h +++ b/src/lib/app/browserwindow.h @@ -231,11 +231,7 @@ private slots: void applyBlurToMainWindow(bool force = false); private: -#if (QT_VERSION < 0x050000) - bool winEvent(MSG* message, long* result); -#else bool nativeEvent(const QByteArray &eventType, void* _message, long* result); -#endif void paintEvent(QPaintEvent* event); bool eventFilter(QObject* object, QEvent* event); diff --git a/src/lib/app/datapaths.cpp b/src/lib/app/datapaths.cpp index 05a5f10aa..3cee88282 100644 --- a/src/lib/app/datapaths.cpp +++ b/src/lib/app/datapaths.cpp @@ -21,11 +21,7 @@ #include #include -#if QT_VERSION < 0x050000 -#include -#else #include -#endif Q_GLOBAL_STATIC(DataPaths, qz_data_paths) @@ -104,11 +100,7 @@ void DataPaths::init() // Config #if defined(Q_OS_WIN) || defined(Q_OS_OS2) // Use %LOCALAPPDATA%/qupzilla as Config path on Windows -#if QT_VERSION < 0x050000 - QString dataLocation = QDesktopServices::storageLocation(QDesktopServices::DataLocation); -#else QString dataLocation = QStandardPaths::writableLocation(QStandardPaths::DataLocation); -#endif // Backwards compatibility if (dataLocation.isEmpty()) { dataLocation = QDir::homePath() + QLatin1String("/.config/qupzilla"); diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 31d91f8f1..db7d83662 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -62,11 +62,7 @@ #include #include -#if QT_VERSION < 0x050000 -#include "qwebkitversion.h" -#else #include -#endif #if defined(Q_OS_WIN) && !defined(Q_OS_OS2) #include "registerqappassociation.h" @@ -101,9 +97,7 @@ MainApplication::MainApplication(int &argc, char** argv) , m_registerQAppAssociation(0) #endif { -#if QT_VERSION >= 0x050000 setAttribute(Qt::AA_UseHighDpiPixmaps, true); -#endif setApplicationName(QLatin1String("QupZilla")); setApplicationVersion(Qz::VERSION); diff --git a/src/lib/app/qzcommon.h b/src/lib/app/qzcommon.h index 8c77dfcc3..d8560f524 100644 --- a/src/lib/app/qzcommon.h +++ b/src/lib/app/qzcommon.h @@ -37,11 +37,7 @@ #endif #ifndef QSL -#if QT_VERSION >= 0x050000 #define QSL(x) QStringLiteral(x) -#else -#define QSL(x) QLatin1String(x) -#endif #endif #ifndef QL1S diff --git a/src/lib/autofill/autofill.cpp b/src/lib/autofill/autofill.cpp index efc7aca72..bb5630da5 100644 --- a/src/lib/autofill/autofill.cpp +++ b/src/lib/autofill/autofill.cpp @@ -32,9 +32,7 @@ #include #include -#if QT_VERSION >= 0x050000 #include -#endif AutoFill::AutoFill(QObject* parent) : QObject(parent) diff --git a/src/lib/autofill/pageformcompleter.cpp b/src/lib/autofill/pageformcompleter.cpp index fac0127c6..0cb774901 100644 --- a/src/lib/autofill/pageformcompleter.cpp +++ b/src/lib/autofill/pageformcompleter.cpp @@ -19,9 +19,7 @@ #include "qzregexp.h" #include -#if QT_VERSION >= 0x050000 #include -#endif PageFormCompleter::PageFormCompleter() : m_page(0) @@ -247,13 +245,9 @@ PageFormCompleter::QueryItems PageFormCompleter::createQueryItems(QByteArray dat // QUrlQuery/QUrl never encodes/decodes + and spaces data.replace('+', ' '); -#if QT_VERSION >= 0x050000 QUrlQuery query; query.setQuery(data); QueryItems arguments = query.queryItems(QUrl::FullyDecoded); -#else - QueryItems arguments = QUrl::fromEncoded("http://foo.com/?" + data).queryItems(); -#endif return arguments; } diff --git a/src/lib/downloads/downloadfilehelper.cpp b/src/lib/downloads/downloadfilehelper.cpp index 446a21daa..3762e6bde 100644 --- a/src/lib/downloads/downloadfilehelper.cpp +++ b/src/lib/downloads/downloadfilehelper.cpp @@ -34,11 +34,7 @@ #include #include -#if QT_VERSION >= 0x050000 #include -#else -#include -#endif DownloadFileHelper::DownloadFileHelper(const QString &lastDownloadPath, const QString &downloadPath, bool useNativeDialog) : QObject() @@ -229,22 +225,12 @@ void DownloadFileHelper::optionsDialogAccepted(int finish) dialog->selectFile(m_h_fileName); QList urls; - urls << -#if QT_VERSION >= 0x050000 - QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)) + urls << QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)) << QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)) << QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)) << QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)) << QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MusicLocation)) << QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation)); -#else - QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::HomeLocation)) - << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)) - << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)) - << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation)) - << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MusicLocation)) - << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation)); -#endif dialog->setSidebarUrls(urls); dialog->open(); diff --git a/src/lib/downloads/downloaditem.cpp b/src/lib/downloads/downloaditem.cpp index ae352f21a..abc81c6c0 100644 --- a/src/lib/downloads/downloaditem.cpp +++ b/src/lib/downloads/downloaditem.cpp @@ -201,10 +201,6 @@ void DownloadItem::finished() } m_item->setSizeHint(sizeHint()); -#if QT_VERSION == 0x040700 // Workaround - ui->button->show(); - ui->button->hide(); -#endif m_downloading = false; if (m_openAfterFinish) { @@ -353,10 +349,6 @@ void DownloadItem::stop(bool askForDeleteFile) ui->button->hide(); m_item->setSizeHint(sizeHint()); -#if QT_VERSION == 0x040700 // Workaround - ui->button->show(); - ui->button->hide(); -#endif m_downloading = false; emit downloadFinished(false); diff --git a/src/lib/downloads/downloadmanager.cpp b/src/lib/downloads/downloadmanager.cpp index 9d00529d1..3cf5dcbb0 100644 --- a/src/lib/downloads/downloadmanager.cpp +++ b/src/lib/downloads/downloadmanager.cpp @@ -123,15 +123,10 @@ void DownloadManager::startExternalManager(const QUrl &url) } #ifdef W7TASKBAR -#if (QT_VERSION < 0x050000) -bool DownloadManager::winEvent(MSG* message, long* result) -{ -#else bool DownloadManager::nativeEvent(const QByteArray &eventType, void* _message, long* result) { Q_UNUSED(eventType) MSG* message = static_cast(_message); -#endif return win7.winEvent(message, result); } #endif diff --git a/src/lib/downloads/downloadmanager.h b/src/lib/downloads/downloadmanager.h index a3f570d4c..1d0db843f 100644 --- a/src/lib/downloads/downloadmanager.h +++ b/src/lib/downloads/downloadmanager.h @@ -83,12 +83,8 @@ public slots: #ifdef W7TASKBAR protected: -#if (QT_VERSION < 0x050000) - virtual bool winEvent(MSG* message, long* result); -#else virtual bool nativeEvent(const QByteArray &eventType, void* _message, long* result); #endif -#endif private slots: void clearList(); diff --git a/src/lib/lib.pro b/src/lib/lib.pro index 09a7936da..4a2203b28 100644 --- a/src/lib/lib.pro +++ b/src/lib/lib.pro @@ -1,8 +1,4 @@ -isEqual(QT_MAJOR_VERSION, 5) { - QT += webenginewidgets network widgets printsupport sql script gui-private -} else { - QT += core gui webkit sql network script concurrent -} +QT += webenginewidgets network widgets printsupport sql script gui-private TARGET = QupZilla TEMPLATE = lib @@ -231,6 +227,7 @@ SOURCES += \ tools/pagethumbnailer.cpp \ tools/plaineditwithlines.cpp \ tools/progressbar.cpp \ + tools/qzregexp.cpp \ tools/qztools.cpp \ tools/sqldatabase.cpp \ tools/toolbutton.cpp \ @@ -434,6 +431,7 @@ HEADERS += \ tools/pagethumbnailer.h \ tools/plaineditwithlines.h \ tools/progressbar.h \ + tools/qzregexp.h \ tools/qztools.h \ tools/sqldatabase.h \ tools/toolbutton.h \ @@ -509,14 +507,10 @@ RESOURCES += \ data/icons.qrc \ data/oxygen-fallback.qrc -isEqual(QT_MAJOR_VERSION, 5) { - qtHaveModule(ftp) { - QT *= ftp - } else { - include(3rdparty/qftp/qftp.pri) - } - - SOURCES += tools/qzregexp.cpp +qtHaveModule(ftp) { + QT *= ftp +} else { + include(3rdparty/qftp/qftp.pri) } !mac:unix { diff --git a/src/lib/navigation/completer/locationcompleterrefreshjob.cpp b/src/lib/navigation/completer/locationcompleterrefreshjob.cpp index 8a845ed81..762955cf5 100644 --- a/src/lib/navigation/completer/locationcompleterrefreshjob.cpp +++ b/src/lib/navigation/completer/locationcompleterrefreshjob.cpp @@ -28,11 +28,7 @@ #include -#if QT_VERSION >= 0x050000 #include -#else -#include -#endif LocationCompleterRefreshJob::LocationCompleterRefreshJob(const QString &searchString) : QObject() diff --git a/src/lib/network/schemehandlers/adblockschemehandler.cpp b/src/lib/network/schemehandlers/adblockschemehandler.cpp index e339d7c35..5a45db66b 100644 --- a/src/lib/network/schemehandlers/adblockschemehandler.cpp +++ b/src/lib/network/schemehandlers/adblockschemehandler.cpp @@ -22,9 +22,7 @@ #include #include -#if QT_VERSION >= 0x050000 #include -#endif AdBlockSchemeHandler::AdBlockSchemeHandler() : SchemeHandler() @@ -40,12 +38,7 @@ QNetworkReply* AdBlockSchemeHandler::createRequest(QNetworkAccessManager::Operat } const QUrl url = request.url(); - const QList > queryItems = -#if QT_VERSION >= 0x050000 - QUrlQuery(url).queryItems(); -#else - url.queryItems(); -#endif + const QList > queryItems = QUrlQuery(url).queryItems(); QString subscriptionTitle; QString subscriptionUrl; diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp index 7ddb372d2..360b300c7 100644 --- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp +++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp @@ -35,11 +35,7 @@ #include #include -#if QT_VERSION < 0x050000 -#include "qwebkitversion.h" -#else #include -#endif static QString authorString(const char* name, const QString &mail) { diff --git a/src/lib/opensearch/opensearchengine.cpp b/src/lib/opensearch/opensearchengine.cpp index 030e4ac94..c73d840b3 100644 --- a/src/lib/opensearch/opensearchengine.cpp +++ b/src/lib/opensearch/opensearchengine.cpp @@ -47,9 +47,7 @@ #include #include -#if QT_VERSION >= 0x050000 #include -#endif /*! @@ -226,22 +224,14 @@ QUrl OpenSearchEngine::searchUrl(const QString &searchTerm) const QUrl retVal = QUrl::fromEncoded(parseTemplate(searchTerm, m_searchUrlTemplate).toUtf8()); -#if QT_VERSION >= 0x050000 QUrlQuery query(retVal); -#endif if (m_searchMethod != QLatin1String("post")) { Parameters::const_iterator end = m_searchParameters.constEnd(); Parameters::const_iterator i = m_searchParameters.constBegin(); for (; i != end; ++i) { -#if QT_VERSION >= 0x050000 query.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); -#else - retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); -#endif } -#if QT_VERSION >= 0x050000 retVal.setQuery(query); -#endif } return retVal; @@ -255,21 +245,13 @@ QByteArray OpenSearchEngine::getPostData(const QString &searchTerm) const QUrl retVal = QUrl("http://foo.bar"); -#if QT_VERSION >= 0x050000 QUrlQuery query(retVal); -#endif Parameters::const_iterator end = m_searchParameters.constEnd(); Parameters::const_iterator i = m_searchParameters.constBegin(); for (; i != end; ++i) { -#if QT_VERSION >= 0x050000 query.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); -#else - retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); -#endif } -#if QT_VERSION >= 0x050000 retVal.setQuery(query); -#endif QByteArray data = retVal.toEncoded(QUrl::RemoveScheme); return data.contains('?') ? data.mid(data.lastIndexOf('?') + 1) : QByteArray(); @@ -324,22 +306,14 @@ QUrl OpenSearchEngine::suggestionsUrl(const QString &searchTerm) const QUrl retVal = QUrl::fromEncoded(parseTemplate(searchTerm, m_suggestionsUrlTemplate).toUtf8()); -#if QT_VERSION >= 0x050000 QUrlQuery query(retVal); -#endif if (m_suggestionsMethod != QLatin1String("post")) { Parameters::const_iterator end = m_suggestionsParameters.constEnd(); Parameters::const_iterator i = m_suggestionsParameters.constBegin(); for (; i != end; ++i) { -#if QT_VERSION >= 0x050000 query.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); -#else - retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); -#endif } -#if QT_VERSION >= 0x050000 retVal.setQuery(query); -#endif } return retVal; diff --git a/src/lib/opensearch/searchenginesmanager.cpp b/src/lib/opensearch/searchenginesmanager.cpp index 7725cba1e..42e84436e 100644 --- a/src/lib/opensearch/searchenginesmanager.cpp +++ b/src/lib/opensearch/searchenginesmanager.cpp @@ -32,9 +32,7 @@ #include #include -#if QT_VERSION >= 0x050000 #include -#endif #define ENSURE_LOADED if (!m_settingsLoaded) loadSettings(); @@ -290,7 +288,6 @@ void SearchEnginesManager::addEngineFromForm(const QWebElement &element, WebView parameterUrl = QUrl("http://foo.bar"); } -#if QT_VERSION >= 0x050000 QUrlQuery query(parameterUrl); query.addQueryItem(element.attribute("name"), "%s"); @@ -304,28 +301,6 @@ void SearchEnginesManager::addEngineFromForm(const QWebElement &element, WebView } parameterUrl.setQuery(query); -#else - QList > queryItems; - - QPair item; - item.first = element.attribute("name").toUtf8(); - item.second = "%s"; - queryItems.append(item); - - QWebElementCollection allInputs = formElement.findAll("input"); - foreach (QWebElement e, allInputs) { - if (element == e || !e.hasAttribute("name")) { - continue; - } - - QPair item; - item.first = QUrl::toPercentEncoding(e.attribute("name").toUtf8()); - item.second = QUrl::toPercentEncoding(e.evaluateJavaScript("this.value").toByteArray()); - - queryItems.append(item); - } - parameterUrl.setEncodedQueryItems(parameterUrl.encodedQueryItems() + queryItems); -#endif if (!isPost) { actionUrl = parameterUrl; diff --git a/src/lib/other/aboutdialog.cpp b/src/lib/other/aboutdialog.cpp index 86a553d4b..cac7625a3 100644 --- a/src/lib/other/aboutdialog.cpp +++ b/src/lib/other/aboutdialog.cpp @@ -23,11 +23,7 @@ #include "webpage.h" #include "qtwin.h" -#if QT_VERSION < 0x050000 -#include "qwebkitversion.h" -#else #include -#endif AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), diff --git a/src/lib/other/pagescreen.cpp b/src/lib/other/pagescreen.cpp index f833f6e48..6af8f8e50 100644 --- a/src/lib/other/pagescreen.cpp +++ b/src/lib/other/pagescreen.cpp @@ -35,11 +35,7 @@ #include #include -#if QT_VERSION >= 0x050000 #include -#else -#include -#endif PageScreen::PageScreen(WebView* view, QWidget* parent) : QDialog(parent) diff --git a/src/lib/tools/certificateinfowidget.cpp b/src/lib/tools/certificateinfowidget.cpp index aff104dae..f4dd878f9 100644 --- a/src/lib/tools/certificateinfowidget.cpp +++ b/src/lib/tools/certificateinfowidget.cpp @@ -25,13 +25,8 @@ QString CertificateInfoWidget::certificateItemText(const QSslCertificate &cert) { -#if QT_VERSION >= 0x050000 QString commonName = cert.subjectInfo(QSslCertificate::CommonName).isEmpty() ? QString() : cert.subjectInfo(QSslCertificate::CommonName).at(0); QString organization = cert.subjectInfo(QSslCertificate::Organization).isEmpty() ? QString() : cert.subjectInfo(QSslCertificate::Organization).at(0); -#else - QString commonName = cert.subjectInfo(QSslCertificate::CommonName); - QString organization = cert.subjectInfo(QSslCertificate::Organization); -#endif if (commonName.isEmpty()) { return clearCertSpecialSymbols(organization); diff --git a/src/lib/tools/headerview.cpp b/src/lib/tools/headerview.cpp index 813d058dd..73bb49c47 100644 --- a/src/lib/tools/headerview.cpp +++ b/src/lib/tools/headerview.cpp @@ -26,11 +26,7 @@ HeaderView::HeaderView(QAbstractItemView* parent) , m_menu(0) , m_resizeOnShow(false) { -#if QT_VERSION >= 0x050000 setSectionsMovable(true); -#else - setMovable(true); -#endif setStretchLastSection(true); setDefaultAlignment(Qt::AlignLeft); setMinimumSectionSize(60); diff --git a/src/lib/tools/qzregexp.cpp b/src/lib/tools/qzregexp.cpp index fe8caf92f..40adcc5cb 100644 --- a/src/lib/tools/qzregexp.cpp +++ b/src/lib/tools/qzregexp.cpp @@ -18,7 +18,6 @@ #include "qzregexp.h" #include "qztools.h" -#if (QT_VERSION >= 0x050000) QzRegExp::QzRegExp() : QRegularExpression(QString(), QRegularExpression::DotMatchesEverythingOption) , m_matchedLength(-1) @@ -83,5 +82,4 @@ QString QzRegExp::cap(int nth) const return m_capturedTexts.at(nth); } -#endif // (QT_VERSION >= 0x050000) diff --git a/src/lib/tools/qzregexp.h b/src/lib/tools/qzregexp.h index ce05b227d..8c276d5d8 100644 --- a/src/lib/tools/qzregexp.h +++ b/src/lib/tools/qzregexp.h @@ -18,13 +18,6 @@ #ifndef QZREGEXP_H #define QZREGEXP_H -#include // Needed for QT_VERSION - -#if (QT_VERSION < 0x050000) -// Qt 4 - use QRegExp directly -#include -#define QzRegExp QRegExp -#else // Qt 5 #include #include @@ -47,6 +40,5 @@ private: int m_matchedLength; }; -#endif // Qt 5 #endif // QZREGEXP_H diff --git a/src/lib/tools/sqldatabase.cpp b/src/lib/tools/sqldatabase.cpp index 10f94b440..b37dd38c9 100644 --- a/src/lib/tools/sqldatabase.cpp +++ b/src/lib/tools/sqldatabase.cpp @@ -20,11 +20,7 @@ #include #include -#if QT_VERSION >= 0x050000 #include -#else -#include -#endif Q_GLOBAL_STATIC(SqlDatabase, qz_sql_database) diff --git a/src/main/main.cpp b/src/main/main.cpp index bad4c0195..566a30240 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -29,14 +29,7 @@ #include #include #include - -#if QT_VERSION >= 0x050000 #include -#else -#include "qwebkitversion.h" -#endif - -#include void qupzilla_signal_handler(int s) { @@ -107,30 +100,6 @@ void qupzilla_signal_handler(int s) #endif // defined(Q_OS_LINUX) || defined(__GLIBC__) || defined(__FreeBSD__) #ifndef Q_OS_WIN -#if (QT_VERSION < 0x050000) -void msgHandler(QtMsgType type, const char* msg) -{ - // Skip this debug message as it may occur in a large amount over time - if (strcmp("QFont::setPixelSize: Pixel size <= 0 (0)", msg) == 0) { - return; - } - - switch (type) { - case QtDebugMsg: - case QtWarningMsg: - case QtCriticalMsg: - std::cerr << msg << std::endl; - break; - - case QtFatalMsg: - std::cerr << "Fatal: " << msg << std::endl; - abort(); - - default: - break; - } -} -#else void msgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { if (msg.startsWith(QL1S("QSslSocket: cannot resolve SSLv2_"))) @@ -153,24 +122,14 @@ void msgHandler(QtMsgType type, const QMessageLogContext &context, const QString } } #endif -#endif int main(int argc, char* argv[]) { QT_REQUIRE_VERSION(argc, argv, "4.7.0"); #ifndef Q_OS_WIN -#if (QT_VERSION < 0x050000) - qInstallMsgHandler(&msgHandler); -#else qInstallMessageHandler(&msgHandler); #endif -#endif - -#if defined(QZ_WS_X11) && QT_VERSION < 0x050000 - // Better overall performance on X11 - QApplication::setGraphicsSystem(QSL("raster")); -#endif #if defined(Q_OS_LINUX) || defined(__GLIBC__) || defined(__FreeBSD__) signal(SIGSEGV, qupzilla_signal_handler); diff --git a/src/main/main.pro b/src/main/main.pro index 9f1905dfa..7cd3fcfc2 100644 --- a/src/main/main.pro +++ b/src/main/main.pro @@ -1,10 +1,6 @@ include(../defines.pri) -isEqual(QT_MAJOR_VERSION, 5) { - QT += webengine webenginewidgets network widgets printsupport sql script -} else { - QT += core gui webkit sql network script -} +QT += webengine webenginewidgets network widgets printsupport sql script TARGET = qupzilla mac: TARGET = QupZilla diff --git a/tests/autotests/autotests.pro b/tests/autotests/autotests.pro index 191669371..30203e7b1 100644 --- a/tests/autotests/autotests.pro +++ b/tests/autotests/autotests.pro @@ -1,11 +1,6 @@ include($$PWD/../../src/defines.pri) -isEqual(QT_MAJOR_VERSION, 5) { - QT += webkitwidgets network widgets printsupport sql script gui-private testlib -} else { - QT += core gui webkit sql network script - CONFIG += qtestlib -} +QT += webenginewidgets network widgets printsupport sql script gui-private testlib TARGET = autotests