Plugin PyQt5 and PyQt6 compatible & CenRa_Copie bug fix

This commit is contained in:
Tom LAVEILLE 2025-05-19 14:00:58 +02:00
parent 3b0758ea5c
commit 3ef37aa696
37 changed files with 434 additions and 321 deletions

View File

@ -36,7 +36,10 @@ from .canvas_editor import AutoMap_Editor
from .style_invoke import AutoMap_Style from .style_invoke import AutoMap_Style
from .about_form import AboutDialog from .about_form import AboutDialog
from PyQt5.QtCore import * try:
from PyQt5.QtCore import *
except:
from PyQt6.QtCore import *
class PgAutoMap: class PgAutoMap:
def __init__(self): def __init__(self):
@ -86,7 +89,7 @@ class PgAutoMap:
self.style_dock = AutoMap_Style() self.style_dock = AutoMap_Style()
if os.environ['USERNAME'] == 'tlaveille' or os.environ['USERNAME'] == 'lpoulin' or os.environ['USERNAME'] == 'rclement': if os.environ['USERNAME'] == 'tlaveille' or os.environ['USERNAME'] == 'lpoulin' or os.environ['USERNAME'] == 'rclement':
iface.addDockWidget(Qt.LeftDockWidgetArea, self.style_dock) iface.addDockWidget(Qt.DockWidgetArea(0x1), self.style_dock)
''' '''
if not self.locator_filter: if not self.locator_filter:
@ -126,7 +129,7 @@ class PgAutoMap:
About dialog About dialog
""" """
dialog = AboutDialog(iface) dialog = AboutDialog(iface)
dialog.exec_() dialog.exec()
def open_help(): def open_help():
""" Open the online help. """ """ Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/')) QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))

View File

@ -1,6 +1,6 @@
import logging import logging
import os import os
from PyQt5.QtCore import QSettings
from collections import namedtuple from collections import namedtuple
from enum import Enum from enum import Enum
from functools import partial from functools import partial
@ -44,7 +44,7 @@ from qgis.core import (
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
from qgis.PyQt.QtPrintSupport import QPrinter from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage #from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import ( from qgis.PyQt.QtWidgets import (
QDialog, QDialog,
QAction, QAction,
@ -59,8 +59,15 @@ from qgis.PyQt.QtWidgets import (
QTableWidgetItem, QTableWidgetItem,
QVBoxLayout, QVBoxLayout,
) )
from PyQt5 import QtGui try:
from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings
from PyQt5 import QtGui
from PyQt5 import QtWidgets
except:
from PyQt6.QtCore import QSettings
from PyQt6 import QtGui
from PyQt6 import QtWidgets
from qgis.PyQt.QtXml import QDomDocument from qgis.PyQt.QtXml import QDomDocument
from qgis.utils import iface from qgis.utils import iface
import glob import glob
@ -121,7 +128,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
for i in plugin_dir[1:]: for i in plugin_dir[1:]:
ix = ix+1 ix = ix+1
path = path+'/'+i path = path+'/'+i
self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);') #self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);')
self.verticalScrollBar.hide() self.verticalScrollBar.hide()
self.commandLinkButton.clicked.connect(self.chargement_qpt) self.commandLinkButton.clicked.connect(self.chargement_qpt)
@ -526,7 +533,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.layout.addLayoutItem(title) self.layout.addLayoutItem(title)
titre = titre_layout_name titre = titre_layout_name
title.setText(titre) title.setText(titre)
title.setFont(QFont("Calibri", 15, QFont.Bold)) title.setFont(QFont("Calibri", 15, False))
title.setItemRotation(self.template_parameters['Titre_rotate']) title.setItemRotation(self.template_parameters['Titre_rotate'])
title.attemptResize(self.template_parameters['Titre_size']) title.attemptResize(self.template_parameters['Titre_size'])
title.attemptMove(self.template_parameters['Titre_locals']) title.attemptMove(self.template_parameters['Titre_locals'])
@ -535,8 +542,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
title.setBackgroundColor(QColor(255, 255, 255, 130)) title.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addItem(title) self.layout.addItem(title)
# title.adjustSizeToText() on n'utilise plutot setFixedSize pour pouvoir centrer le titre de manière plus optimale ici # title.adjustSizeToText() on n'utilise plutot setFixedSize pour pouvoir centrer le titre de manière plus optimale ici
title.setHAlign(Qt.AlignHCenter) title.setHAlign(Qt.AlignmentFlag(0x0004))
title.setVAlign(Qt.AlignVCenter) title.setVAlign(Qt.AlignmentFlag(0x0080))
## Ajout d'un sous titre à la mise en page ## Ajout d'un sous titre à la mise en page
@ -554,8 +561,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
subtitle.setBackgroundEnabled(True) subtitle.setBackgroundEnabled(True)
subtitle.setBackgroundColor(QColor(255, 255, 255, 130)) subtitle.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addItem(subtitle) self.layout.addItem(subtitle)
subtitle.setHAlign(Qt.AlignHCenter) subtitle.setHAlign(Qt.AlignmentFlag(0x0004))
subtitle.setVAlign(Qt.AlignVCenter) subtitle.setVAlign(Qt.AlignmentFlag(0x0080))
## Ajout du logo CEN NA en haut à gauche de la page ## Ajout du logo CEN NA en haut à gauche de la page
@ -712,15 +719,15 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
credit_text = QgsLayoutItemLabel(self.layout) credit_text = QgsLayoutItemLabel(self.layout)
credit_text.setText(info[0]) credit_text.setText(info[0])
credit_text.setFont(QFont("Calibri", 9)) credit_text.setFont(QFont("Calibri", 9))
credit_text.setHAlign(Qt.AlignRight) credit_text.setHAlign(Qt.AlignmentFlag(0x0002))
credit_text.setVAlign(Qt.AlignVCenter) credit_text.setVAlign(Qt.AlignmentFlag(0x0080))
credit_text.setBackgroundEnabled(True) credit_text.setBackgroundEnabled(True)
credit_text.setBackgroundColor(QColor(255, 255, 255, 130)) credit_text.setBackgroundColor(QColor(255, 255, 255, 130))
credit_text2 = QgsLayoutItemLabel(self.layout) credit_text2 = QgsLayoutItemLabel(self.layout)
credit_text2.setText(info_text) credit_text2.setText(info_text)
credit_text2.setFont(QFont("Calibri", 9)) credit_text2.setFont(QFont("Calibri", 9))
credit_text2.setHAlign(Qt.AlignRight) credit_text2.setHAlign(Qt.AlignmentFlag(0x0002))
credit_text2.setVAlign(Qt.AlignVCenter) credit_text2.setVAlign(Qt.AlignmentFlag(0x0080))
credit_text.setItemRotation(self.template_parameters['Credit_rotate']) credit_text.setItemRotation(self.template_parameters['Credit_rotate'])
credit_text.attemptResize(self.template_parameters['Credit_size']) credit_text.attemptResize(self.template_parameters['Credit_size'])
credit_text.attemptMove(self.template_parameters['Credit_locals']) credit_text.attemptMove(self.template_parameters['Credit_locals'])
@ -740,7 +747,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
logo_credit.setMode(QgsLayoutItemPicture.FormatRaster) logo_credit.setMode(QgsLayoutItemPicture.FormatRaster)
cur_x = self.template_parameters['Logo_2_locals'].x() cur_x = self.template_parameters['Logo_2_locals'].x()
logo_credit.attemptMove(self.template_parameters['Logo_2_locals']) logo_credit.attemptMove(self.template_parameters['Logo_2_locals'])
logo_credit.setPictureAnchor(4) print(logo_credit.pictureAnchor())
#logo_credit.setPictureAnchor(4)
self.template_parameters['Logo_2_locals'].setX(cur_x+(logo_div/len_item)) self.template_parameters['Logo_2_locals'].setX(cur_x+(logo_div/len_item))
logo_credit.setFixedSize(self.template_parameters['Logo_2_size']) logo_credit.setFixedSize(self.template_parameters['Logo_2_size'])
if logo_run[0] == ' ': if logo_run[0] == ' ':
@ -760,17 +768,17 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
if existing_layout: if existing_layout:
self.QMBquestion = QMessageBox() self.QMBquestion = QMessageBox()
self.QMBquestion.setWindowTitle(u"Attention !") self.QMBquestion.setWindowTitle(u"Attention !")
self.QMBquestion.setIcon(QMessageBox.Warning) self.QMBquestion.setIcon(QMessageBox.Icon.Warning)
self.QMBquestion.setText("Mise en page existante, la mise en page va être écrasée !") self.QMBquestion.setText("Mise en page existante, la mise en page va être écrasée !")
self.QMBquestion.setStandardButtons(QMessageBox.Yes|QMessageBox.No) self.QMBquestion.setStandardButtons(QMessageBox.StandardButton(0x00004000)|QMessageBox.StandardButton(0x00010000))
self.QMBquestion.addButton(QPushButton('Autre mise en page'),QMessageBox.AcceptRole) self.QMBquestion.addButton(QPushButton('Autre mise en page'),QMessageBox.ButtonRole(0))
self.QMBquestion = self.QMBquestion.exec() self.QMBquestion = self.QMBquestion.exec()
#if self.radioButton_12.isChecked() != 1: #if self.radioButton_12.isChecked() != 1:
if self.QMBquestion == QMessageBox.Yes: if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
project.layoutManager().removeLayout(existing_layout) project.layoutManager().removeLayout(existing_layout)
result = project.layoutManager().addLayout(self.layout) result = project.layoutManager().addLayout(self.layout)
if self.QMBquestion == QMessageBox.AcceptRole: elif self.QMBquestion != QMessageBox.StandardButton(0x00010000):
LayoutCOUNT=0 LayoutCOUNT=0
arrayManager = [] arrayManager = []
for AddArrayManager in project.layoutManager().layouts(): for AddArrayManager in project.layoutManager().layouts():

View File

@ -5,6 +5,7 @@
[general] [general]
name=CenRa_AutoMap name=CenRa_AutoMap
qgisMinimumVersion=3.0 qgisMinimumVersion=3.0
supportsQt6=True
description=CenRa_AutoMap description=CenRa_AutoMap
version=1.7 version=1.7
author=Conservatoire d'Espaces Naturels de Rhône-Alpes author=Conservatoire d'Espaces Naturels de Rhône-Alpes

View File

@ -1,6 +1,5 @@
import logging import logging
import os import os
from PyQt5.QtCore import QSettings
from collections import namedtuple from collections import namedtuple
from enum import Enum from enum import Enum
from functools import partial from functools import partial
@ -45,7 +44,6 @@ from qgis.core import (
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
from qgis.PyQt.QtPrintSupport import QPrinter from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import ( from qgis.PyQt.QtWidgets import (
QDockWidget, QDockWidget,
QAction, QAction,
@ -61,8 +59,14 @@ from qgis.PyQt.QtWidgets import (
QVBoxLayout, QVBoxLayout,
) )
import psycopg2 import psycopg2
from PyQt5 import QtGui try:
from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings
from PyQt5 import QtGui
from PyQt5 import QtWidgets
except:
from PyQt6.QtCore import QSettings
from PyQt6 import QtGui
from PyQt6 import QtWidgets
from qgis.PyQt.QtXml import QDomDocument from qgis.PyQt.QtXml import QDomDocument
from qgis.utils import iface from qgis.utils import iface
import glob import glob

View File

@ -29,9 +29,6 @@
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -41,7 +38,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>453</width> <width>453</width>
<height>547</height> <height>570</height>
</rect> </rect>
</property> </property>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
@ -56,7 +53,7 @@
<property name="title"> <property name="title">
<string>DevLog</string> <string>DevLog</string>
</property> </property>
<widget class="QWebView" name="viewer" native="true"> <widget class="QTextBrowser" name="viewer">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -65,11 +62,6 @@
<height>511</height> <height>511</height>
</rect> </rect>
</property> </property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -78,19 +70,12 @@
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Ok</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -24,8 +24,10 @@ pyperclip()
from .copie_editor import Copie_Editor from .copie_editor import Copie_Editor
from .about_form import AboutDialog from .about_form import AboutDialog
from PyQt5.QtCore import * try:
from PyQt5.QtCore import *
except:
from PyQt6.QtCore import *
class PgCopie: class PgCopie:
def __init__(self): def __init__(self):
""" Constructor. """ """ Constructor. """
@ -78,7 +80,7 @@ class PgCopie:
About dialog About dialog
""" """
dialog = AboutDialog(iface) dialog = AboutDialog(iface)
dialog.exec_() dialog.exec()
def open_help(): def open_help():
""" Open the online help. """ """ Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/')) QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))

