Python Forum
[PyQt] No reaction and no error message when clicking button
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] No reaction and no error message when clicking button
#4
(Nov-22-2018, 03:19 PM)Atalanttore Wrote: 1. Does your explanation mean that every window instantiated after the main window always needs to be an attribute of another object?

I think that when you have a blocking window, such as:

        msg = QtWidgets.QInputDialog()
        print(msg.exec_())
You don't need to attribute it to self. In your case, the show() method was not blocking, so the new window is destroyed right after the execution of the method (I could see the window appearing for a fraction of a sec).

(Nov-22-2018, 03:19 PM)Atalanttore Wrote: 2. What's the reason for changing the (constant) class variable 'COLORS' to an object variable 'self.COLORS'?

I just felt that it was weird to see a variable declared there. But to avoid clutter in the top of your class I would rather save this space for declarations that requires it (Qt macros or thread signals). I'm not sure about what the best practice, so it might just be a matter of personnal preferences but I think it make more sense this way.
Reply


Messages In This Thread
RE: No reaction and no error message when clicking button - by Alfalfa - Nov-22-2018, 06:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] error message the_wolf_dz 4 2,067 Oct-24-2022, 07:24 PM
Last Post: deanhystad
  [Tkinter] Clicking on the button crashes the TK window ODOshmockenberg 1 2,258 Mar-10-2022, 05:18 PM
Last Post: deanhystad
  [Tkinter] Button error Tyrel 2 2,018 Jun-20-2021, 07:21 AM
Last Post: Tyrel
  Error message box and quit app Kumarkv 1 2,259 May-19-2020, 07:05 PM
Last Post: Larz60+
  [Tkinter] How to make message box error stay on top of window scratchmyhead 1 8,324 May-10-2020, 10:21 PM
Last Post: scratchmyhead
  Need tkinter help with clicking buttons pythonprogrammer 2 2,485 Jan-03-2020, 04:43 AM
Last Post: joe_momma
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 5,043 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp
  [Tkinter] RE: status bar to return to the centre after 1 minute of clicking a button ? chano 6 4,732 May-27-2019, 04:24 PM
Last Post: Yoriz
  tkinter- adding a new window after clicking a button built on the gui ShashankDS 2 6,646 Apr-18-2019, 12:48 PM
Last Post: ShashankDS
  [Tkinter] Adding New TAB to NoteBook Widget by Clicking Vicolas 0 2,632 Feb-15-2019, 06:03 PM
Last Post: Vicolas

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020