Class issue in connect definition
-
@heedaf said in Class issue in connect definition:
self.pushButton.clicked.connect(Dialog.SB_UP_click)
You're already connecting, so what does not work?
And please indent your code properly: it is hard to read.
-
Hi,
You do not have any widget named label_2 be it in your designer part or your MainWindow class.
You have one that is named label that you can access through "self.ui".
-
I see.
You did the connection in the wrong class.
Setup the connection in your MainWindow class not the one that is building the UI.Wrong code reading, it's really just the slot that has an error.
-
No this one:
@heedaf said in Class issue in connect definition:
self.pushButton.clicked.connect(Dialog.SB_UP_click)
-
No this one:
@heedaf said in Class issue in connect definition:
self.pushButton.clicked.connect(Dialog.SB_UP_click)
-
Late night strikes again ! :-D
I misread the code.Your slot should be something like:
def SB_UP_click(self): print("SB UP") self.ui.label.setText("HI") print("got here")
-
You likely forgot the .ui between the self and .label.
Working with designer based UI requires some getting used to since you have all the code in the same file.
You have the Ui_XXX classes for the aesthetics of your widget (and which is auto generated) and the corresponding XXX that is for the logic you want to apply.