View File

@ -9,9 +9,15 @@ import qgis
from qgis.PyQt.QtCore import QSettings from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import * try:
from PyQt5.QtGui import * from PyQt5.QtCore import *
from PyQt5 import QtGui 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 *
from qgis.core import QgsDataSourceUri from qgis.core import QgsDataSourceUri
import os import os
@ -114,7 +120,7 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
# show the dialog # show the dialog
self.show() self.show()
# Run the dialog event loop # Run the dialog event loop
result = self.exec_() result = self.exec()
# See if OK was pressed # See if OK was pressed
if result: if result:
#******************************debut script********************************* #******************************debut script*********************************
@ -163,7 +169,6 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
else : else :
SQL_table = "CREATE TABLE " + schema + "." + tablename + " AS SELECT * FROM " + source_schema + "." + source_tablename SQL_table = "CREATE TABLE " + schema + "." + tablename + " AS SELECT * FROM " + source_schema + "." + source_tablename
SQL_pkey = "ALTER TABLE " + schema + "." + tablename + " ADD CONSTRAINT " + tablename + "_pkey" + " PRIMARY KEY (gid)" SQL_pkey = "ALTER TABLE " + schema + "." + tablename + " ADD CONSTRAINT " + tablename + "_pkey" + " PRIMARY KEY (gid)"
SQL_sequence_01 = "CREATE SEQUENCE " + schema + "." + tablename + "_gid_seq" + " INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1;" SQL_sequence_01 = "CREATE SEQUENCE " + schema + "." + tablename + "_gid_seq" + " INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1;"
SQL_sequence_02 = "ALTER TABLE " + schema + "." + tablename + " ALTER COLUMN gid SET DEFAULT nextval(\'" + schema + "." + tablename + "_gid_seq\'::regclass);" SQL_sequence_02 = "ALTER TABLE " + schema + "." + tablename + " ALTER COLUMN gid SET DEFAULT nextval(\'" + schema + "." + tablename + "_gid_seq\'::regclass);"
@ -183,6 +188,13 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
cur.execute(SQL_sequence_03) cur.execute(SQL_sequence_03)
cur.execute(SQL_sequence_04) cur.execute(SQL_sequence_04)
RETURNE = "SELECT pg_get_serial_sequence('"+schema + "."+ tablename+"','gid')"
cur.execute(RETURNE)
sequence_name = cur.fetchone()[0]
print(sequence_name)
SQL_GRANT_TABLE="GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON "+schema+"."+tablename+" TO grp_qgis;GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON "+schema+"."+tablename+" TO grp_sig;GRANT ALL ON SEQUENCE "+sequence_name+" TO grp_qgis;"
cur.execute(SQL_GRANT_TABLE)
if layer.wkbType() == QgsWkbTypes.PointGeometry : if layer.wkbType() == QgsWkbTypes.PointGeometry :
cur.execute(SQL_trigger_coordonnees) cur.execute(SQL_trigger_coordonnees)

View File

@ -9,6 +9,7 @@
[general] [general]
name=CenRA_COPIE name=CenRA_COPIE
qgisMinimumVersion=3.0 qgisMinimumVersion=3.0
supportsQt6=True
description=Permet la copie d'une table dans une base PostGis description=Permet la copie d'une table dans une base PostGis
version=2.5 version=2.5
author=Conservatoire d'Espaces Naturels de Rhône-Alpes author=Conservatoire d'Espaces Naturels de Rhône-Alpes

View File

