qpushbutton

PyQt5 designer gui and iterate/loop over QPushButton [duplicate]

試著忘記壹切 提交于 2021-01-29 14:44:26
问题 This question already has answers here : Python 'called with the wrong argument type' error (1 answer) Set properties of multiple QLineEdit using a loop (3 answers) Closed 9 months ago . Hi I have a GUI with 26 QPushButtons named A to Z, using uicload I load into my Main class is there any way to loop over them to end up with something self.A.clicked.connect(self.foo(A)) # .. self.Z.clicked.connect(self.foo(Z)) tried different ways but I end up always with either a syntax error or a

PyQt widget border color transparent - but button inside normal border

旧时模样 提交于 2021-01-29 12:29:15
问题 I want the border of my QTWidgets.QWidget to be transparent or disabled (borderwidth=0), but when I set it via the stylesheet to "border:0", also all the push buttons inside the widget dont have a border - any idea how to keep the style of the pushbuttons and only change the widget border ? class lamp_frame(object): def setupUi(self, window): window.setObjectName("Yeelight Controlle") window.resize(460, 140+self.window_hight) window.setFixedSize(460, 140+self.window_hight) self.frame_0 =

Qt signal slot button

纵饮孤独 提交于 2021-01-07 07:00:39
问题 I need to change my text in QLabel every time when I clicked in order to my info updates. When I change the value of A, the value of B must change, too. I have two button that can change values in two QLabel (value of A, value of B). main.cpp: Counter A, B; QObject::connect(&A, &Counter::changeValue, &B, &Counter::setValue); QObject::connect(&A, &Counter::changeValue, &B, &Counter::Increment); QObject::connect(&A, &Counter::changeValue, &B, &Counter::Decrement ); QObject::connect(Add,

“Blinking” buttons in PyQT5

蹲街弑〆低调 提交于 2020-12-15 10:24:36
问题 Here's the deal: I'm trying to make button A "blink" when button B is pushed, and the blinking should then stop when the user pushes button A. Furthermore, button A should then go back to its former state. After long reading through the documentation and other questions at SO, I have now following piece of code: Python 2.7 class Widget(QWidget): def __init__(self): super(Widget, self).__init__() self.resize(300,200) layout = QVBoxLayout(self) self.button_stop = QPushButton("Stop") layout

“Blinking” buttons in PyQT5

我怕爱的太早我们不能终老 提交于 2020-12-15 10:20:56
问题 Here's the deal: I'm trying to make button A "blink" when button B is pushed, and the blinking should then stop when the user pushes button A. Furthermore, button A should then go back to its former state. After long reading through the documentation and other questions at SO, I have now following piece of code: Python 2.7 class Widget(QWidget): def __init__(self): super(Widget, self).__init__() self.resize(300,200) layout = QVBoxLayout(self) self.button_stop = QPushButton("Stop") layout

Creating PyQt5 buttons in a loop: all buttons trigger the same callback

丶灬走出姿态 提交于 2020-11-27 04:04:37
问题 I should mention that I've read these but I'm still unable to achieve my goal: [Using a dictionary in a for loop to create buttons doesn't work [QtCore.QObject.connect in a loop only affects the last instance My goal is to make a linux 'launcher' application. Button creation, placement, etc. is working like a charm but there's one problem - all buttons trigger the same callback - the last one to be connected in the button creation loop. Here's a basic version of the script to illustrate what

Creating PyQt5 buttons in a loop: all buttons trigger the same callback

ぃ、小莉子 提交于 2020-11-27 04:02:42
问题 I should mention that I've read these but I'm still unable to achieve my goal: [Using a dictionary in a for loop to create buttons doesn't work [QtCore.QObject.connect in a loop only affects the last instance My goal is to make a linux 'launcher' application. Button creation, placement, etc. is working like a charm but there's one problem - all buttons trigger the same callback - the last one to be connected in the button creation loop. Here's a basic version of the script to illustrate what