I have a form from which I can launch various Test Modules.

The Form has 16 PushButtons, one for each of the possible Modules.

I need to disable Button_2 through Button_11 until the Modules that are connected to Button_1 and Button_0 are succesfully completed.

The Buttons are on a pyQT mainwindow, tabbed form which is referenced by a class titled, "tcmainform".

tcmainform is in turn instansiated? as simply, "form"

Again, what I want to do is disable/enabled buttons in the main code stream.

Is there a way to do it.

I would post my code for your review but NMCI will not allow any of my development stuff on their network which is the only way I can view/post on the web while at work.

Mike Sr.

6 Years
Discussion Span
Last Post by Gribouillis

This code works for a range of "Button_xx"

    for i in range(16):
        Selection.append(getattr(tcDict.get("form"), "Button_%d" %(i+1)))

What had me "stumped" was I forgot that the QT calls are "Functions" to which you "pass" a parameter not "set" a parameter.

that is: Selection.setEnabled = False will not work

My VB6 days getting in the way... :)

Edited by SpiritualMadMan: n/a

Votes + Comments
Thanks for sharing.

Is there a way to check if the button is disabled or not? I want to enable them ..IF ..they are disabled

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.