@ -29,9 +29,6 @@
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -41,7 +38,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>453</width> <width>453</width>
<height>547</height> <height>570</height>
</rect> </rect>
</property> </property>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
@ -56,7 +53,7 @@
<property name="title"> <property name="title">
<string>DevLog</string> <string>DevLog</string>
</property> </property>
<widget class="QWebView" name="viewer" native="true"> <widget class="QTextBrowser" name="viewer">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -65,11 +62,6 @@
<height>511</height> <height>511</height>
</rect> </rect>
</property> </property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -78,19 +70,12 @@
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Ok</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -24,7 +24,10 @@ pyperclip()
from .flux_editor import Flux_Editor from .flux_editor import Flux_Editor
from .about_form import AboutDialog from .about_form import AboutDialog
from PyQt5.QtCore import * try:
from PyQt5.QtCore import *
except:
from PyQt6.QtCore import *
class PgFlux: class PgFlux:
def __init__(self): def __init__(self):
@ -78,7 +81,7 @@ class PgFlux:
About dialog About dialog
""" """
dialog = AboutDialog(iface) dialog = AboutDialog(iface)
dialog.exec_() dialog.exec()
def open_help(): def open_help():
""" Open the online help. """ """ Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/')) QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))

View File

@ -11,9 +11,15 @@ from qgis.PyQt.QtCore import QSettings
from qgis.PyQt import QtWidgets from qgis.PyQt import QtWidgets
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import * try:
from PyQt5.QtGui import * from PyQt5.QtCore import *
from PyQt5 import QtGui 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 *
from qgis.core import QgsDataSourceUri from qgis.core import QgsDataSourceUri
from qgis.PyQt.QtWidgets import ( 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.setIcon(QtGui.QIcon(resources_path('ui','arrow-bottom.png')))
self.commandLinkButton_2.setIcon(QtGui.QIcon(resources_path('ui','arrow-up.png'))) self.commandLinkButton_2.setIcon(QtGui.QIcon(resources_path('ui','arrow-up.png')))
self.tableWidget.setSelectionBehavior(QTableWidget.SelectRows) #self.tableWidget.setSelectionBehavior(QTableWidget.selectRow)
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger(0))
self.toolButton.setIcon(QtGui.QIcon(resources_path('ui','find.png'))) self.toolButton.setIcon(QtGui.QIcon(resources_path('ui','find.png')))
self.comboBox_2.addItem("SIG") self.comboBox_2.addItem("SIG")
self.comboBox_2.addItem('REF') self.comboBox_2.addItem('REF')
@ -213,7 +219,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
self.toolButton.clicked.connect(self.getCanevas) self.toolButton.clicked.connect(self.getCanevas)
layout = QVBoxLayout() layout = QVBoxLayout()
self.lineEdit.textChanged.connect(self.filtre_dynamique) self.lineEdit.textChanged.connect(self.filtre_dynamique)
self.viewer.titleChanged.connect(self.NewTitle) self.viewer.textChanged.connect(self.NewTitle)
layout.addWidget(self.lineEdit) layout.addWidget(self.lineEdit)
self.viewer.hide() self.viewer.hide()
self.DeBUG.addItem('') self.DeBUG.addItem('')
@ -392,7 +398,7 @@ var Travaux = L.geoJSON(TravauxJSON,{
# show the dialog # show the dialog
self.show() self.show()
# Run the dialog event loop # Run the dialog event loop
result = self.exec_() result = self.exec()
# See if OK was pressed # See if OK was pressed
if result: if result:
# Do something useful here - delete the line containing pass and # Do something useful here - delete the line containing pass and
@ -416,7 +422,7 @@ var Travaux = L.geoJSON(TravauxJSON,{
# show the dialog # show the dialog
self.show() self.show()
# Run the dialog event loop # Run the dialog event loop
result = self.exec_() result = self.exec()
# See if OK was pressed # See if OK was pressed
if result: if result:
# Do something useful here - delete the line containing pass and # 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): def item_already_exists(self, new_item_text):
# Assuming you want to compare items in the first column for uniqueness # 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 # Check if there are any existing items with the same text in the first column
return len(existing_items) > 0 return len(existing_items) > 0

View File

@ -5,6 +5,7 @@
[general] [general]
name=CenRa_FLUX name=CenRa_FLUX
qgisMinimumVersion=3.0 qgisMinimumVersion=3.0
supportsQt6=True
description=Permet d'ouvrire une table dans la base PostGis description=Permet d'ouvrire une table dans la base PostGis
version=2.9 version=2.9
author=Conservatoire d'Espaces Naturels de Rhône-Alpes author=Conservatoire d'Espaces Naturels de Rhône-Alpes

View File

@ -59,7 +59,7 @@
</size> </size>
</property> </property>
<property name="inputMethodHints"> <property name="inputMethodHints">
<set>Qt::ImhNoEditMenu</set> <set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
@ -159,9 +159,15 @@
<height>181</height> <height>181</height>
</rect> </rect>
</property> </property>
<property name="inputMethodHints">
<set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
</property>
<property name="selectionMode"> <property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum> <enum>QAbstractItemView::SingleSelection</enum>
</property> </property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
</widget> </widget>
<widget class="QComboBox" name="comboBox"> <widget class="QComboBox" name="comboBox">
<property name="geometry"> <property name="geometry">
@ -235,9 +241,15 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="editTriggers">
<set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked</set>
</property>
<property name="selectionMode"> <property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum> <enum>QAbstractItemView::SingleSelection</enum>
</property> </property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled"> <property name="sortingEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -326,24 +338,6 @@
</size> </size>
</property> </property>
</widget> </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"> <widget class="QCheckBox" name="checkBox">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -379,33 +373,24 @@
<string notr="true"/> <string notr="true"/>
</property> </property>
</widget> </widget>
<zorder>viewer</zorder> <widget class="QTextBrowser" name="viewer">
<zorder>commandLinkButton_2</zorder> <property name="geometry">
<zorder>pushButton_2</zorder> <rect>
<zorder>label</zorder> <x>90</x>
<zorder>tableWidget_2</zorder> <y>10</y>
<zorder>comboBox</zorder> <width>731</width>
<zorder>lineEdit</zorder> <height>731</height>
<zorder>toolButton</zorder> </rect>
<zorder>tableWidget</zorder> </property>
<zorder>label_2</zorder> <property name="styleSheet">
<zorder>label_3</zorder> <string notr="true">background-color: rgba(255, 255, 255,0.50);</string>
<zorder>comboBox_2</zorder> </property>
<zorder>commandLinkButton</zorder> </widget>
<zorder>checkBox</zorder>
<zorder>DeBUG</zorder>
</widget> </widget>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -29,9 +29,6 @@
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -41,7 +38,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>453</width> <width>453</width>
<height>547</height> <height>570</height>
</rect> </rect>
</property> </property>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
@ -56,7 +53,7 @@
<property name="title"> <property name="title">
<string>DevLog</string> <string>DevLog</string>
</property> </property>
<widget class="QWebView" name="viewer" native="true"> <widget class="QTextBrowser" name="viewer">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -65,11 +62,6 @@
<height>511</height> <height>511</height>
</rect> </rect>
</property> </property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -78,19 +70,12 @@
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Ok</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -36,7 +36,10 @@ from .editor import Metabase_Editor
from .about_form import MetabaseAboutDialog from .about_form import MetabaseAboutDialog
#from CenRa_Metabase.issues import CenRa_Issues #from CenRa_Metabase.issues import CenRa_Issues
from PyQt5.QtCore import * try:
from PyQt5.QtCore import *
except:
from PyQt6.QtCore import *
class PgMetadata: class PgMetadata:
def __init__(self): def __init__(self):
@ -106,7 +109,7 @@ class PgMetadata:
if not self.dock: if not self.dock:
self.dock = CenRa_Metabase() self.dock = CenRa_Metabase()
iface.addDockWidget(Qt.RightDockWidgetArea, self.dock) iface.addDockWidget(Qt.DockWidgetArea(0x2), self.dock)
# Open/close the dock from plugin menu # Open/close the dock from plugin menu
self.dock_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow()) self.dock_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
@ -157,7 +160,7 @@ class PgMetadata:
About dialog About dialog
""" """
dialog = MetabaseAboutDialog(iface) dialog = MetabaseAboutDialog(iface)
dialog.exec_() dialog.exec()
def open_help(): def open_help():
""" Open the online help. """ """ Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/')) QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))

View File

@ -12,7 +12,7 @@ ABOUT_FORM_CLASS, _ = uic.loadUiType(
os.path.join( os.path.join(
str(Path(__file__).resolve().parent), str(Path(__file__).resolve().parent),
'tools/ui', 'tools/ui',
'CenRa_Metabase_about_form.ui' 'CenRa_about_form.ui'
) )
) )

View File

