Fix Erreur sur QMessageBox

This commit is contained in:
Tom LAVEILLE 2025-07-21 11:27:11 +02:00
parent f2d11a64e4
commit 4851339008

View File

@ -11,10 +11,14 @@ 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 qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.PyQt 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
@ -531,11 +535,11 @@ var Travaux = L.geoJSON(TravauxJSON,{
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !",
"Le nombre de flux à charger en une seule fois est limité à 5 pour des questions de performances. Souhaitez vous tout de même charger les " + str(
self.tableWidget_2.rowCount()) + " flux sélectionnés ? (risque de plantage de QGIS)",
QMessageBox.Yes | QMessageBox.No)
if self.QMBquestion == QMessageBox.Yes:
QMessageBox.StandardButton(0x00004000)|QMessageBox.StandardButton(0x00010000))
if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
self.chargement_flux()
if self.QMBquestion == QMessageBox.No:
if self.QMBquestion == QMessageBox.StandardButton(0x00001000):
print("Annulation du chargement des couches")
if self.tableWidget_2.rowCount() <= 5:
@ -623,7 +627,7 @@ var Travaux = L.geoJSON(TravauxJSON,{
# Ajout de la couche au canevas QGIS
QgsProject.instance().addMapLayer(layer)
else:
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !","La couche «" + str(self.tableWidget_2.item(row,1).text()) +' '+ str(self.tableWidget_2.item(row,2).text()) + "» ne ce trouve pas dans cette BD !",QMessageBox.Yes)
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !","La couche «" + str(self.tableWidget_2.item(row,1).text()) +' '+ str(self.tableWidget_2.item(row,2).text()) + "» ne ce trouve pas dans cette BD !",QMessageBox.StandardButton(0x00004000))
def combobox_custom(self):
if dbtype == sigdb:
self.toolButton.setEnabled(1)