Skip to content

Commit 424fc26

Browse files
authored
Merge pull request #95 from Septima/porting_to_qt6
Porting to qt6
2 parents db0dd61 + 646e61f commit 424fc26

File tree

16 files changed

+38
-37
lines changed

16 files changed

+38
-37
lines changed

src/QlrBrowser/core/filesystemmodel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def rootItemCreated(self, exception, result=None):
6161
except Exception as e:
6262
self.status = "error"
6363
self.updated.emit()
64-
QgsMessageLog.logMessage("Exception: {}".format(str(e)), "Qlr Browser", Qgis.Critical)
64+
QgsMessageLog.logMessage("Exception: {}".format(str(e)), "Qlr Browser", Qgis.MessageLevel.Critical)
6565

6666
def filter(self, filterString = ""):
6767
if filterString == "":
@@ -92,7 +92,7 @@ def filterItemCreated(self, exception, result, task_id):
9292
else:
9393
self.status = "error"
9494
self.updated.emit()
95-
QgsMessageLog.logMessage("Exception: {}".format(str(exception)), "Qlr Browser", Qgis.Critical)
95+
QgsMessageLog.logMessage("Exception: {}".format(str(exception)), "Qlr Browser", Qgis.MessageLevel.Critical)
9696

9797
def namingregex(self):
9898
if not self.settings.value("useSortDelimitChar"):
@@ -137,7 +137,7 @@ def __init__(self, file, recurse = True, recursion_counter = None, namingregex =
137137
if self.isdir and recurse:
138138
qdir = QDir(self.fullpath)
139139
for finfo in qdir.entryInfoList(
140-
FileSystemItem.fileExtensions , QDir.Files | QDir.AllDirs | QDir.NoDotAndDotDot,QDir.Name):
140+
FileSystemItem.fileExtensions , QDir.Filter.Files | QDir.Filter.AllDirs | QDir.Filter.NoDotAndDotDot,QDir.SortFlag.Name):
141141
self.children.append(FileSystemItem(finfo, recurse, recursion_counter, self.namingregex))
142142
else:
143143
# file
@@ -202,7 +202,7 @@ def get_searchable_content(self):
202202
Pulls out tags from the object and returns them in order to be used by the filtered() method.
203203
"""
204204
f = QFile(self.fileinfo.absoluteFilePath())
205-
f.open(QIODevice.ReadOnly)
205+
f.open(QIODevice.OpenModeFlag.ReadOnly)
206206
try:
207207
doc = QDomDocument()
208208
doc.setContent( f.readAll() )

src/QlrBrowser/core/qlrmanager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def log(self, message):
6464
QgsMessageLog.logMessage(
6565
'{}'.format(message),
6666
'QlrBrowser',
67-
Qgis.Info
67+
Qgis.MessageLevel.Info
6868
)
6969

7070

@@ -127,7 +127,7 @@ def browser_itemclicked(self, fileinfo, newState):
127127
pass
128128
else:
129129
message = self.tr(u"Adding qlr-file to the layer panel")
130-
self.iface.messageBar().pushMessage(self.tr('QlrBrowser'), message, level=Qgis.Info, duration=5)
130+
self.iface.messageBar().pushMessage(self.tr('QlrBrowser'), message, level=Qgis.MessageLevel.Info, duration=5)
131131

132132
# Force show messageBar
133133
QCoreApplication.processEvents()

src/QlrBrowser/metadata.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
[general]
1010
name=Qlr Browser
1111
qgisMinimumVersion=3.00
12-
qgisMaximumVersion=3.99
12+
qgisMaximumVersion=4.99
13+
supportsQt6=True
1314
description=This plugin lets the user browse and open qlr files
14-
version=3.0.0
15+
version=4.0.0
1516
author=Septima
1617
1718

@@ -28,7 +29,8 @@ repository=https://github.com/Septima/qgis-qlrbrowser
2829
# Recommended items:
2930

3031
# Uncomment the following line and add your changelog:
31-
changelog=2021-12-16 3.0.0 Async load filtering, fix display of groups
32+
changelog=2025-11-11 4.0.0 Updated to Qt6
33+
2021-12-16 3.0.0 Async load filtering, fix display of groups
3234
2020-01-23 2.1.0 Added german translation contributed by Stadtwerke München. Minor bug fixes.
3335
2018-07-25 2.0.1 Changed icon and ready for plugin repository
3436
2018-06-18 2.0.0 Upgrade to 3.nightly
@@ -41,7 +43,7 @@ changelog=2021-12-16 3.0.0 Async load filtering, fix display of groups
4143
2015-12-12 0.1.0 Initial version
4244

4345
# Tags are comma separated with spaces allowed
44-
tags=qlr browse browser data
46+
tags=qlr browse, browser, data, danmark, geodata
4547

4648
homepage=https://github.com/Septima/qgis-qlrbrowser
4749
category=Plugins

src/QlrBrowser/mysettings/options_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from qgis.gui import (QgsOptionsWidgetFactory)
33
from qgis.core import QgsApplication
4-
from PyQt5.QtGui import QIcon
4+
from qgis.PyQt.QtGui import QIcon
55
from .settings_dialog import ConfigOptionsPage
66

77
class OptionsFactory(QgsOptionsWidgetFactory):

src/QlrBrowser/mysettings/qgissettingmanager/setting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
#---------------------------------------------------------------------
2828

29-
from PyQt5.QtCore import QObject, pyqtSignal, QSettings
29+
from qgis.PyQt.QtCore import QObject, pyqtSignal, QSettings
3030
from qgis.core import QgsProject
3131

3232

src/QlrBrowser/mysettings/qgissettingmanager/setting_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
# ---------------------------------------------------------------------
2828

29-
from PyQt5.QtWidgets import QDialog, QWidget, QButtonGroup
29+
from qgis.PyQt.QtWidgets import QDialog, QWidget, QButtonGroup
3030

3131
from .setting_manager import Debug
3232

src/QlrBrowser/mysettings/qgissettingmanager/setting_widget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
#---------------------------------------------------------------------
2828

29-
from PyQt5.QtCore import pyqtSlot, QObject
29+
from qgis.PyQt.QtCore import pyqtSlot, QObject
3030

3131

3232
class SettingWidget(QObject):

src/QlrBrowser/mysettings/qgissettingmanager/types/bool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
#---------------------------------------------------------------------
2828

29-
from PyQt5.QtWidgets import QCheckBox
29+
from qgis.PyQt.QtWidgets import QCheckBox
3030
from qgis.core import QgsProject
3131
from ..setting import Setting
3232
from ..setting_widget import SettingWidget

src/QlrBrowser/mysettings/qgissettingmanager/types/color.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
# alpha: use or not alpha channel
3333

3434

35-
from PyQt5.QtGui import QColor
36-
from PyQt5.QtWidgets import QColorDialog
35+
from qgis.PyQt.QtGui import QColor
36+
from qgis.PyQt.QtWidgets import QColorDialog
3737
from qgis.core import QgsProject
3838
from qgis.gui import QgsColorButton
3939

@@ -80,7 +80,7 @@ def __init__(self, setting, widget, options):
8080
SettingWidget.__init__(self, setting, widget, options, signal)
8181

8282
if type(self.widget) == QgsColorButton:
83-
self.widget.setColorDialogOptions(QColorDialog.ShowAlphaChannel)
83+
self.widget.setColorDialogOptions(QColorDialog.ColorDialogOption.ShowAlphaChannel)
8484
else:
8585
self.widget.setAllowAlpha(self.options.get("allowAlpha", False))
8686

src/QlrBrowser/mysettings/qgissettingmanager/types/double.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
#---------------------------------------------------------------------
2828

29-
from PyQt5.QtWidgets import QLineEdit, QDoubleSpinBox
29+
from qgis.PyQt.QtWidgets import QLineEdit, QDoubleSpinBox
3030
from qgis.core import QgsProject
3131

3232
from ..setting import Setting

0 commit comments

Comments
 (0)