@ -27,7 +27,7 @@ from qgis.core import (
from qgis.PyQt.QtCore import QLocale, QUrl from qgis.PyQt.QtCore import QLocale, QUrl
from qgis.PyQt.QtGui import QDesktopServices, QIcon from qgis.PyQt.QtGui import QDesktopServices, QIcon
from qgis.PyQt.QtPrintSupport import QPrinter from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage #from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import ( from qgis.PyQt.QtWidgets import (
QDialog, QDialog,
QAction, QAction,
@ -84,8 +84,8 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
self.current_datasource_uri = None self.current_datasource_uri = None
self.current_connection = None self.current_connection = None
self.viewer.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks) #self.viewer.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
self.viewer.page().linkClicked.connect(self.open_link) #self.viewer.page().linkClicked.connect(self.open_link)
# Help button # Help button
self.external_help.setText('') self.external_help.setText('')
@ -101,7 +101,7 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
# Settings menu # Settings menu
self.config.setAutoRaise(True) self.config.setAutoRaise(True)
#self.config.setToolTip(tr("Settings")) #self.config.setToolTip(tr("Settings"))
self.config.setPopupMode(QToolButton.InstantPopup) self.config.setPopupMode(QToolButton.ToolButtonPopupMode(2))
self.config.setIcon(QgsApplication.getThemeIcon("/mActionOptions.svg")) self.config.setIcon(QgsApplication.getThemeIcon("/mActionOptions.svg"))
self.auto_open_dock_action = QAction( self.auto_open_dock_action = QAction(
@ -119,7 +119,7 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
# Setting PDF/HTML menu # Setting PDF/HTML menu
self.save_button.setAutoRaise(True) self.save_button.setAutoRaise(True)
#self.save_button.setToolTip(tr("Save metadata")) #self.save_button.setToolTip(tr("Save metadata"))
self.save_button.setPopupMode(QToolButton.InstantPopup) self.save_button.setPopupMode(QToolButton.ToolButtonPopupMode(2))
self.save_button.setIcon(QIcon(QgsApplication.iconPath('mActionFileSave.svg'))) self.save_button.setIcon(QIcon(QgsApplication.iconPath('mActionFileSave.svg')))
self.save_as_pdf = QAction( self.save_as_pdf = QAction(
@ -191,8 +191,8 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
if output_format == OutputFormats.PDF: if output_format == OutputFormats.PDF:
printer = QPrinter() printer = QPrinter()
printer.setOutputFormat(QPrinter.PdfFormat) printer.setOutputFormat(QPrinter.OutputFormat(1))
printer.setPageMargins(20, 20, 20, 20, QPrinter.Millimeter) #printer.setPageMargins(20,20,20,20,QPrinter.Unit(0))
printer.setOutputFileName(output_file_path) printer.setOutputFileName(output_file_path)
self.viewer.print(printer) self.viewer.print(printer)
iface.messageBar().pushSuccess( iface.messageBar().pushSuccess(
@ -357,7 +357,7 @@ publisher+
# It must be a file, even if it does not exist on the file system. # It must be a file, even if it does not exist on the file system.
base_url = QUrl.fromLocalFile(resources_path('images', 'must_be_a_file.png')) base_url = QUrl.fromLocalFile(resources_path('images', 'must_be_a_file.png'))
self.viewer.setHtml(html, base_url) self.viewer.setHtml(html)#, base_url)
def ce_trouve_dans_psql(self,layer): def ce_trouve_dans_psql(self,layer):
try: try:

View File

@ -20,11 +20,11 @@ from qgis.core import (
QgsGeometry, QgsGeometry,
QgsWkbTypes, QgsWkbTypes,
) )
from PyQt5 import QtGui from qgis.PyQt import QtGui
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime
from qgis.PyQt.QtGui import QDesktopServices, QIcon from qgis.PyQt.QtGui import QDesktopServices, QIcon
from qgis.PyQt.QtPrintSupport import QPrinter from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage #from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import ( from qgis.PyQt.QtWidgets import (
QDialog, QDialog,
QAction, QAction,

View File

@ -5,6 +5,7 @@
[general] [general]
name=CenRa_Metabase name=CenRa_Metabase
qgisMinimumVersion=3.0 qgisMinimumVersion=3.0
supportsQt6=True
description=CenRa_METABASE description=CenRa_METABASE
version=0.2.3 version=0.2.3
author=Conservatoire d'Espaces Naturels de Rhône-Alpes author=Conservatoire d'Espaces Naturels de Rhône-Alpes

View File

@ -64,24 +64,11 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QWebView" name="viewer" native="true"> <widget class="QTextBrowser" name="viewer"/>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Metabase</string> <string>Journal des modifications</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset> <iconset>
@ -29,9 +29,6 @@
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -41,7 +38,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>453</width> <width>453</width>
<height>547</height> <height>570</height>
</rect> </rect>
</property> </property>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
@ -56,7 +53,7 @@
<property name="title"> <property name="title">
<string>DevLog</string> <string>DevLog</string>
</property> </property>
<widget class="QWebView" name="viewer" native="true"> <widget class="QTextBrowser" name="viewer">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -65,11 +62,6 @@
<height>511</height> <height>511</height>
</rect> </rect>
</property> </property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -78,19 +70,12 @@
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Ok</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -32,7 +32,10 @@ from .tools.resources import (
from .canvas_editor import PageRender_Editor from .canvas_editor import PageRender_Editor
from .about_form import AboutDialog from .about_form import AboutDialog
from PyQt5.QtCore import * try:
from PyQt5.QtCore import *
except:
from PyQt6.QtCore import *
class PgPageRender: class PgPageRender:
def __init__(self): def __init__(self):
@ -115,7 +118,7 @@ class PgPageRender:
About dialog About dialog
""" """
dialog = AboutDialog(iface) dialog = AboutDialog(iface)
dialog.exec_() dialog.exec()
def open_help(): def open_help():
""" Open the online help. """ """ Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/')) QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))

View File

@ -1,6 +1,5 @@
import logging import logging
import os import os
from PyQt5.QtCore import QSettings,QPointF
from collections import namedtuple from collections import namedtuple
from enum import Enum from enum import Enum
from functools import partial from functools import partial
@ -44,7 +43,7 @@ from qgis.core import (
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
from qgis.PyQt.QtPrintSupport import QPrinter from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage #from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import ( from qgis.PyQt.QtWidgets import (
QDialog, QDialog,
QAction, QAction,
@ -57,8 +56,14 @@ from qgis.PyQt.QtWidgets import (
QTableWidgetItem, QTableWidgetItem,
QVBoxLayout, QVBoxLayout,
) )
from PyQt5 import QtGui try:
from PyQt5.QtWidgets import QApplication from PyQt5 import QtGui
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QSettings,QPointF
except:
from PyQt6 import QtGui
from PyQt6.QtWidgets import QApplication
from PyQt6.QtCore import QSettings,QPointF
from qgis.PyQt.QtXml import QDomDocument from qgis.PyQt.QtXml import QDomDocument
from qgis.utils import iface from qgis.utils import iface
import glob import glob
@ -158,7 +163,7 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
self.verticalScrollBar.setValue(self.frame.y()) self.verticalScrollBar.setValue(self.frame.y())
def mousePressEvent(self, event): def mousePressEvent(self, event):
if self.tableWidget.currentItem() != None: if self.tableWidget.currentItem() != None:
QApplication.setOverrideCursor(Qt.OpenHandCursor) QApplication.setOverrideCursor(Qt.CursorShape(18))
global lastPos global lastPos
lastPos = {'x':event.pos().x(),'y':event.pos().y()} lastPos = {'x':event.pos().x(),'y':event.pos().y()}
@ -167,13 +172,13 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
def keyPressEvent(self, event): def keyPressEvent(self, event):
#if event.modifiers() & Qt.ControlModifier: #if event.modifiers() & Qt.ControlModifier:
if event.key() == Qt.Key_Up: if event.key() == Qt.Key(0x01000015):
self.verticalSlider.setValue(self.spinBox_2.value()+1) self.verticalSlider.setValue(self.spinBox_2.value()+1)
if event.key() == Qt.Key_Down: if event.key() == Qt.Key(0x01000013):
self.verticalSlider.setValue(self.spinBox_2.value()-1) self.verticalSlider.setValue(self.spinBox_2.value()-1)
if event.key() == Qt.Key_Right: if event.key() == Qt.Key(0x01000014):
self.horizontalSlider.setValue(self.spinBox.value()+1) self.horizontalSlider.setValue(self.spinBox.value()+1)
if event.key() == Qt.Key_Left: if event.key() == Qt.Key(0x01000012):
self.horizontalSlider.setValue(self.spinBox.value()-1) self.horizontalSlider.setValue(self.spinBox.value()-1)

167
CenRa_PAGERENDER/demoV2.py Normal file
View File

@ -0,0 +1,167 @@
from qgis.core import (
QgsLayoutSize,
QgsUnitTypes,
QgsLayoutPoint,
)
def fletch_canvas(self):
if self.radioButton_6.isChecked():
values_page = 'A4'
else:
values_page = 'A3'
if self.radioButton_7.isChecked():
page_rotate = 'Portrait'
else:
page_rotate = 'Landscape'
if page_rotate == 'Portrait':
if values_page == 'A4':
self.template_parameters['Carte_size'] = QgsLayoutSize(200.0,200, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(85.71428571428571,69, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(209, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(85.71428571428571,131, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(209, 74, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143,7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143,13, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(122.0,45, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(31, 21, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_size'] = QgsLayoutSize(282,282, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(121,97, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(295, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(121,185, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(295, 104, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(267, 28, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(73,10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(13, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(64,16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(218,16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(72, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(213, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(323, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73,18, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(13, 259, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(172,64, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(44, 29, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
if page_rotate == 'Landscape':
if values_page == 'A4':
self.template_parameters['Carte_size'] = QgsLayoutSize(200.0,200, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(85.71428571428571,69, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(209, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(85.71428571428571,131, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(209, 74, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143,7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143,13, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(122.0,45, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(31, 21, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_size'] = QgsLayoutSize(282,282, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(121,97, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(295, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(121,185, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(295, 104, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(267, 28, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(73,10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(13, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(64,16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(218,16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(72, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(213, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(323, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73,18, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(13, 259, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(172,64, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(44, 29, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
return self.template_parameters

View File

@ -5,6 +5,7 @@
[general] [general]
name=CenRa_PageRender name=CenRa_PageRender
qgisMinimumVersion=3.0 qgisMinimumVersion=3.0
supportsQt6=True
description=CenRa_PageRender description=CenRa_PageRender
version=0.1.6 version=0.1.6
author=Conservatoire d'Espaces Naturels de Rhône-Alpes author=Conservatoire d'Espaces Naturels de Rhône-Alpes

View File

@ -29,9 +29,6 @@
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -41,7 +38,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>453</width> <width>453</width>
<height>547</height> <height>570</height>
</rect> </rect>
</property> </property>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
@ -56,7 +53,7 @@
<property name="title"> <property name="title">
<string>DevLog</string> <string>DevLog</string>
</property> </property>
<widget class="QWebView" name="viewer" native="true"> <widget class="QTextBrowser" name="viewer">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -65,11 +62,6 @@
<height>511</height> <height>511</height>
</rect> </rect>
</property> </property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -78,19 +70,12 @@
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Ok</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -28,7 +28,10 @@ from .postgis_creator import Postgis_Creator
from .postgis_rename import Postgis_Rename from .postgis_rename import Postgis_Rename
from .about_form import AboutDialog from .about_form import AboutDialog
from PyQt5.QtCore import * try:
from PyQt5.QtCore import *
except:
from PyQt6.QtCore import *
IPAddr=socket.gethostbyname(socket.gethostname()) IPAddr=socket.gethostbyname(socket.gethostname())
@ -119,7 +122,7 @@ class PgPostgis:
About dialog About dialog
""" """
dialog = AboutDialog(iface) dialog = AboutDialog(iface)
dialog.exec_() dialog.exec()
def open_help(): def open_help():
""" Open the online help. """ """ Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/')) QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))

View File

@ -11,6 +11,7 @@
[general] [general]
name=CenRa_POSTGIS name=CenRa_POSTGIS
qgisMinimumVersion=3.0 qgisMinimumVersion=3.0
supportsQt6=True
description=Permet de crée un dossier dans la base PostGis description=Permet de crée un dossier dans la base PostGis
version=2.9 version=2.9
author=Conservatoire d'Espaces Naturels de Rhône-Alpes author=Conservatoire d'Espaces Naturels de Rhône-Alpes

View File

@ -9,9 +9,14 @@ import qgis
from qgis.PyQt.QtCore import QSettings from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog,QMessageBox from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog,QMessageBox
from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import * try:
from PyQt5.QtGui import * from PyQt5.QtCore import *
from PyQt5 import QtGui 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 *
from qgis.core import QgsDataSourceUri from qgis.core import QgsDataSourceUri
@ -59,7 +64,7 @@ class Postgis_Creator(QDialog, EDITOR_CLASS):
# show the dialog # show the dialog
self.show() self.show()
# Run the dialog event loop # Run the dialog event loop
result = self.exec_() result = self.exec()
# See if OK was pressed # See if OK was pressed
if result == 1: if result == 1:

View File

@ -9,9 +9,14 @@ import qgis
from qgis.PyQt.QtCore import QSettings from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import * try:
from PyQt5.QtGui import * from PyQt5.QtCore import *
from PyQt5 import QtGui 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 *
from qgis.core import QgsDataSourceUri from qgis.core import QgsDataSourceUri
@ -89,7 +94,7 @@ class Postgis_Editor(QDialog, EDITOR_CLASS):
# show the dialog # show the dialog
self.show() self.show()
# Run the dialog event loop # Run the dialog event loop
result = self.exec_() result = self.exec()
# See if OK was pressed # See if OK was pressed
if result == 1: if result == 1:
#******************************debut script********************************* #******************************debut script*********************************

View File

@ -9,9 +9,14 @@ import qgis
from qgis.PyQt.QtCore import QSettings from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog, QMessageBox,QDialogButtonBox from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog, QMessageBox,QDialogButtonBox
from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import * try:
from PyQt5.QtGui import * from PyQt5.QtCore import *
from PyQt5 import QtGui 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 *
from qgis.core import QgsDataSourceUri from qgis.core import QgsDataSourceUri
@ -69,7 +74,7 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
def raise_(self): def raise_(self):
self.activateWindow() self.activateWindow()
self.groupBox_3.hide() self.groupBox_3.hide()
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) self.buttonBox.button(QDialogButtonBox.StandardButton(0x00000400)).setEnabled(False)
GET_ALL_SCHEMA = """SELECT DISTINCT table_schema FROM information_schema.tables WHERE table_schema LIKE '_form_%' OR table_schema LIKE '_01_%' OR table_schema LIKE '_07_%' OR table_schema LIKE '_26_%' OR table_schema LIKE '_42_%' OR table_schema LIKE '_69_%' ORDER BY table_schema;""" GET_ALL_SCHEMA = """SELECT DISTINCT table_schema FROM information_schema.tables WHERE table_schema LIKE '_form_%' OR table_schema LIKE '_01_%' OR table_schema LIKE '_07_%' OR table_schema LIKE '_26_%' OR table_schema LIKE '_42_%' OR table_schema LIKE '_69_%' ORDER BY table_schema;"""
cur.execute(GET_ALL_SCHEMA) cur.execute(GET_ALL_SCHEMA)
AllSchema = cur.fetchall() AllSchema = cur.fetchall()
@ -118,10 +123,10 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
if allIsGood == 2: if allIsGood == 2:
self.groupBox_3.show() self.groupBox_3.show()
self.loadValue() self.loadValue()
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(True) self.buttonBox.button(QDialogButtonBox.StandardButton(0x00000400)).setEnabled(True)
else: else:
self.groupBox_3.hide() self.groupBox_3.hide()
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) self.buttonBox.button(QDialogButtonBox.StandardButton(0x00000400)).setEnabled(False)
else: else:
self.old_name.setText('') self.old_name.setText('')
self.compte.setChecked(0) self.compte.setChecked(0)
@ -220,9 +225,9 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
def msgBox(self): def msgBox(self):
self.QMBquestion = QMessageBox() self.QMBquestion = QMessageBox()
self.QMBquestion.setWindowTitle(u"Attention !") self.QMBquestion.setWindowTitle(u"Attention !")
self.QMBquestion.setIcon(QMessageBox.Warning) self.QMBquestion.setIcon(QMessageBox.Icon.Warning)
self.QMBquestion.setText("Attention, le renommage de dossier PostGIS peut engendrer des pertes de liaisons avec des projets QGIS !") self.QMBquestion.setText("Attention, le renommage de dossier PostGIS peut engendrer des pertes de liaisons avec des projets QGIS !")
self.QMBquestion.setStandardButtons(QMessageBox.Yes|QMessageBox.No) self.QMBquestion.setStandardButtons(QMessageBox.StandardButton(0x00004000)|QMessageBox.StandardButton(0x00010000))
if self.new_name.text() != '': if self.new_name.text() != '':
error_caracteres = 0 error_caracteres = 0
for caracteres in ch : for caracteres in ch :
@ -234,5 +239,5 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
QMessageBox.warning(None, "Oups :", u"Le nom de dossier ne doit pas comporter de caractères spéciaux, ni d'espaces !\n\n\t" + self.new_name.text().lower() ) QMessageBox.warning(None, "Oups :", u"Le nom de dossier ne doit pas comporter de caractères spéciaux, ni d'espaces !\n\n\t" + self.new_name.text().lower() )
else: else:
QMessageBox.warning(None, "Oups :", "Votre projet doit avoire un nom !") QMessageBox.warning(None, "Oups :", "Votre projet doit avoire un nom !")
if self.QMBquestion == QMessageBox.Yes: if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
self.updateName() self.updateName()

View File

@ -29,9 +29,6 @@
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -41,7 +38,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>453</width> <width>453</width>
<height>547</height> <height>570</height>
</rect> </rect>
</property> </property>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
@ -56,7 +53,7 @@
<property name="title"> <property name="title">
<string>DevLog</string> <string>DevLog</string>
</property> </property>
<widget class="QWebView" name="viewer" native="true"> <widget class="QTextBrowser" name="viewer">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -65,11 +62,6 @@
<height>511</height> <height>511</height>
</rect> </rect>
</property> </property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -78,19 +70,12 @@
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Ok</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -29,9 +29,6 @@
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -41,7 +38,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>453</width> <width>453</width>
<height>547</height> <height>570</height>
</rect> </rect>
</property> </property>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
@ -56,7 +53,7 @@
<property name="title"> <property name="title">
<string>DevLog</string> <string>DevLog</string>
</property> </property>
<widget class="QWebView" name="viewer" native="true"> <widget class="QTextBrowser" name="viewer">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -65,11 +62,6 @@
<height>511</height> <height>511</height>
</rect> </rect>
</property> </property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -78,19 +70,12 @@
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Ok</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -11,6 +11,7 @@
[general] [general]
name=CenRa SICEN name=CenRa SICEN
qgisMinimumVersion=3.0 qgisMinimumVersion=3.0
supportsQt6=True
description=Filtre des données saisies dans SICEN et export d'une liste d'espèces. description=Filtre des données saisies dans SICEN et export d'une liste d'espèces.
version=1.11 version=1.11
author=Conservatoire d'Espaces Naturels de Rhône-Alpes author=Conservatoire d'Espaces Naturels de Rhône-Alpes

View File

@ -5,9 +5,10 @@
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2) # Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
try:
from PyQt5 import QtCore from PyQt5 import QtCore
except:
from PyQt6 import QtCore
qt_resource_data = b"\ qt_resource_data = b"\
\x00\x00\x0d\x89\ \x00\x00\x0d\x89\
\x89\ \x89\

View File

@ -32,8 +32,12 @@ from qgis.utils import iface"""
from builtins import str from builtins import str
from builtins import object from builtins import object
import os import os
from PyQt5.QtCore import * try:
from PyQt5.QtGui import * from PyQt5.QtCore import *
from PyQt5.QtGui import *
except:
from PyQt6.QtCore import *
from PyQt6.QtGui import *
from qgis.PyQt import uic from qgis.PyQt import uic
from qgis.core import * from qgis.core import *
from qgis.core import QgsDataSourceUri, QgsWkbTypes, QgsLayerTreeGroup, QgsLayerTreeLayer from qgis.core import QgsDataSourceUri, QgsWkbTypes, QgsLayerTreeGroup, QgsLayerTreeLayer
@ -152,7 +156,7 @@ class SICEN(object):
def open_about_dialog(self): def open_about_dialog(self):
dialog = AboutDialog(self.iface) dialog = AboutDialog(self.iface)
dialog.exec_() dialog.exec()
def unload(self): def unload(self):
# Remove the plugin menu item and icon # Remove the plugin menu item and icon
@ -265,7 +269,7 @@ class SICEN(object):
# show the dialog # show the dialog
self.dlg.show() self.dlg.show()
# Run the dialog event loop # Run the dialog event loop
result = self.dlg.exec_() result = self.dlg.exec()
# See if OK was pressed # See if OK was pressed
if result == 1: if result == 1:

View File

@ -33,8 +33,8 @@ class Ui_SICEN(object):
SICEN.resize(592, 556) SICEN.resize(592, 556)
self.buttonBox = QDialogButtonBox(SICEN) self.buttonBox = QDialogButtonBox(SICEN)
self.buttonBox.setGeometry(QtCore.QRect(390, 520, 161, 32)) self.buttonBox.setGeometry(QtCore.QRect(390, 520, 161, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) #self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok) self.buttonBox.setStandardButtons(QDialogButtonBox.StandardButton(0x00400000)|QDialogButtonBox.StandardButton(0x00000400))
self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.Titre = QLabel(SICEN) self.Titre = QLabel(SICEN)
self.Titre.setGeometry(QtCore.QRect(110, 10, 331, 31)) self.Titre.setGeometry(QtCore.QRect(110, 10, 331, 31))
@ -46,8 +46,8 @@ class Ui_SICEN(object):
self.Titre.setObjectName(_fromUtf8("Titre")) self.Titre.setObjectName(_fromUtf8("Titre"))
self.Emprise = QTabWidget(SICEN) self.Emprise = QTabWidget(SICEN)
self.Emprise.setGeometry(QtCore.QRect(10, 80, 571, 431)) self.Emprise.setGeometry(QtCore.QRect(10, 80, 571, 431))
self.Emprise.setTabPosition(QTabWidget.North) self.Emprise.setTabPosition(QTabWidget.TabPosition(0))
self.Emprise.setTabShape(QTabWidget.Rounded) self.Emprise.setTabShape(QTabWidget.TabShape(0))
self.Emprise.setObjectName(_fromUtf8("Emprise")) self.Emprise.setObjectName(_fromUtf8("Emprise"))
self.tab_2 = QWidget() self.tab_2 = QWidget()
self.tab_2.setObjectName(_fromUtf8("tab_2")) self.tab_2.setObjectName(_fromUtf8("tab_2"))
@ -57,7 +57,7 @@ class Ui_SICEN(object):
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.groupBox_4.setFont(font) self.groupBox_4.setFont(font)
self.groupBox_4.setAlignment(QtCore.Qt.AlignCenter) self.groupBox_4.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_4.setObjectName(_fromUtf8("groupBox_4")) self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
self.gridLayoutWidget_5 = QWidget(self.groupBox_4) self.gridLayoutWidget_5 = QWidget(self.groupBox_4)
self.gridLayoutWidget_5.setGeometry(QtCore.QRect(10, 20, 521, 51)) self.gridLayoutWidget_5.setGeometry(QtCore.QRect(10, 20, 521, 51))
@ -99,7 +99,7 @@ class Ui_SICEN(object):
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.groupBox_5.setFont(font) self.groupBox_5.setFont(font)
self.groupBox_5.setAlignment(QtCore.Qt.AlignCenter) self.groupBox_5.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_5.setObjectName(_fromUtf8("groupBox_5")) self.groupBox_5.setObjectName(_fromUtf8("groupBox_5"))
self.gridLayoutWidget_6 = QWidget(self.groupBox_5) self.gridLayoutWidget_6 = QWidget(self.groupBox_5)
self.gridLayoutWidget_6.setGeometry(QtCore.QRect(10, 20, 521, 41)) self.gridLayoutWidget_6.setGeometry(QtCore.QRect(10, 20, 521, 41))
@ -113,7 +113,7 @@ class Ui_SICEN(object):
font.setItalic(True) font.setItalic(True)
font.setWeight(50) font.setWeight(50)
self.label.setFont(font) self.label.setFont(font)
self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setAlignment(QtCore.Qt.Alignment(5))
self.label.setObjectName(_fromUtf8("label")) self.label.setObjectName(_fromUtf8("label"))
self.gridLayout_6.addWidget(self.label, 0, 0, 1, 1) self.gridLayout_6.addWidget(self.label, 0, 0, 1, 1)
self.label_2 = QLabel(self.gridLayoutWidget_6) self.label_2 = QLabel(self.gridLayoutWidget_6)
@ -122,7 +122,7 @@ class Ui_SICEN(object):
font.setItalic(True) font.setItalic(True)
font.setWeight(50) font.setWeight(50)
self.label_2.setFont(font) self.label_2.setFont(font)
self.label_2.setAlignment(QtCore.Qt.AlignCenter) self.label_2.setAlignment(QtCore.Qt.Alignment(5))
self.label_2.setObjectName(_fromUtf8("label_2")) self.label_2.setObjectName(_fromUtf8("label_2"))
self.gridLayout_6.addWidget(self.label_2, 0, 1, 1, 1) self.gridLayout_6.addWidget(self.label_2, 0, 1, 1, 1)
self.nom_com_1 = QComboBox(self.gridLayoutWidget_6) self.nom_com_1 = QComboBox(self.gridLayoutWidget_6)
@ -147,7 +147,7 @@ class Ui_SICEN(object):
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.groupBox_7.setFont(font) self.groupBox_7.setFont(font)
self.groupBox_7.setAlignment(QtCore.Qt.AlignCenter) self.groupBox_7.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_7.setObjectName(_fromUtf8("groupBox_7")) self.groupBox_7.setObjectName(_fromUtf8("groupBox_7"))
self.gridLayoutWidget_8 = QWidget(self.groupBox_7) self.gridLayoutWidget_8 = QWidget(self.groupBox_7)
self.gridLayoutWidget_8.setGeometry(QtCore.QRect(10, 20, 520, 191)) self.gridLayoutWidget_8.setGeometry(QtCore.QRect(10, 20, 520, 191))
@ -161,7 +161,7 @@ class Ui_SICEN(object):
font.setItalic(True) font.setItalic(True)
font.setWeight(50) font.setWeight(50)
self.label_3.setFont(font) self.label_3.setFont(font)
self.label_3.setAlignment(QtCore.Qt.AlignCenter) self.label_3.setAlignment(QtCore.Qt.Alignment(5))
self.label_3.setObjectName(_fromUtf8("label_3")) self.label_3.setObjectName(_fromUtf8("label_3"))
self.gridLayout_8.addWidget(self.label_3, 0, 0, 1, 1) self.gridLayout_8.addWidget(self.label_3, 0, 0, 1, 1)
self.label_4 = QLabel(self.gridLayoutWidget_8) self.label_4 = QLabel(self.gridLayoutWidget_8)
@ -170,7 +170,7 @@ class Ui_SICEN(object):
font.setItalic(True) font.setItalic(True)
font.setWeight(50) font.setWeight(50)
self.label_4.setFont(font) self.label_4.setFont(font)
self.label_4.setAlignment(QtCore.Qt.AlignCenter) self.label_4.setAlignment(QtCore.Qt.Alignment(5))
self.label_4.setObjectName(_fromUtf8("label_4")) self.label_4.setObjectName(_fromUtf8("label_4"))
self.gridLayout_8.addWidget(self.label_4, 0, 1, 1, 1) self.gridLayout_8.addWidget(self.label_4, 0, 1, 1, 1)
self.date_min = QCalendarWidget(self.gridLayoutWidget_8) self.date_min = QCalendarWidget(self.gridLayoutWidget_8)
@ -188,7 +188,7 @@ class Ui_SICEN(object):
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.groupBox_8.setFont(font) self.groupBox_8.setFont(font)
self.groupBox_8.setAlignment(QtCore.Qt.AlignCenter) self.groupBox_8.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_8.setObjectName(_fromUtf8("groupBox_8")) self.groupBox_8.setObjectName(_fromUtf8("groupBox_8"))
self.gridLayoutWidget_9 = QWidget(self.groupBox_8) self.gridLayoutWidget_9 = QWidget(self.groupBox_8)
self.gridLayoutWidget_9.setGeometry(QtCore.QRect(10, 20, 491, 21)) self.gridLayoutWidget_9.setGeometry(QtCore.QRect(10, 20, 491, 21))
@ -202,7 +202,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.Animalia.setFont(font) self.Animalia.setFont(font)
self.Animalia.setLayoutDirection(QtCore.Qt.RightToLeft) self.Animalia.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.Animalia.setObjectName(_fromUtf8("Animalia")) self.Animalia.setObjectName(_fromUtf8("Animalia"))
self.gridLayout_9.addWidget(self.Animalia, 0, 0, 1, 1) self.gridLayout_9.addWidget(self.Animalia, 0, 0, 1, 1)
self.Plantae = QCheckBox(self.gridLayoutWidget_9) self.Plantae = QCheckBox(self.gridLayoutWidget_9)
@ -226,8 +226,8 @@ class Ui_SICEN(object):
font.setItalic(True) font.setItalic(True)
font.setWeight(50) font.setWeight(50)
self.label_6.setFont(font) self.label_6.setFont(font)
self.label_6.setLayoutDirection(QtCore.Qt.LeftToRight) self.label_6.setLayoutDirection(QtCore.Qt.LayoutDirection(0))
self.label_6.setAlignment(QtCore.Qt.AlignCenter) self.label_6.setAlignment(QtCore.Qt.Alignment(5))
self.label_6.setObjectName(_fromUtf8("label_6")) self.label_6.setObjectName(_fromUtf8("label_6"))
self.gridLayout_11.addWidget(self.label_6, 4, 0, 1, 1) self.gridLayout_11.addWidget(self.label_6, 4, 0, 1, 1)
self.nom_vern = QComboBox(self.gridLayoutWidget_10) self.nom_vern = QComboBox(self.gridLayoutWidget_10)
@ -245,7 +245,7 @@ class Ui_SICEN(object):
font.setItalic(True) font.setItalic(True)
font.setWeight(50) font.setWeight(50)
self.label_5.setFont(font) self.label_5.setFont(font)
self.label_5.setAlignment(QtCore.Qt.AlignCenter) self.label_5.setAlignment(QtCore.Qt.Alignment(5))
self.label_5.setObjectName(_fromUtf8("label_5")) self.label_5.setObjectName(_fromUtf8("label_5"))
self.gridLayout_11.addWidget(self.label_5, 2, 0, 1, 1) self.gridLayout_11.addWidget(self.label_5, 2, 0, 1, 1)
self.nom_complet = QComboBox(self.gridLayoutWidget_10) self.nom_complet = QComboBox(self.gridLayoutWidget_10)
@ -271,7 +271,7 @@ class Ui_SICEN(object):
font.setItalic(True) font.setItalic(True)
font.setWeight(50) font.setWeight(50)
self.label_13.setFont(font) self.label_13.setFont(font)
self.label_13.setAlignment(QtCore.Qt.AlignCenter) self.label_13.setAlignment(QtCore.Qt.Alignment(5))
self.label_13.setObjectName(_fromUtf8("label_13")) self.label_13.setObjectName(_fromUtf8("label_13"))
self.gridLayout_11.addWidget(self.label_13, 0, 0, 1, 1) self.gridLayout_11.addWidget(self.label_13, 0, 0, 1, 1)
self.Emprise.addTab(self.tab, _fromUtf8("")) self.Emprise.addTab(self.tab, _fromUtf8(""))
@ -279,8 +279,8 @@ class Ui_SICEN(object):
self.tab_3.setObjectName(_fromUtf8("tab_3")) self.tab_3.setObjectName(_fromUtf8("tab_3"))
self.protections = QToolBox(self.tab_3) self.protections = QToolBox(self.tab_3)
self.protections.setGeometry(QtCore.QRect(10, 10, 511, 391)) self.protections.setGeometry(QtCore.QRect(10, 10, 511, 391))
self.protections.setFrameShape(QFrame.NoFrame) self.protections.setFrameShape(QFrame.Shape(0))
self.protections.setFrameShadow(QFrame.Plain) self.protections.setFrameShadow(QFrame.Shadow(0x0010))
self.protections.setLineWidth(1) self.protections.setLineWidth(1)
self.protections.setObjectName(_fromUtf8("protections")) self.protections.setObjectName(_fromUtf8("protections"))
self.page_2 = QWidget() self.page_2 = QWidget()
@ -292,7 +292,7 @@ class Ui_SICEN(object):
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.groupBox.setFont(font) self.groupBox.setFont(font)
self.groupBox.setAlignment(QtCore.Qt.AlignCenter) self.groupBox.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox.setObjectName(_fromUtf8("groupBox")) self.groupBox.setObjectName(_fromUtf8("groupBox"))
self.gridLayoutWidget_2 = QWidget(self.groupBox) self.gridLayoutWidget_2 = QWidget(self.groupBox)
self.gridLayoutWidget_2.setGeometry(QtCore.QRect(10, 20, 491, 88)) self.gridLayoutWidget_2.setGeometry(QtCore.QRect(10, 20, 491, 88))
@ -306,7 +306,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.LRD_38.setFont(font) self.LRD_38.setFont(font)
self.LRD_38.setLayoutDirection(QtCore.Qt.RightToLeft) self.LRD_38.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRD_38.setObjectName(_fromUtf8("LRD_38")) self.LRD_38.setObjectName(_fromUtf8("LRD_38"))
self.gridLayout_2.addWidget(self.LRD_38, 3, 0, 1, 1) self.gridLayout_2.addWidget(self.LRD_38, 3, 0, 1, 1)
self.LRD_01 = QCheckBox(self.gridLayoutWidget_2) self.LRD_01 = QCheckBox(self.gridLayoutWidget_2)
@ -314,7 +314,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.LRD_01.setFont(font) self.LRD_01.setFont(font)
self.LRD_01.setLayoutDirection(QtCore.Qt.RightToLeft) self.LRD_01.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRD_01.setObjectName(_fromUtf8("LRD_01")) self.LRD_01.setObjectName(_fromUtf8("LRD_01"))
self.gridLayout_2.addWidget(self.LRD_01, 0, 0, 1, 1) self.gridLayout_2.addWidget(self.LRD_01, 0, 0, 1, 1)
self.LRD_07 = QCheckBox(self.gridLayoutWidget_2) self.LRD_07 = QCheckBox(self.gridLayoutWidget_2)
@ -322,7 +322,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.LRD_07.setFont(font) self.LRD_07.setFont(font)
self.LRD_07.setLayoutDirection(QtCore.Qt.RightToLeft) self.LRD_07.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRD_07.setObjectName(_fromUtf8("LRD_07")) self.LRD_07.setObjectName(_fromUtf8("LRD_07"))
self.gridLayout_2.addWidget(self.LRD_07, 1, 0, 1, 1) self.gridLayout_2.addWidget(self.LRD_07, 1, 0, 1, 1)
self.LRD_26 = QCheckBox(self.gridLayoutWidget_2) self.LRD_26 = QCheckBox(self.gridLayoutWidget_2)
@ -330,7 +330,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.LRD_26.setFont(font) self.LRD_26.setFont(font)
self.LRD_26.setLayoutDirection(QtCore.Qt.RightToLeft) self.LRD_26.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRD_26.setObjectName(_fromUtf8("LRD_26")) self.LRD_26.setObjectName(_fromUtf8("LRD_26"))
self.gridLayout_2.addWidget(self.LRD_26, 2, 0, 1, 1) self.gridLayout_2.addWidget(self.LRD_26, 2, 0, 1, 1)
self.LRD_42 = QCheckBox(self.gridLayoutWidget_2) self.LRD_42 = QCheckBox(self.gridLayoutWidget_2)
@ -367,7 +367,7 @@ class Ui_SICEN(object):
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.groupBox_2.setFont(font) self.groupBox_2.setFont(font)
self.groupBox_2.setAlignment(QtCore.Qt.AlignCenter) self.groupBox_2.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
self.gridLayoutWidget_3 = QWidget(self.groupBox_2) self.gridLayoutWidget_3 = QWidget(self.groupBox_2)
self.gridLayoutWidget_3.setGeometry(QtCore.QRect(10, 20, 491, 42)) self.gridLayoutWidget_3.setGeometry(QtCore.QRect(10, 20, 491, 42))
@ -381,7 +381,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.LRR_Flore.setFont(font) self.LRR_Flore.setFont(font)
self.LRR_Flore.setLayoutDirection(QtCore.Qt.RightToLeft) self.LRR_Flore.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRR_Flore.setObjectName(_fromUtf8("LRR_Flore")) self.LRR_Flore.setObjectName(_fromUtf8("LRR_Flore"))
self.gridLayout_3.addWidget(self.LRR_Flore, 0, 0, 1, 1) self.gridLayout_3.addWidget(self.LRR_Flore, 0, 0, 1, 1)
self.LRR_Oiseaux = QCheckBox(self.gridLayoutWidget_3) self.LRR_Oiseaux = QCheckBox(self.gridLayoutWidget_3)
@ -389,7 +389,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.LRR_Oiseaux.setFont(font) self.LRR_Oiseaux.setFont(font)
self.LRR_Oiseaux.setLayoutDirection(QtCore.Qt.RightToLeft) self.LRR_Oiseaux.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRR_Oiseaux.setObjectName(_fromUtf8("LRR_Oiseaux")) self.LRR_Oiseaux.setObjectName(_fromUtf8("LRR_Oiseaux"))
self.gridLayout_3.addWidget(self.LRR_Oiseaux, 1, 0, 1, 1) self.gridLayout_3.addWidget(self.LRR_Oiseaux, 1, 0, 1, 1)
self.LRR_Autre = QCheckBox(self.gridLayoutWidget_3) self.LRR_Autre = QCheckBox(self.gridLayoutWidget_3)
@ -405,7 +405,7 @@ class Ui_SICEN(object):
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.groupBox_3.setFont(font) self.groupBox_3.setFont(font)
self.groupBox_3.setAlignment(QtCore.Qt.AlignCenter) self.groupBox_3.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
self.gridLayoutWidget_4 = QWidget(self.groupBox_3) self.gridLayoutWidget_4 = QWidget(self.groupBox_3)
self.gridLayoutWidget_4.setGeometry(QtCore.QRect(10, 20, 491, 42)) self.gridLayoutWidget_4.setGeometry(QtCore.QRect(10, 20, 491, 42))
@ -426,7 +426,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.LRN_Flore.setFont(font) self.LRN_Flore.setFont(font)
self.LRN_Flore.setLayoutDirection(QtCore.Qt.RightToLeft) self.LRN_Flore.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRN_Flore.setObjectName(_fromUtf8("LRN_Flore")) self.LRN_Flore.setObjectName(_fromUtf8("LRN_Flore"))
self.gridLayout_4.addWidget(self.LRN_Flore, 0, 0, 1, 1) self.gridLayout_4.addWidget(self.LRN_Flore, 0, 0, 1, 1)
self.LRN_Oiseaux = QCheckBox(self.gridLayoutWidget_4) self.LRN_Oiseaux = QCheckBox(self.gridLayoutWidget_4)
@ -434,7 +434,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.LRN_Oiseaux.setFont(font) self.LRN_Oiseaux.setFont(font)
self.LRN_Oiseaux.setLayoutDirection(QtCore.Qt.RightToLeft) self.LRN_Oiseaux.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRN_Oiseaux.setObjectName(_fromUtf8("LRN_Oiseaux")) self.LRN_Oiseaux.setObjectName(_fromUtf8("LRN_Oiseaux"))
self.gridLayout_4.addWidget(self.LRN_Oiseaux, 1, 0, 1, 1) self.gridLayout_4.addWidget(self.LRN_Oiseaux, 1, 0, 1, 1)
self.LRN_Ortho = QCheckBox(self.gridLayoutWidget_4) self.LRN_Ortho = QCheckBox(self.gridLayoutWidget_4)
@ -456,7 +456,7 @@ class Ui_SICEN(object):
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.UICN.setFont(font) self.UICN.setFont(font)
self.UICN.setLayoutDirection(QtCore.Qt.RightToLeft) self.UICN.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.UICN.setObjectName(_fromUtf8("UICN")) self.UICN.setObjectName(_fromUtf8("UICN"))
self.gridLayout_12.addWidget(self.UICN, 0, 0, 1, 1) self.gridLayout_12.addWidget(self.UICN, 0, 0, 1, 1)
self.LRE = QCheckBox(self.gridLayoutWidget_11) self.LRE = QCheckBox(self.gridLayoutWidget_11)
@ -485,19 +485,19 @@ class Ui_SICEN(object):
self.gridLayout.setHorizontalSpacing(50) self.gridLayout.setHorizontalSpacing(50)
self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.PATRI38 = QCheckBox(self.gridLayoutWidget) self.PATRI38 = QCheckBox(self.gridLayoutWidget)
self.PATRI38.setLayoutDirection(QtCore.Qt.RightToLeft) self.PATRI38.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PATRI38.setObjectName(_fromUtf8("PATRI38")) self.PATRI38.setObjectName(_fromUtf8("PATRI38"))
self.gridLayout.addWidget(self.PATRI38, 3, 0, 1, 1) self.gridLayout.addWidget(self.PATRI38, 3, 0, 1, 1)
self.PATRI01 = QCheckBox(self.gridLayoutWidget) self.PATRI01 = QCheckBox(self.gridLayoutWidget)
self.PATRI01.setLayoutDirection(QtCore.Qt.RightToLeft) self.PATRI01.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PATRI01.setObjectName(_fromUtf8("PATRI01")) self.PATRI01.setObjectName(_fromUtf8("PATRI01"))
self.gridLayout.addWidget(self.PATRI01, 0, 0, 1, 1) self.gridLayout.addWidget(self.PATRI01, 0, 0, 1, 1)
self.PATRI07 = QCheckBox(self.gridLayoutWidget) self.PATRI07 = QCheckBox(self.gridLayoutWidget)
self.PATRI07.setLayoutDirection(QtCore.Qt.RightToLeft) self.PATRI07.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PATRI07.setObjectName(_fromUtf8("PATRI07")) self.PATRI07.setObjectName(_fromUtf8("PATRI07"))
self.gridLayout.addWidget(self.PATRI07, 1, 0, 1, 1) self.gridLayout.addWidget(self.PATRI07, 1, 0, 1, 1)
self.PATRI26 = QCheckBox(self.gridLayoutWidget) self.PATRI26 = QCheckBox(self.gridLayoutWidget)
self.PATRI26.setLayoutDirection(QtCore.Qt.RightToLeft) self.PATRI26.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PATRI26.setObjectName(_fromUtf8("PATRI26")) self.PATRI26.setObjectName(_fromUtf8("PATRI26"))
self.gridLayout.addWidget(self.PATRI26, 2, 0, 1, 1) self.gridLayout.addWidget(self.PATRI26, 2, 0, 1, 1)
self.PATRI42 = QCheckBox(self.gridLayoutWidget) self.PATRI42 = QCheckBox(self.gridLayoutWidget)
@ -529,7 +529,7 @@ class Ui_SICEN(object):
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.groupBox_6.setFont(font) self.groupBox_6.setFont(font)
self.groupBox_6.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.groupBox_6.setAlignment(QtCore.Qt.AlignmentFlag(0x0001)|QtCore.Qt.AlignmentFlag(0x0001)|QtCore.Qt.AlignmentFlag(0x0080))
self.groupBox_6.setObjectName(_fromUtf8("groupBox_6")) self.groupBox_6.setObjectName(_fromUtf8("groupBox_6"))
self.gridLayoutWidget_7 = QWidget(self.groupBox_6) self.gridLayoutWidget_7 = QWidget(self.groupBox_6)
self.gridLayoutWidget_7.setGeometry(QtCore.QRect(10, 20, 491, 21)) self.gridLayoutWidget_7.setGeometry(QtCore.QRect(10, 20, 491, 21))
@ -550,7 +550,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.PD_38.setFont(font) self.PD_38.setFont(font)
self.PD_38.setLayoutDirection(QtCore.Qt.RightToLeft) self.PD_38.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PD_38.setObjectName(_fromUtf8("PD_38")) self.PD_38.setObjectName(_fromUtf8("PD_38"))
self.gridLayout_7.addWidget(self.PD_38, 0, 0, 1, 1) self.gridLayout_7.addWidget(self.PD_38, 0, 0, 1, 1)
self.PR = QCheckBox(self.page_3) self.PR = QCheckBox(self.page_3)
@ -604,14 +604,14 @@ class Ui_SICEN(object):
self.label_12.setObjectName(_fromUtf8("label_12")) self.label_12.setObjectName(_fromUtf8("label_12"))
self.gridLayout_10.addWidget(self.label_12, 1, 1, 1, 1) self.gridLayout_10.addWidget(self.label_12, 1, 1, 1, 1)
self.buffer = QLineEdit(self.gridLayoutWidget_12) self.buffer = QLineEdit(self.gridLayoutWidget_12)
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy = QSizePolicy(QSizePolicy.Policy(4), QSizePolicy.Policy(0))
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.buffer.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.buffer.sizePolicy().hasHeightForWidth())
self.buffer.setSizePolicy(sizePolicy) self.buffer.setSizePolicy(sizePolicy)
self.buffer.setMaximumSize(QtCore.QSize(100, 16777215)) self.buffer.setMaximumSize(QtCore.QSize(100, 16777215))
self.buffer.setInputMethodHints(QtCore.Qt.ImhPreferNumbers) self.buffer.setInputMethodHints(QtCore.Qt.InputMethodHint(0x8))
self.buffer.setAlignment(QtCore.Qt.AlignCenter) self.buffer.setAlignment(QtCore.Qt.Alignment(5))
self.buffer.setObjectName(_fromUtf8("buffer")) self.buffer.setObjectName(_fromUtf8("buffer"))
self.gridLayout_10.addWidget(self.buffer, 2, 2, 1, 1) self.gridLayout_10.addWidget(self.buffer, 2, 2, 1, 1)
self.label_8 = QLabel(self.gridLayoutWidget_12) self.label_8 = QLabel(self.gridLayoutWidget_12)
@ -664,7 +664,7 @@ class Ui_SICEN(object):
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.bouton_geom.setFont(font) self.bouton_geom.setFont(font)
self.bouton_geom.setLayoutDirection(QtCore.Qt.LeftToRight) self.bouton_geom.setLayoutDirection(QtCore.Qt.LayoutDirection(0))
self.bouton_geom.setText(_fromUtf8("")) self.bouton_geom.setText(_fromUtf8(""))
self.bouton_geom.setIconSize(QtCore.QSize(20, 20)) self.bouton_geom.setIconSize(QtCore.QSize(20, 20))
self.bouton_geom.setObjectName(_fromUtf8("bouton_geom")) self.bouton_geom.setObjectName(_fromUtf8("bouton_geom"))