Sorry about not investigating, I expected someone to have bitten by now. I had a quick look, and it looks like this is a bug; it works perfectly fine outside of Maya, even via MayaPy. Likely something to do with events getting discarded by Maya when getting put on hold by the modal dialog.
A simple solution would be to simply connect to .clicked instead of .pressed. The .clicked signal is emitted *after* the button has been unpressed, ergo it may still get stuck, but stuck in a more visually pleasing state. *wink*. On 8 January 2016 at 11:18, Ben Hearn <[email protected]> wrote: > I thought you might appreciate it :) > > I cannot figure it out. If you set the infomation box to be non-modal it > works just fine. But non-modal allows interaction with the dialog in the > background which is not ideal at all. > > On Friday, 8 January 2016 11:59:33 UTC+1, Marcus Ottosson wrote: >> >> Runnable code snippet, even better. :) >> >> On 8 January 2016 at 10:39, Ben Hearn <[email protected]> wrote: >> >>> Hey Marcus, >>> >>> Run this in Maya and it should illustrate my issue :) >>> >>> https://gist.github.com/ben-hearn-sb/2b22edb528049d42fa65 >>> >>> On Friday, 8 January 2016 11:17:08 UTC+1, Marcus Ottosson wrote: >>>> >>>> A screenshot or something would really help communicate this problem >>>> more clearly, ideally a gif/animation of it happening. >>>> >>>> On 8 January 2016 at 10:07, Ben Hearn <[email protected]> wrote: >>>> >>>>> Hello all, >>>>> >>>>> Probably a bit of a simpler question but I am having some strange >>>>> behaviour with my UI. I have seen it before but I think I worked around >>>>> it >>>>> rather than actually figuring out why and how to stop it. >>>>> >>>>> So when I press the export button in my UI and the process is complete >>>>> I alert the user with a QInformation box. >>>>> >>>>> The problem arises when you press ok....the Export QPushButton stays >>>>> depressed. It does not highlight anymore and when you press it again, >>>>> although the functionality still works, it does not have the satisfying >>>>> feel and look of being actually pressed. >>>>> >>>>> I changed the info box so it was a standard message box and set the >>>>> box to be non-modal and this fixed it but it is not what I am after. >>>>> >>>>> Am I right in thinking it has something to do with the callback not >>>>> returning properly? >>>>> >>>>> The push button line is very simple: >>>>> *btnExportSelection.pressed.connect(self.exportSelected)* >>>>> >>>>> Cheers, >>>>> >>>>> Ben >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Python Programming for Autodesk Maya" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/python_inside_maya/c1acad50-7232-41c0-b122-68cb03977320%40googlegroups.com >>>>> <https://groups.google.com/d/msgid/python_inside_maya/c1acad50-7232-41c0-b122-68cb03977320%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> >>>> >>>> -- >>>> *Marcus Ottosson* >>>> [email protected] >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Python Programming for Autodesk Maya" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/python_inside_maya/78971910-669a-4e04-b390-8de4da904ce9%40googlegroups.com >>> <https://groups.google.com/d/msgid/python_inside_maya/78971910-669a-4e04-b390-8de4da904ce9%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> *Marcus Ottosson* >> [email protected] >> > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/a80f819c-bd51-4af8-8db2-db99d22b0737%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/a80f819c-bd51-4af8-8db2-db99d22b0737%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBCvyEwuhNMJvi6nQGCrCObmYWgub71Caw%3D-oxtADL5ww%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
