diff --git a/app/app.pri b/app/app.pri
index a46444a..c5b9d04 100644
--- a/app/app.pri
+++ b/app/app.pri
@@ -6,6 +6,7 @@ LANGUAGE = C++
 CONFIG += qt warn_on thread
 QT += core gui
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+greaterThan(QT_MAJOR_VERSION, 6): QT += core5compat pdf
 
 DEFINES += QT_STL QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_BYTEARRAY QT_STRICT_ITERATORS QT_NO_URL_CAST_FROM_STRING QT_NO_KEYWORDS
 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050200
diff --git a/common/tikzpreview.cpp b/common/tikzpreview.cpp
index 6566779..de871f9 100644
--- a/common/tikzpreview.cpp
+++ b/common/tikzpreview.cpp
@@ -18,7 +18,9 @@
 
 #include "tikzpreview.h"
 
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+#include <QtPdf/QtPdf>
+#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #include <poppler-qt5.h>
 #else
 #include <poppler-qt4.h>
@@ -26,7 +28,7 @@
 
 #include <QSettings>
 #include <QApplication>
-#include <QDesktopWidget>
+//#include <QDesktopWidget>
 #include <QGraphicsProxyWidget>
 #include <QMenu>
 #include <QScrollBar>
diff --git a/common/tikzpreviewgenerator.cpp b/common/tikzpreviewgenerator.cpp
index 5c0d39e..da600fa 100644
--- a/common/tikzpreviewgenerator.cpp
+++ b/common/tikzpreviewgenerator.cpp
@@ -33,7 +33,11 @@
 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #include <QtCore/QStandardPaths>
 #include <QtWidgets/QPlainTextEdit>
+#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+#include <QtPdf/QtPdf>
+#else
 #include <poppler-qt5.h>
+#endif
 #else
 #include <QtGui/QPlainTextEdit>
 #include <poppler-qt4.h>
diff --git a/common/tikzpreviewmessagewidget.cpp b/common/tikzpreviewmessagewidget.cpp
index 2152f49..15556a0 100644
--- a/common/tikzpreviewmessagewidget.cpp
+++ b/common/tikzpreviewmessagewidget.cpp
@@ -63,7 +63,11 @@ TikzPreviewMessageWidget::TikzPreviewMessageWidget(QWidget *parent)
 	)));
 
 	QHBoxLayout *infoLayout = new QHBoxLayout(this);
-	infoLayout->setMargin(10);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    infoLayout->setContentsMargins(10, 10 ,10, 10);
+#else
+    infoLayout->setMargin(10);
+#endif
 	infoLayout->addWidget(m_infoPixmapLabel);
 	infoLayout->addWidget(m_infoLabel);
 
diff --git a/common/tikzpreviewrenderer.cpp b/common/tikzpreviewrenderer.cpp
index c794226..f8b88c1 100644
--- a/common/tikzpreviewrenderer.cpp
+++ b/common/tikzpreviewrenderer.cpp
@@ -19,7 +19,9 @@
 #include "tikzpreviewrenderer.h"
 
 #include <QtGui/QImage>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+#include <QtPdf/QtPdf>
+#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #include <poppler-qt5.h>
 #else
 #include <poppler-qt4.h>
diff --git a/common/tikzpreviewrenderer.h b/common/tikzpreviewrenderer.h
index 62a19b7..33f411e 100644
--- a/common/tikzpreviewrenderer.h
+++ b/common/tikzpreviewrenderer.h
@@ -23,10 +23,14 @@
 
 class QImage;
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+class QPdfDocument;
+#else
 namespace Poppler
 {
 class Document;
 }
+#endif
 
 class TikzPreviewRenderer : public QObject
 {
@@ -37,7 +41,11 @@ public:
 	~TikzPreviewRenderer();
 
 public Q_SLOTS:
+#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+    void generatePreview(QPdfDocument *tikzPdfDoc, qreal zoomFactor = 1.0, int currentPage = 0);
+#else
 	void generatePreview(Poppler::Document *tikzPdfDoc, qreal zoomFactor = 1.0, int currentPage = 0);
+#endif
 
 Q_SIGNALS:
 	void showPreview(const QImage &image, qreal zoomFactor = 1.0);
diff --git a/common/utils/file.h b/common/utils/file.h
index 75db572..625e293 100644
--- a/common/utils/file.h
+++ b/common/utils/file.h
@@ -101,7 +101,7 @@ public:
 	File(const QUrl &url, const OpenMode &mode);
 	~File();
 
-	bool open(const QFile::OpenMode &mode = 0);
+    bool open(const QFile::OpenMode &mode = QFile::OpenModeFlag::NotOpen);
 	bool close();
 	QFile *file();
 	QString errorString() const;
diff --git a/common/utils/pagedialog.cpp b/common/utils/pagedialog.cpp
index 4dfc110..897997d 100644
--- a/common/utils/pagedialog.cpp
+++ b/common/utils/pagedialog.cpp
@@ -98,8 +98,12 @@ QWidget *PageDialog::centerWidget()
 	m_pagesTitleLabel->setStyleSheet(QLatin1String("QLabel { font-weight: bold; }"));
 	QGridLayout *titleLayout = new QGridLayout(titleFrame);
 	titleLayout->setColumnStretch(0, 1);
-	titleLayout->setMargin(6);
-	titleLayout->addWidget(m_pagesTitleLabel);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    titleLayout->setContentsMargins(6, 6, 6, 6);
+#else
+    titleLayout->setMargin(6);
+#endif
+    titleLayout->addWidget(m_pagesTitleLabel);
 
 	// add pages
 	m_pagesStackedWidget = new QStackedWidget;
diff --git a/common/utils/toggleaction.h b/common/utils/toggleaction.h
index 50e213d..3c2d450 100644
--- a/common/utils/toggleaction.h
+++ b/common/utils/toggleaction.h
@@ -35,7 +35,9 @@ public:
 };
 #else
 #include <QtCore/QtGlobal>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+#include <QAction>
+#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #include <QtWidgets/QAction>
 #else
 #include <QtGui/QAction>
diff --git a/common/utils/urlcompletion.h b/common/utils/urlcompletion.h
index b45cb90..052f9e8 100644
--- a/common/utils/urlcompletion.h
+++ b/common/utils/urlcompletion.h
@@ -31,7 +31,10 @@ public:
 	}
 };
 #else
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+#include <QtWidgets/QCompleter>
+#include <QFileSystemModel>
+#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #include <QtWidgets/QCompleter>
 #include <QtWidgets/QFileSystemModel>
 #else
diff --git a/common/utils/zoomaction.cpp b/common/utils/zoomaction.cpp
index 4b0835a..9def4ed 100644
--- a/common/utils/zoomaction.cpp
+++ b/common/utils/zoomaction.cpp
@@ -18,6 +18,7 @@
 
 #include "zoomaction.h"
 
+#include <QRegularExpression>
 #include "globallocale.h"
 #include "icon.h"
 
@@ -141,5 +142,5 @@ void ZoomAction::setZoomFactor(qreal zoomFactor)
 
 void ZoomAction::setZoomFactor(const QString &zoomFactorText)
 {
-	setZoomFactor(GlobalLocale::readNumber(QString(zoomFactorText).remove(QRegExp(QString(QLatin1String("[^\\d\\%1]*")).arg(GlobalLocale::decimalSymbol())))) / 100.0);
+    setZoomFactor(GlobalLocale::readNumber(QString(zoomFactorText).remove(QRegularExpression(QString(QLatin1String("[^\\d\\%1]*")).arg(GlobalLocale::decimalSymbol())))) / 100.0);
 }
