0

I am working on a Touchscreen application. For this I Need to Change the current window if user clicks on the Screen (Position doesn't matter). For this I Need a to make my button (which is currently the same size as the current window) invisble, so user can see the Labels etc. Any idea how to make Buttons invisible in PyQt4?

user3551782
  • 153
  • 2
  • 4
  • 10
  • May: http://stackoverflow.com/questions/6460937/is-there-a-hide-property-for-pushbutton-in-qtcreator Do you want to do anything with the invisble btn!? – Azd325 Apr 23 '14 at 12:27
  • Why are you trying to do? You want to change your window when the user clicks on it on when clicks on any part of the screen (and possible outside of your window)? Maybe you could use event filters or override some mouse event. – Alvaro Fuentes Apr 23 '14 at 13:36
  • @Azd325 I gather the OP wants to use "huge" button with stuff in it (labels etc) such that if user clicks anywhere in the window, the on-press handler will be called. – Oliver Apr 23 '14 at 18:41

1 Answers1

1

I recommend you not use a button to do this. Instead, either put an event filter on the QApplication instance, so any widgets in your window get events only if you determine they should; OR put a transparent panel widget over the touch area, with a mouse click event handler for that panel. Either method supports arbitrary complexity of widgets inside your touch area (labels and tables to display information etc). Main disadvantage with event filter approach is that all application events (from all threads) will be filtered. This could affect performance (you'd have to test, may not be any noticeable differenc), but it is simpler to implement than the transparent panel.

Oliver
  • 27,510
  • 9
  • 72
  • 103