From f6f8b6334dac49127a6b9bc1da055f63aa2d4c4d Mon Sep 17 00:00:00 2001 From: Nimrod Gavish Date: Fri, 10 Oct 2025 16:42:28 +0200 Subject: [PATCH 1/3] add Qt6 compatibility --- InstantPrintPlugin.py | 10 +-- InstantPrintTool.py | 154 +++++++++++++++++++++--------------------- metadata.txt | 1 + pyqgis.cmd | 4 +- pyrcc5.txt | 1 - pyrcc6.txt | 1 + resources.qrc | 5 -- resources_rc.py | 113 ------------------------------- ui/ui_printdialog.py | 84 ----------------------- 9 files changed, 87 insertions(+), 286 deletions(-) delete mode 100644 pyrcc5.txt create mode 100644 pyrcc6.txt delete mode 100644 resources.qrc delete mode 100644 resources_rc.py delete mode 100644 ui/ui_printdialog.py diff --git a/InstantPrintPlugin.py b/InstantPrintPlugin.py index dda504d..11fe3be 100644 --- a/InstantPrintPlugin.py +++ b/InstantPrintPlugin.py @@ -9,13 +9,12 @@ # email : smani@sourcepole.ch from qgis.core import Qgis -from PyQt5.QtCore import QObject, QSettings, QTranslator, QCoreApplication -from PyQt5.QtGui import QIcon -from PyQt5.QtWidgets import QToolButton +from qgis.PyQt.QtCore import QObject, QSettings, QTranslator, QCoreApplication +from qgis.PyQt.QtGui import QIcon +from qgis.PyQt.QtWidgets import QToolButton from qgis.gui import QgisInterface import os from .InstantPrintTool import InstantPrintTool -from . import resources_rc class InstantPrintPlugin(QObject): @@ -40,7 +39,8 @@ def __init__(self, iface): def initGui(self): self.toolButton = QToolButton(self.iface.mapNavToolToolBar()) - self.toolButton.setIcon(QIcon(":/plugins/instantprint/icons/icon.png")) + icon_path = os.path.join(self.pluginDir, "icons", "icon.png") + self.toolButton.setIcon(QIcon(icon_path)) self.toolButton.setText(self.tr("Instant Print")) self.toolButton.setToolTip(self.tr("Instant Print")) self.toolButton.setCheckable(True) diff --git a/InstantPrintTool.py b/InstantPrintTool.py index d158d45..4dfa460 100644 --- a/InstantPrintTool.py +++ b/InstantPrintTool.py @@ -8,14 +8,14 @@ # copyright : (C) 2014-2015 by Sandro Mani / Sourcepole AG # email : smani@sourcepole.ch -from PyQt5.QtCore import Qt, QSettings, QPointF, QRectF, QRect, QUrl, pyqtSignal, QLocale -from PyQt5.QtGui import QColor, QDesktopServices, QIcon -from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QMessageBox, QFileDialog -from PyQt5.QtPrintSupport import QPrintDialog, QPrinter +from qgis.PyQt.QtCore import Qt, QSettings, QPointF, QRectF, QRect, QUrl, pyqtSignal, QLocale +from qgis.PyQt.QtGui import QColor, QDesktopServices, QIcon +from qgis.PyQt.QtWidgets import QDialog, QDialogButtonBox, QMessageBox, QFileDialog +from qgis.PyQt.QtPrintSupport import QPrintDialog, QPrinter +from qgis.PyQt import uic from qgis.core import QgsRectangle, QgsLayoutManager, QgsPointXY as QgsPoint, Qgis, QgsProject, QgsWkbTypes, QgsLayoutExporter, PROJECT_SCALES, QgsLayoutItemMap from qgis.gui import QgisInterface, QgsMapTool, QgsRubberBand import os -from .ui.ui_printdialog import Ui_InstantPrintDialog class InstantPrintDialog(QDialog): @@ -29,7 +29,7 @@ def hideEvent(self, ev): self.hidden.emit() def keyPressEvent(self, e): - if e.key() == Qt.Key_Escape: + if e.key() == Qt.Key.Key_Escape: self.hidden.emit() @@ -49,31 +49,33 @@ def __init__(self, iface, populateCompositionFz=None): self.populateCompositionFz = populateCompositionFz self.dialog = InstantPrintDialog(self.iface.mainWindow()) - self.dialogui = Ui_InstantPrintDialog() - self.dialogui.setupUi(self.dialog) - self.dialogui.addScale.setIcon(QIcon(":/images/themes/default/mActionAdd.svg")) - self.dialogui.deleteScale.setIcon(QIcon(":/images/themes/default/symbologyRemove.svg")) + # Load UI file at runtime + plugin_dir = os.path.dirname(__file__) + ui_file = os.path.join(plugin_dir, 'ui', 'printdialog.ui') + uic.loadUi(ui_file, self.dialog) + self.dialog.addScale.setIcon(QIcon(":/images/themes/default/mActionAdd.svg")) + self.dialog.deleteScale.setIcon(QIcon(":/images/themes/default/symbologyRemove.svg")) self.dialog.hidden.connect(self.__onDialogHidden) - self.exportButton = self.dialogui.buttonBox.addButton(self.tr("Export"), QDialogButtonBox.ActionRole) - self.printButton = self.dialogui.buttonBox.addButton(self.tr("Print"), QDialogButtonBox.ActionRole) - self.helpButton = self.dialogui.buttonBox.addButton(self.tr("Help"), QDialogButtonBox.HelpRole) - self.dialogui.comboBox_fileformat.addItem("PDF", self.tr("PDF Document (*.pdf);;")) - self.dialogui.comboBox_fileformat.addItem("JPG", self.tr("JPG Image (*.jpg);;")) - self.dialogui.comboBox_fileformat.addItem("BMP", self.tr("BMP Image (*.bmp);;")) - self.dialogui.comboBox_fileformat.addItem("PNG", self.tr("PNG Image (*.png);;")) + self.exportButton = self.dialog.buttonBox.addButton(self.tr("Export"), QDialogButtonBox.ButtonRole.ActionRole) + self.printButton = self.dialog.buttonBox.addButton(self.tr("Print"), QDialogButtonBox.ButtonRole.ActionRole) + self.helpButton = self.dialog.buttonBox.addButton(self.tr("Help"), QDialogButtonBox.ButtonRole.HelpRole) + self.dialog.comboBox_fileformat.addItem("PDF", self.tr("PDF Document (*.pdf);;")) + self.dialog.comboBox_fileformat.addItem("JPG", self.tr("JPG Image (*.jpg);;")) + self.dialog.comboBox_fileformat.addItem("BMP", self.tr("BMP Image (*.bmp);;")) + self.dialog.comboBox_fileformat.addItem("PNG", self.tr("PNG Image (*.png);;")) self.iface.layoutDesignerOpened.connect(lambda view: self.__reloadLayouts()) self.iface.layoutDesignerWillBeClosed.connect(self.__reloadLayouts) - self.dialogui.comboBox_layouts.currentIndexChanged.connect(self.__selectLayout) - self.dialogui.comboBox_scale.lineEdit().textChanged.connect(self.__changeScale) - self.dialogui.comboBox_scale.scaleChanged.connect(self.__changeScale) + self.dialog.comboBox_layouts.currentIndexChanged.connect(self.__selectLayout) + self.dialog.comboBox_scale.lineEdit().textChanged.connect(self.__changeScale) + self.dialog.comboBox_scale.scaleChanged.connect(self.__changeScale) self.exportButton.clicked.connect(self.__export) self.printButton.clicked.connect(self.__print) self.helpButton.clicked.connect(self.__help) - self.dialogui.buttonBox.button(QDialogButtonBox.Close).clicked.connect(lambda: self.dialog.hide()) - self.dialogui.addScale.clicked.connect(self.add_new_scale) - self.dialogui.deleteScale.clicked.connect(self.remove_scale) + self.dialog.buttonBox.button(QDialogButtonBox.StandardButton.Close).clicked.connect(lambda: self.dialog.hide()) + self.dialog.addScale.clicked.connect(self.add_new_scale) + self.dialog.deleteScale.clicked.connect(self.remove_scale) self.deactivated.connect(self.__cleanup) - self.setCursor(Qt.OpenHandCursor) + self.setCursor(Qt.CursorShape.OpenHandCursor) settings = QSettings() if settings.value("instantprint/geometry") is not None: @@ -89,23 +91,23 @@ def __onDialogHidden(self): self.iface.mapCanvas().unsetMapTool(self) QSettings().setValue("instantprint/geometry", self.dialog.saveGeometry()) list = [] - for i in range(self.dialogui.comboBox_scale.count()): - list.append(self.dialogui.comboBox_scale.itemText(i)) + for i in range(self.dialog.comboBox_scale.count()): + list.append(self.dialog.comboBox_scale.itemText(i)) QSettings().setValue("instantprint/scales", ";".join(list)) def retrieve_scales(self, checkScale): - if self.dialogui.comboBox_scale.findText(checkScale) == -1: - self.dialogui.comboBox_scale.addItem(checkScale) + if self.dialog.comboBox_scale.findText(checkScale) == -1: + self.dialog.comboBox_scale.addItem(checkScale) def add_new_scale(self): - new_layout = self.dialogui.comboBox_scale.currentText() - if self.dialogui.comboBox_scale.findText(new_layout) == -1: - self.dialogui.comboBox_scale.addItem(new_layout) + new_layout = self.dialog.comboBox_scale.currentText() + if self.dialog.comboBox_scale.findText(new_layout) == -1: + self.dialog.comboBox_scale.addItem(new_layout) self.check_scales() def remove_scale(self): - layout_to_delete = self.dialogui.comboBox_scale.currentIndex() - self.dialogui.comboBox_scale.removeItem(layout_to_delete) + layout_to_delete = self.dialog.comboBox_scale.currentIndex() + self.dialog.comboBox_scale.removeItem(layout_to_delete) self.check_scales() def setEnabled(self, enabled): @@ -120,7 +122,7 @@ def setEnabled(self, enabled): def __changeScale(self): if not self.mapitem: return - newscale = self.dialogui.comboBox_scale.scale() + newscale = self.dialog.comboBox_scale.scale() if abs(newscale) < 1E-6: return extent = self.mapitem.extent() @@ -138,13 +140,13 @@ def __changeScale(self): def __selectLayout(self): if not self.dialog.isVisible(): return - activeIndex = self.dialogui.comboBox_layouts.currentIndex() + activeIndex = self.dialog.comboBox_layouts.currentIndex() if activeIndex < 0: return - layoutView = self.dialogui.comboBox_layouts.itemData(activeIndex) + layoutView = self.dialog.comboBox_layouts.itemData(activeIndex) maps = [] - layout_name = self.dialogui.comboBox_layouts.currentText() + layout_name = self.dialog.comboBox_layouts.currentText() layout = self.projectLayoutManager.layoutByName(layout_name) for item in layoutView.items(): if isinstance(item, QgsLayoutItemMap): @@ -154,15 +156,15 @@ def __selectLayout(self): self.exportButton.setEnabled(False) self.iface.mapCanvas().scene().removeItem(self.rubberband) self.rubberband = None - self.dialogui.comboBox_scale.setEnabled(False) + self.dialog.comboBox_scale.setEnabled(False) return - self.dialogui.comboBox_scale.setEnabled(True) + self.dialog.comboBox_scale.setEnabled(True) self.exportButton.setEnabled(True) self.layoutView = layoutView self.mapitem = layout.referenceMap() - self.dialogui.comboBox_scale.setScale(self.mapitem.scale()) + self.dialog.comboBox_scale.setScale(self.mapitem.scale()) self.__createRubberBand() def __createRubberBand(self): @@ -172,7 +174,7 @@ def __createRubberBand(self): self.corner = QPointF(center.x() - 0.5 * extent.width(), center.y() - 0.5 * extent.height()) self.rect = QRectF(self.corner.x(), self.corner.y(), extent.width(), extent.height()) self.mapitem.setExtent(QgsRectangle(self.rect)) - self.rubberband = QgsRubberBand(self.iface.mapCanvas(), QgsWkbTypes.PolygonGeometry) + self.rubberband = QgsRubberBand(self.iface.mapCanvas(), QgsWkbTypes.GeometryType.PolygonGeometry) self.rubberband.setToCanvasRectangle(self.__canvasRect(self.rect)) self.rubberband.setColor(QColor(127, 127, 255, 127)) @@ -191,13 +193,13 @@ def canvasPressEvent(self, e): if not self.rubberband: return r = self.__canvasRect(self.rect) - if e.button() == Qt.LeftButton and self.__canvasRect(self.rect).contains(e.pos()): + if e.button() == Qt.MouseButton.LeftButton and self.__canvasRect(self.rect).contains(e.pos()): self.oldrect = QRectF(self.rect) - self.oldrubberband = QgsRubberBand(self.iface.mapCanvas(), QgsWkbTypes.PolygonGeometry) + self.oldrubberband = QgsRubberBand(self.iface.mapCanvas(), QgsWkbTypes.GeometryType.PolygonGeometry) self.oldrubberband.setToCanvasRectangle(self.__canvasRect(self.oldrect)) self.oldrubberband.setColor(QColor(127, 127, 255, 31)) self.pressPos = (e.x(), e.y()) - self.iface.mapCanvas().setCursor(Qt.ClosedHandCursor) + self.iface.mapCanvas().setCursor(Qt.CursorShape.ClosedHandCursor) def canvasMoveEvent(self, e): if not self.pressPos: @@ -235,10 +237,10 @@ def canvasMoveEvent(self, e): self.rubberband.setToCanvasRectangle(self.__canvasRect(self.rect)) def canvasReleaseEvent(self, e): - if e.button() == Qt.LeftButton and self.pressPos: + if e.button() == Qt.MouseButton.LeftButton and self.pressPos: self.corner = QPointF(self.rect.x(), self.rect.y()) self.pressPos = None - self.iface.mapCanvas().setCursor(Qt.OpenHandCursor) + self.iface.mapCanvas().setCursor(Qt.CursorShape.OpenHandCursor) self.iface.mapCanvas().scene().removeItem(self.oldrubberband) self.oldrect = None self.oldrubberband = None @@ -252,7 +254,7 @@ def __canvasRect(self, rect): def __export(self): settings = QSettings() - format = self.dialogui.comboBox_fileformat.itemData(self.dialogui.comboBox_fileformat.currentIndex()) + format = self.dialog.comboBox_fileformat.itemData(self.dialog.comboBox_fileformat.currentIndex()) filepath = QFileDialog.getSaveFileName( self.iface.mainWindow(), self.tr("Export Layout"), @@ -263,14 +265,14 @@ def __export(self): return # Ensure output filename has correct extension - filename = os.path.splitext(filepath[0])[0] + "." + self.dialogui.comboBox_fileformat.currentText().lower() + filename = os.path.splitext(filepath[0])[0] + "." + self.dialog.comboBox_fileformat.currentText().lower() settings.setValue("/instantprint/lastfile", filepath[0]) if self.populateCompositionFz: self.populateCompositionFz(self.layoutView.composition()) success = False - layout_name = self.dialogui.comboBox_layouts.currentText() + layout_name = self.dialog.comboBox_layouts.currentText() layout_item = self.projectLayoutManager.layoutByName(layout_name) layout_item.refresh() exporter = QgsLayoutExporter(layout_item) @@ -282,13 +284,13 @@ def __export(self): QMessageBox.warning(self.iface.mainWindow(), self.tr("Export Failed"), self.tr("Failed to export the layout.")) def __print(self): - layout_name = self.dialogui.comboBox_layouts.currentText() + layout_name = self.dialog.comboBox_layouts.currentText() layout_item = self.projectLayoutManager.layoutByName(layout_name) layout_item.refresh() actual_printer = QgsLayoutExporter(layout_item) printdialog = QPrintDialog(self.printer) - if printdialog.exec_() != QDialog.Accepted: + if printdialog.exec() != QDialog.DialogCode.Accepted: return success = actual_printer.print(self.printer, QgsLayoutExporter.PrintExportSettings()) @@ -301,27 +303,27 @@ def __reloadLayouts(self, removed=None): # Make it less likely to hit the issue outlined in https://github.com/qgis/QGIS/pull/1938 return - self.dialogui.comboBox_layouts.blockSignals(True) + self.dialog.comboBox_layouts.blockSignals(True) prev = None - if self.dialogui.comboBox_layouts.currentIndex() >= 0: - prev = self.dialogui.comboBox_layouts.currentText() - self.dialogui.comboBox_layouts.clear() + if self.dialog.comboBox_layouts.currentIndex() >= 0: + prev = self.dialog.comboBox_layouts.currentText() + self.dialog.comboBox_layouts.clear() active = 0 for layout in self.projectLayoutManager.layouts(): if layout != removed and layout.name(): cur = layout.name() - self.dialogui.comboBox_layouts.addItem(cur, layout) + self.dialog.comboBox_layouts.addItem(cur, layout) if prev == cur: - active = self.dialogui.comboBox_layouts.count() - 1 - self.dialogui.comboBox_layouts.setCurrentIndex(-1) # Ensure setCurrentIndex below actually changes an index - self.dialogui.comboBox_layouts.blockSignals(False) - if self.dialogui.comboBox_layouts.count() > 0: - self.dialogui.comboBox_layouts.setCurrentIndex(active) - self.dialogui.comboBox_scale.setEnabled(True) + active = self.dialog.comboBox_layouts.count() - 1 + self.dialog.comboBox_layouts.setCurrentIndex(-1) # Ensure setCurrentIndex below actually changes an index + self.dialog.comboBox_layouts.blockSignals(False) + if self.dialog.comboBox_layouts.count() > 0: + self.dialog.comboBox_layouts.setCurrentIndex(active) + self.dialog.comboBox_scale.setEnabled(True) self.exportButton.setEnabled(True) else: self.exportButton.setEnabled(False) - self.dialogui.comboBox_scale.setEnabled(False) + self.dialog.comboBox_scale.setEnabled(False) def __help(self): manualPath = os.path.join(os.path.dirname(__file__), "help", "documentation.pdf") @@ -342,25 +344,25 @@ def check_scales(self): predefScalesStr = QSettings().value("Map/scales", PROJECT_SCALES).split(",") predefScales = [self.scaleFromString(scaleString) for scaleString in predefScalesStr] - comboScalesStr = [self.dialogui.comboBox_scale.itemText(i) for i in range(self.dialogui.comboBox_scale.count())] + comboScalesStr = [self.dialog.comboBox_scale.itemText(i) for i in range(self.dialog.comboBox_scale.count())] comboScales = [self.scaleFromString(scaleString) for scaleString in comboScalesStr] - currentScale = self.scaleFromString(self.dialogui.comboBox_scale.currentText()) + currentScale = self.scaleFromString(self.dialog.comboBox_scale.currentText()) if not currentScale: - self.dialogui.comboBox_scale.lineEdit().setStyleSheet("background: #FF7777; color: #FFFFFF;") - self.dialogui.addScale.setVisible(True) - self.dialogui.addScale.setEnabled(False) - self.dialogui.deleteScale.setVisible(False) + self.dialog.comboBox_scale.lineEdit().setStyleSheet("background: #FF7777; color: #FFFFFF;") + self.dialog.addScale.setVisible(True) + self.dialog.addScale.setEnabled(False) + self.dialog.deleteScale.setVisible(False) else: - self.dialogui.comboBox_scale.lineEdit().setStyleSheet("") + self.dialog.comboBox_scale.lineEdit().setStyleSheet("") if currentScale in comboScales: # If entry scale is already in the list, allow removing it unless it is a predefined scale - self.dialogui.addScale.setVisible(False) - self.dialogui.deleteScale.setVisible(True) - self.dialogui.deleteScale.setEnabled(currentScale not in predefScales) + self.dialog.addScale.setVisible(False) + self.dialog.deleteScale.setVisible(True) + self.dialog.deleteScale.setEnabled(currentScale not in predefScales) else: # Otherwise, show button to add it - self.dialogui.addScale.setVisible(True) - self.dialogui.addScale.setEnabled(True) - self.dialogui.deleteScale.setVisible(False) + self.dialog.addScale.setVisible(True) + self.dialog.addScale.setEnabled(True) + self.dialog.deleteScale.setVisible(False) diff --git a/metadata.txt b/metadata.txt index eb95fef..b8e1878 100644 --- a/metadata.txt +++ b/metadata.txt @@ -12,6 +12,7 @@ name=Instant Print qgisMinimumVersion=3.0 qgisMaximumVersion=3.99 +supportsQt6=True description=Instantly print map excerpts about=The instant print plugin allows to quickly print map excerpts to a file, utilizing an existing composer as page layout. version=3.0.1 diff --git a/pyqgis.cmd b/pyqgis.cmd index 4b5b295..129ef2d 100644 --- a/pyqgis.cmd +++ b/pyqgis.cmd @@ -5,9 +5,9 @@ call "%QGIS_ROOT%"\apps\grass\grass78\etc\env.bat @echo off path %PATH%;%QGIS_ROOT%\apps\qgis\bin path %PATH%;%QGIS_ROOT%\apps\grass\grass78\lib -path %PATH%;%QGIS_ROOT%\apps\Qt5\bin +path %PATH%;%QGIS_ROOT%\apps\Qt6\bin path %PATH%;%QGIS_ROOT%\apps\Python39\Scripts set PYTHONPATH=%PYTHONPATH%;%QGIS_ROOT%\apps\qgis-ltr\python set PYTHONHOME=%QGIS_ROOT%\apps\Python39 cmd.exe -pyrcc5 -o resources.py resources.qrc \ No newline at end of file +pyside6-rcc -o resources.py resources.qrc diff --git a/pyrcc5.txt b/pyrcc5.txt deleted file mode 100644 index 8fd88ee..0000000 --- a/pyrcc5.txt +++ /dev/null @@ -1 +0,0 @@ -pyrcc5 -o resources_rc.py resources.qrc \ No newline at end of file diff --git a/pyrcc6.txt b/pyrcc6.txt new file mode 100644 index 0000000..527bfea --- /dev/null +++ b/pyrcc6.txt @@ -0,0 +1 @@ +pyside6-rcc -o resources_rc.py resources.qrc \ No newline at end of file diff --git a/resources.qrc b/resources.qrc deleted file mode 100644 index 0b326c0..0000000 --- a/resources.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - icons/icon.png - - diff --git a/resources_rc.py b/resources_rc.py deleted file mode 100644 index 30cb5a1..0000000 --- a/resources_rc.py +++ /dev/null @@ -1,113 +0,0 @@ -# -*- coding: utf-8 -*- - -# Resource object code -# -# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2) -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore - -qt_resource_data = b"\ -\x00\x00\x02\xa1\ -\x89\ -\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ -\x00\x00\x18\x00\x00\x00\x18\x08\x06\x00\x00\x00\xe0\x77\x3d\xf8\ -\x00\x00\x00\x06\x62\x4b\x47\x44\x00\x5e\x00\x5e\x00\x5e\x94\x91\ -\xb5\x9c\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\ -\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\ -\xdf\x02\x1a\x0c\x38\x1d\x17\x5b\xc9\x87\x00\x00\x02\x2e\x49\x44\ -\x41\x54\x48\xc7\xad\x95\x4f\x68\x13\x41\x14\x87\xbf\xcd\xae\x26\ -\x34\xb4\x12\x68\x93\xb4\xc6\x7a\xc8\x21\x39\x94\xb4\x8a\x01\x0f\ -\xe2\xc1\x8b\xc6\x8b\xf4\x56\xf0\x16\x21\x50\xf1\xe6\x41\x2f\x22\ -\x4a\xc1\x53\x11\x2f\x1b\x48\x41\x28\x52\x10\x0f\x82\xa0\x20\x8b\ -\x8a\x77\x21\x4a\xa0\xda\x48\x40\x91\x4a\x36\xd2\x10\x89\x22\x6a\ -\x36\x1d\x0f\xf9\x43\x36\x35\xb3\xdb\x36\x0f\x06\x66\xdf\xcc\xfc\ -\xbe\x99\x37\x6f\xdf\x28\x42\x08\xf6\x6d\x45\x45\x21\xf6\x1f\xa1\ -\xa2\xa2\x28\x43\x01\xb4\xc4\xfa\x85\x9e\x13\x13\x29\x4d\xb6\x26\ -\xb7\xb2\x62\x36\x2d\x2b\x24\x9b\xa3\x6a\x5a\x25\x73\x3a\x73\xa3\ -\xcf\x5d\x27\x26\x52\x00\x52\x40\xd3\xb2\x42\x99\xc5\x45\xe9\xc6\ -\x73\xd9\x6c\x08\xb8\xd2\xe7\x3e\xd9\xe9\x78\xf6\x1b\x99\x51\x5f\ -\x15\x20\xd1\xe3\xba\x46\x4c\x7c\x18\x1a\x60\x26\xf2\xba\xdf\xe5\ -\xa1\xa8\xdc\xa4\xa8\x5c\x70\x0c\x91\x1b\x4b\x1c\x79\xd5\xef\xba\ -\x03\x54\x81\x88\x0d\x90\xca\x5c\x3f\x3b\x15\x9c\x58\x3d\xa0\xa9\ -\x21\x94\x96\x6f\x36\xe8\x95\x8a\x2b\xf5\x87\x78\xda\xc9\x23\x04\ -\x28\xed\x75\x57\xd7\xe6\x2f\x2f\xdf\x7e\xfc\xdb\x06\x98\x0a\x4e\ -\xac\x9e\x38\x96\x08\x05\x02\x81\xae\x40\xad\xf8\x46\x0a\x10\x63\ -\x0b\x64\xd7\x6a\x04\x62\x49\x16\x0e\x27\x01\x58\x7a\x79\x8b\xfc\ -\xe7\xef\xcb\xc0\x23\x1b\xc0\xa3\x60\x13\x07\xd0\xbc\x3e\x72\xd9\ -\xac\x14\xa2\x79\x7d\xcc\x8d\xdd\x05\xe0\x45\x79\x09\xe1\x9f\xc3\ -\x6a\x1a\x91\xee\x78\xa7\xf3\xf5\xdb\x16\x7f\x1b\x16\x9a\xaa\xd2\ -\x09\x91\xff\xe8\x8c\xab\x7b\x88\x8f\xa6\x79\x57\xbb\xc4\x5b\x33\ -\x09\x34\xec\x1b\xe8\x74\x7e\xfc\xfc\xc5\x97\x4a\x95\x83\xda\xee\ -\xee\x7d\x76\xfc\x19\xc5\xda\x29\x9e\x7e\x9c\x47\x88\xc6\xce\x13\ -\xda\x62\x2a\xe0\x4f\xc3\x02\xa0\xbc\x91\x77\x05\x38\x77\xc6\xe0\ -\xde\x93\x8b\x4c\xc6\x07\x84\x70\xd0\xc2\xf2\x46\x9e\x68\x34\x2a\ -\x15\x3f\xe4\xaf\xf3\xc0\x38\x4f\xb9\x94\x67\x32\x7e\x7c\x77\x00\ -\xc0\x11\x00\x30\x0e\x94\x4a\x9f\x06\x8e\x7b\x1c\x0a\x99\x23\xc0\ -\x69\x4e\x77\x54\x53\xd5\x4d\xd3\x34\x23\xe1\x70\xb8\xb7\xd8\xe1\ -\xa2\xd8\xd9\xbe\x4d\xd3\x44\x53\xd5\xcd\x1d\x00\x21\xb6\xd3\xef\ -\xd7\xd7\xef\x17\x0a\x85\x56\x0e\x8f\x4c\x0f\x14\xe9\x58\x07\xbe\ -\x35\x32\x8d\x61\x18\xdd\x8d\x0a\xb1\x9d\xee\xc9\x1c\x31\xb0\xe9\ -\xba\x2e\x2c\x21\xa4\x4d\xd7\x75\x21\xd3\x70\x95\xf4\x4e\x27\x70\ -\x75\x07\x32\x73\x23\xb4\x27\x80\xaa\x69\x95\xf6\x8b\x25\x9d\x23\ -\xad\xb8\x43\x7b\xf4\xf7\xf2\x1f\x0c\xc3\xfe\x01\x58\x1f\xf8\x21\ -\xab\x0f\x26\x08\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ -\ -" - -qt_resource_name = b"\ -\x00\x07\ -\x07\x3b\xe0\xb3\ -\x00\x70\ -\x00\x6c\x00\x75\x00\x67\x00\x69\x00\x6e\x00\x73\ -\x00\x0c\ -\x0b\xbc\xdd\x54\ -\x00\x69\ -\x00\x6e\x00\x73\x00\x74\x00\x61\x00\x6e\x00\x74\x00\x70\x00\x72\x00\x69\x00\x6e\x00\x74\ -\x00\x05\ -\x00\x6f\xa6\x53\ -\x00\x69\ -\x00\x63\x00\x6f\x00\x6e\x00\x73\ -\x00\x08\ -\x0a\x61\x5a\xa7\ -\x00\x69\ -\x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\ -" - -qt_resource_struct_v1 = b"\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ -\x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\ -\x00\x00\x00\x32\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\ -\x00\x00\x00\x42\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -" - -qt_resource_struct_v2 = b"\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x32\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x42\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x81\xce\x7c\xbe\x00\ -" - -qt_version = [int(v) for v in QtCore.qVersion().split('.')] -if qt_version < [5, 8, 0]: - rcc_version = 1 - qt_resource_struct = qt_resource_struct_v1 -else: - rcc_version = 2 - qt_resource_struct = qt_resource_struct_v2 - -def qInitResources(): - QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) - -def qCleanupResources(): - QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) - -qInitResources() diff --git a/ui/ui_printdialog.py b/ui/ui_printdialog.py deleted file mode 100644 index 4a5651a..0000000 --- a/ui/ui_printdialog.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui/printdialog.ui' -# -# Created by: PyQt5 UI code generator 5.9.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets -from qgis.PyQt.QtCore import QUrl, QCoreApplication, QTranslator, QSettings - -class Ui_InstantPrintDialog(object): - - def tr(self,string): - return QCoreApplication.translate('Ui_InstantPrintDialog', string) - - def setupUi(self, InstantPrintDialog): - InstantPrintDialog.setObjectName("InstantPrintDialog") - InstantPrintDialog.resize(357, 157) - icon = QtGui.QIcon.fromTheme("printer") - InstantPrintDialog.setWindowIcon(icon) - self.gridLayout = QtWidgets.QGridLayout(InstantPrintDialog) - self.gridLayout.setObjectName("gridLayout") - self.label_layout = QtWidgets.QLabel(InstantPrintDialog) - self.label_layout.setObjectName("label_layout") - self.gridLayout.addWidget(self.label_layout, 0, 0, 1, 1) - self.comboBox_layouts = QtWidgets.QComboBox(InstantPrintDialog) - self.comboBox_layouts.setEditable(False) - self.comboBox_layouts.setObjectName("comboBox_layouts") - self.gridLayout.addWidget(self.comboBox_layouts, 0, 1, 1, 1) - self.label = QtWidgets.QLabel(InstantPrintDialog) - self.label.setObjectName("label") - self.gridLayout.addWidget(self.label, 1, 0, 1, 1) - self.label_fileformat = QtWidgets.QLabel(InstantPrintDialog) - self.label_fileformat.setObjectName("label_fileformat") - self.gridLayout.addWidget(self.label_fileformat, 2, 0, 1, 1) - self.comboBox_fileformat = QtWidgets.QComboBox(InstantPrintDialog) - self.comboBox_fileformat.setObjectName("comboBox_fileformat") - self.gridLayout.addWidget(self.comboBox_fileformat, 2, 1, 1, 1) - self.buttonBox = QtWidgets.QDialogButtonBox(InstantPrintDialog) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) - self.buttonBox.setObjectName("buttonBox") - self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 2) - self.widget = QtWidgets.QWidget(InstantPrintDialog) - self.widget.setObjectName("widget") - self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget) - self.horizontalLayout.setContentsMargins(0, 0, 0, 0) - self.horizontalLayout.setSpacing(0) - self.horizontalLayout.setObjectName("horizontalLayout") - self.comboBox_scale = QgsScaleComboBox(self.widget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.comboBox_scale.sizePolicy().hasHeightForWidth()) - self.comboBox_scale.setSizePolicy(sizePolicy) - self.comboBox_scale.setEditable(True) - self.comboBox_scale.setObjectName("comboBox_scale") - self.horizontalLayout.addWidget(self.comboBox_scale) - self.deleteScale = QtWidgets.QToolButton(self.widget) - self.deleteScale.setEnabled(False) - self.deleteScale.setText("") - self.deleteScale.setObjectName("deleteScale") - self.horizontalLayout.addWidget(self.deleteScale) - self.addScale = QtWidgets.QToolButton(self.widget) - self.addScale.setEnabled(False) - self.addScale.setText("") - self.addScale.setObjectName("addScale") - self.horizontalLayout.addWidget(self.addScale) - self.gridLayout.addWidget(self.widget, 1, 1, 1, 1) - - self.retranslateUi(InstantPrintDialog) - self.buttonBox.accepted.connect(InstantPrintDialog.accept) - self.buttonBox.rejected.connect(InstantPrintDialog.reject) - QtCore.QMetaObject.connectSlotsByName(InstantPrintDialog) - - def retranslateUi(self, InstantPrintDialog): - _translate = QtCore.QCoreApplication.translate - InstantPrintDialog.setWindowTitle(self.tr("Instant Print")) - self.label_layout.setText(self.tr("Layout:")) - self.label.setText(self.tr("Scale:")) - self.label_fileformat.setText(self.tr("File format:")) - -from qgis.gui import QgsScaleComboBox From c3745b955a4560355fd3e79f3b716cedeabbc93e Mon Sep 17 00:00:00 2001 From: Nimrod Gavish Date: Thu, 16 Oct 2025 11:04:05 +0200 Subject: [PATCH 2/3] remove old resource system files --- pyqgis.cmd | 13 ------------- pyrcc6.txt | 1 - 2 files changed, 14 deletions(-) delete mode 100644 pyqgis.cmd delete mode 100644 pyrcc6.txt diff --git a/pyqgis.cmd b/pyqgis.cmd deleted file mode 100644 index 129ef2d..0000000 --- a/pyqgis.cmd +++ /dev/null @@ -1,13 +0,0 @@ -@echo off -SET QGIS_ROOT=C:\Program Files\QGIS 3.22.7 -call "%QGIS_ROOT%"\bin\o4w_env.bat -call "%QGIS_ROOT%"\apps\grass\grass78\etc\env.bat -@echo off -path %PATH%;%QGIS_ROOT%\apps\qgis\bin -path %PATH%;%QGIS_ROOT%\apps\grass\grass78\lib -path %PATH%;%QGIS_ROOT%\apps\Qt6\bin -path %PATH%;%QGIS_ROOT%\apps\Python39\Scripts -set PYTHONPATH=%PYTHONPATH%;%QGIS_ROOT%\apps\qgis-ltr\python -set PYTHONHOME=%QGIS_ROOT%\apps\Python39 -cmd.exe -pyside6-rcc -o resources.py resources.qrc diff --git a/pyrcc6.txt b/pyrcc6.txt deleted file mode 100644 index 527bfea..0000000 --- a/pyrcc6.txt +++ /dev/null @@ -1 +0,0 @@ -pyside6-rcc -o resources_rc.py resources.qrc \ No newline at end of file From 6fc0a7bb7fe600779eabc6c1d3f442e72aa3e322 Mon Sep 17 00:00:00 2001 From: Nimrod Gavish Date: Thu, 16 Oct 2025 11:04:27 +0200 Subject: [PATCH 3/3] update maximum qgis version --- metadata.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.txt b/metadata.txt index b8e1878..0d9383c 100644 --- a/metadata.txt +++ b/metadata.txt @@ -11,7 +11,7 @@ [general] name=Instant Print qgisMinimumVersion=3.0 -qgisMaximumVersion=3.99 +qgisMaximumVersion=4.99 supportsQt6=True description=Instantly print map excerpts about=The instant print plugin allows to quickly print map excerpts to a file, utilizing an existing composer as page layout.