Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 ktikz (0.13.2+ds1-1) unstable; urgency=medium
 .
   * New upstream release.
   * Set upstream metadata fields: Bug-Database, Bug-Submit.
   * Fix day-of-week for changelog entry 0.10~svn112-1.
   * Update standards version to 4.6.0, no changes needed.
Author: Stuart Prescott <stuart@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2025-04-08

--- ktikz-0.13.2+ds1.orig/app/app.pri
+++ ktikz-0.13.2+ds1/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
--- ktikz-0.13.2+ds1.orig/common/tikzpreview.cpp
+++ ktikz-0.13.2+ds1/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>
--- ktikz-0.13.2+ds1.orig/common/tikzpreviewgenerator.cpp
+++ ktikz-0.13.2+ds1/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>
--- ktikz-0.13.2+ds1.orig/common/tikzpreviewmessagewidget.cpp
+++ ktikz-0.13.2+ds1/common/tikzpreviewmessagewidget.cpp
@@ -63,7 +63,11 @@ TikzPreviewMessageWidget::TikzPreviewMes
 	)));
 
 	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);
 
--- ktikz-0.13.2+ds1.orig/common/tikzpreviewrenderer.cpp
+++ ktikz-0.13.2+ds1/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>
--- ktikz-0.13.2+ds1.orig/common/tikzpreviewrenderer.h
+++ ktikz-0.13.2+ds1/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);
--- ktikz-0.13.2+ds1.orig/common/utils/file.h
+++ ktikz-0.13.2+ds1/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;
--- ktikz-0.13.2+ds1.orig/common/utils/pagedialog.cpp
+++ ktikz-0.13.2+ds1/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;
--- ktikz-0.13.2+ds1.orig/common/utils/toggleaction.h
+++ ktikz-0.13.2+ds1/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>
--- ktikz-0.13.2+ds1.orig/common/utils/urlcompletion.h
+++ ktikz-0.13.2+ds1/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
--- ktikz-0.13.2+ds1.orig/common/utils/zoomaction.cpp
+++ ktikz-0.13.2+ds1/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 zoo
 
 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);
 }
