# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2017 EDF R&D
+# Copyright (C) 2007-2020 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
from InterfaceQT4.qtSaisie import SaisieValeur
from PyQt5.QtWidgets import QComboBox, QCompleter
-from PyQt5.QtCore import Qt
+from PyQt5.QtCore import Qt, QEvent
class MonWidgetCBCommun (Feuille):
self.determineChoix()
self.setValeursApresBouton()
self.CBChoix.currentIndexChanged.connect(self.choixSaisi)
- #self.CBChoix.lineEdit().setText(tr("Select"))
self.parentQt.commandesLayout.insertWidget(-1,self)
self.maCommande.listeAffichageWidget.append(self.CBChoix)
self.AAfficher=self.CBChoix
def setValeursApresBouton(self):
if self.objSimp.getValeur()==None :
self.CBChoix.setCurrentIndex(-1)
- #self.CBChoix.lineEdit().setStyleSheet(("QLineEdit {" " background:yellow;\n" "font: italic ;\n" " }\n" " "))
self.CBChoix.lineEdit().setText(tr("Select"))
return
valeur=self.objSimp.getValeur()
SaisieValeur.LEvaleurPressed(self,valeur)
self.reaffiche()
+ def wheelEvent(self, event):
+ # Sinon poum sur les fenetres trop longues
+ # lorsque la widget attrape le wheelevent
+ event.ignore();
+
+
class MonWidgetCB (Ui_WidgetCB, MonWidgetCBCommun):
def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
- self.maListeDeValeur=monSimpDef.into
+ self.maListeDeValeur = monSimpDef.into
MonWidgetCBCommun. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
class MonWidgetCBSD (Ui_WidgetCB,MonWidgetCBCommun):
def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
- self.maListeDeValeur=node.item.getSdAvantDuBonType()
+ self.maListeDeValeur = node.item.getSdAvantDuBonType()
MonWidgetCBCommun.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2017 EDF R&D
+# Copyright (C) 2007-2020 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
class MonWidgetCBIntoSug (MonWidgetCBCommun, Ui_WidgetCBIntoSug,GereAjoutDsPossible):
def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
self.maListeDeValeur=monSimpDef.into
- if node.item.hasIntoSug() : self.maListeDeValeur=node.item.getListePossibleAvecSug([])
- if hasattr(node.item,'suggestion') : self.maListeDeValeur+= node.item.suggestion
+ if node.item.hasIntoSug() : self.maListeDeValeur = node.item.getListePossibleAvecSug([])
+ if hasattr(node.item,'suggestion') : self.maListeDeValeur += node.item.suggestion
MonWidgetCBCommun. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
self.lineEditVal.returnPressed.connect(self.LEValeurAjouteDsPossible)
def ajouteValeurPossible(self,valeur):
self.CBChoix.addItem(valeur)
# on ne sait pas si on a deja ajouté une valeur
- try : self.node.item.suggestion.append(valeur)
- except : self.node.item.suggestion=(valeur,)
+ try : self.node.item.suggestion.append(valeur)
+ except : self.node.item.suggestion = (valeur,)
self.lineEditVal.setText('')
self.CBChoix.setCurrentIndex(self.CBChoix.findText(valeur));