Plugin PyQt5 and PyQt6 compatible & CenRa_Copie bug fix
This commit is contained in:
@@ -24,7 +24,10 @@ pyperclip()
|
||||
from .flux_editor import Flux_Editor
|
||||
from .about_form import AboutDialog
|
||||
|
||||
from PyQt5.QtCore import *
|
||||
try:
|
||||
from PyQt5.QtCore import *
|
||||
except:
|
||||
from PyQt6.QtCore import *
|
||||
|
||||
class PgFlux:
|
||||
def __init__(self):
|
||||
@@ -78,7 +81,7 @@ class PgFlux:
|
||||
About dialog
|
||||
"""
|
||||
dialog = AboutDialog(iface)
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
def open_help():
|
||||
""" Open the online help. """
|
||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||
|
||||
@@ -11,9 +11,15 @@ from qgis.PyQt.QtCore import QSettings
|
||||
from qgis.PyQt import QtWidgets
|
||||
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5 import QtGui
|
||||
try:
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5 import QtGui
|
||||
except:
|
||||
from PyQt6.QtCore import *
|
||||
from PyQt6.QtGui import *
|
||||
from PyQt6 import QtGui
|
||||
|
||||
from qgis.core import *
|
||||
from qgis.core import QgsDataSourceUri
|
||||
from qgis.PyQt.QtWidgets import (
|
||||
@@ -196,8 +202,8 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.commandLinkButton.setIcon(QtGui.QIcon(resources_path('ui','arrow-bottom.png')))
|
||||
self.commandLinkButton_2.setIcon(QtGui.QIcon(resources_path('ui','arrow-up.png')))
|
||||
|
||||
self.tableWidget.setSelectionBehavior(QTableWidget.SelectRows)
|
||||
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
#self.tableWidget.setSelectionBehavior(QTableWidget.selectRow)
|
||||
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger(0))
|
||||
self.toolButton.setIcon(QtGui.QIcon(resources_path('ui','find.png')))
|
||||
self.comboBox_2.addItem("SIG")
|
||||
self.comboBox_2.addItem('REF')
|
||||
@@ -213,7 +219,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.toolButton.clicked.connect(self.getCanevas)
|
||||
layout = QVBoxLayout()
|
||||
self.lineEdit.textChanged.connect(self.filtre_dynamique)
|
||||
self.viewer.titleChanged.connect(self.NewTitle)
|
||||
self.viewer.textChanged.connect(self.NewTitle)
|
||||
layout.addWidget(self.lineEdit)
|
||||
self.viewer.hide()
|
||||
self.DeBUG.addItem('')
|
||||
@@ -392,7 +398,7 @@ var Travaux = L.geoJSON(TravauxJSON,{
|
||||
# show the dialog
|
||||
self.show()
|
||||
# Run the dialog event loop
|
||||
result = self.exec_()
|
||||
result = self.exec()
|
||||
# See if OK was pressed
|
||||
if result:
|
||||
# Do something useful here - delete the line containing pass and
|
||||
@@ -416,7 +422,7 @@ var Travaux = L.geoJSON(TravauxJSON,{
|
||||
# show the dialog
|
||||
self.show()
|
||||
# Run the dialog event loop
|
||||
result = self.exec_()
|
||||
result = self.exec()
|
||||
# See if OK was pressed
|
||||
if result:
|
||||
# Do something useful here - delete the line containing pass and
|
||||
@@ -516,7 +522,7 @@ var Travaux = L.geoJSON(TravauxJSON,{
|
||||
|
||||
def item_already_exists(self, new_item_text):
|
||||
# Assuming you want to compare items in the first column for uniqueness
|
||||
existing_items = self.tableWidget_2.findItems(new_item_text, QtCore.Qt.MatchExactly)
|
||||
existing_items = self.tableWidget_2.findItems(new_item_text, QtCore.Qt.MatchFlag(0))
|
||||
|
||||
# Check if there are any existing items with the same text in the first column
|
||||
return len(existing_items) > 0
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
[general]
|
||||
name=CenRa_FLUX
|
||||
qgisMinimumVersion=3.0
|
||||
supportsQt6=True
|
||||
description=Permet d'ouvrire une table dans la base PostGis
|
||||
version=2.9
|
||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhNoEditMenu</set>
|
||||
<set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
@@ -159,9 +159,15 @@
|
||||
<height>181</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="geometry">
|
||||
@@ -235,9 +241,15 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked</set>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -326,24 +338,6 @@
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWebView" name="viewer" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>10</y>
|
||||
<width>730</width>
|
||||
<height>730</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(255, 255, 255,0.50);</string>
|
||||
</property>
|
||||
<property name="url" stdset="0">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
</url>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
@@ -379,33 +373,24 @@
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
<zorder>viewer</zorder>
|
||||
<zorder>commandLinkButton_2</zorder>
|
||||
<zorder>pushButton_2</zorder>
|
||||
<zorder>label</zorder>
|
||||
<zorder>tableWidget_2</zorder>
|
||||
<zorder>comboBox</zorder>
|
||||
<zorder>lineEdit</zorder>
|
||||
<zorder>toolButton</zorder>
|
||||
<zorder>tableWidget</zorder>
|
||||
<zorder>label_2</zorder>
|
||||
<zorder>label_3</zorder>
|
||||
<zorder>comboBox_2</zorder>
|
||||
<zorder>commandLinkButton</zorder>
|
||||
<zorder>checkBox</zorder>
|
||||
<zorder>DeBUG</zorder>
|
||||
<widget class="QTextBrowser" name="viewer">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>10</y>
|
||||
<width>731</width>
|
||||
<height>731</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(255, 255, 255,0.50);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QWebView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -41,7 +38,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>453</width>
|
||||
<height>547</height>
|
||||
<height>570</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
@@ -56,7 +53,7 @@
|
||||
<property name="title">
|
||||
<string>DevLog</string>
|
||||
</property>
|
||||
<widget class="QWebView" name="viewer" native="true">
|
||||
<widget class="QTextBrowser" name="viewer">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
@@ -65,11 +62,6 @@
|
||||
<height>511</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="url" stdset="0">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
</url>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
@@ -78,19 +70,12 @@
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::NoButton</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QWebView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user