style: fix version checks

This commit is contained in:
Oleg Shparber 2023-08-08 02:06:02 -04:00
parent 45a55a64e5
commit cfb1dc661e
6 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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();

View File

@ -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");

View File

@ -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

View File

@ -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>

View File

@ -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();