Fix Erreur sur QMessageBox
This commit is contained in:
parent
f2d11a64e4
commit
4851339008
@ -11,10 +11,14 @@ 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
|
||||||
|
try:
|
||||||
from qgis.PyQt.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
from qgis.PyQt.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
from qgis.PyQt import QtGui
|
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
|
||||||
@ -531,11 +535,11 @@ var Travaux = L.geoJSON(TravauxJSON,{
|
|||||||
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !",
|
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(
|
"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)",
|
self.tableWidget_2.rowCount()) + " flux sélectionnés ? (risque de plantage de QGIS)",
|
||||||
QMessageBox.Yes | QMessageBox.No)
|
QMessageBox.StandardButton(0x00004000)|QMessageBox.StandardButton(0x00010000))
|
||||||
if self.QMBquestion == QMessageBox.Yes:
|
if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
|
||||||
self.chargement_flux()
|
self.chargement_flux()
|
||||||
|
|
||||||
if self.QMBquestion == QMessageBox.No:
|
if self.QMBquestion == QMessageBox.StandardButton(0x00001000):
|
||||||
print("Annulation du chargement des couches")
|
print("Annulation du chargement des couches")
|
||||||
|
|
||||||
if self.tableWidget_2.rowCount() <= 5:
|
if self.tableWidget_2.rowCount() <= 5:
|
||||||
@ -623,7 +627,7 @@ var Travaux = L.geoJSON(TravauxJSON,{
|
|||||||
# Ajout de la couche au canevas QGIS
|
# Ajout de la couche au canevas QGIS
|
||||||
QgsProject.instance().addMapLayer(layer)
|
QgsProject.instance().addMapLayer(layer)
|
||||||
else:
|
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):
|
def combobox_custom(self):
|
||||||
if dbtype == sigdb:
|
if dbtype == sigdb:
|
||||||
self.toolButton.setEnabled(1)
|
self.toolButton.setEnabled(1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user