mirror of
https://github.com/zealdocs/zeal.git
synced 2024-08-17 02:00:25 +03:00
style: fix version checks
This commit is contained in:
parent
45a55a64e5
commit
cfb1dc661e
@ -184,7 +184,7 @@ int main(int argc, char *argv[])
|
||||
QCoreApplication::setOrganizationDomain(QStringLiteral("zealdocs.org"));
|
||||
QCoreApplication::setOrganizationName(QStringLiteral("Zeal"));
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
#endif
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <QWebEngineSettings>
|
||||
#include <QWheelEvent>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <QWebEngineContextMenuData>
|
||||
#else
|
||||
#include <QWebEngineContextMenuRequest>
|
||||
@ -121,7 +121,7 @@ QWebEngineView *WebView::createWindow(QWebEnginePage::WebWindowType type)
|
||||
|
||||
void WebView::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
const QWebEngineContextMenuData& contextData = page()->contextMenuData();
|
||||
|
||||
if (!contextData.isValid()) {
|
||||
@ -144,7 +144,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
|
||||
|
||||
m_contextMenu = new QMenu(this);
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QUrl linkUrl = contextData.linkUrl();
|
||||
#else
|
||||
QUrl linkUrl = contextMenuRequest->linkUrl();
|
||||
@ -171,7 +171,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
|
||||
}
|
||||
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
const QString selectedText = contextData.selectedText();
|
||||
#else
|
||||
const QString selectedText = contextMenuRequest->selectedText();
|
||||
|
@ -57,7 +57,7 @@ using namespace Zeal::Core;
|
||||
Settings::Settings(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
qRegisterMetaTypeStreamOperators<ExternalLinkPolicy>("ExternalLinkPolicy");
|
||||
#else
|
||||
qRegisterMetaType<ExternalLinkPolicy>("ExternalLinkPolicy");
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include <QAbstractNativeEventFilter>
|
||||
#include <QHash>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#define NativeEventFilterResult long
|
||||
#else
|
||||
#define NativeEventFilterResult qintptr
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include <QScopedPointer>
|
||||
#include <QVector>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <QX11Info>
|
||||
#else
|
||||
#include <QtGui/private/qtx11extras_p.h>
|
||||
|
@ -37,7 +37,7 @@ ShortcutEdit::ShortcutEdit(const QString &text, QWidget *parent)
|
||||
: QLineEdit(text, parent)
|
||||
{
|
||||
connect(this, &QLineEdit::textChanged, [this](const QString &text) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
m_key = QKeySequence(text, QKeySequence::NativeText)[0];
|
||||
#else
|
||||
m_key = QKeySequence(text, QKeySequence::NativeText)[0].toCombined();
|
||||
|
Loading…
Reference in New Issue
Block a user