[SOLVED] Emit a signal when a subwindow is clicked



  • Hello,

    I have a bunch of widgets (mini screens) that I put into subwindows of an mdiarea. I would like to find a way to emit a signal when one of the subwindows are clicked or double clicked. The click should have an effect anywhere within the subwindow. I figured I could use QtDesigner and right click the widget main area and just us the Go to Slot approach, but there was no clicked() signal so that wont work. Any ideas?


  • Lifetime Qt Champion

    Hi,

    You have to possibilities:

    add an event filter for your mini screens and watch for the QMouseEvent

    subclass your mini-screens widget, add a clicked signal, reimplement the event function and emit the signal from there.

    Hope it helps



  • OK, thanks. I will try it out now.



  • [quote author="SGaist" date="1372018954"]Hi,

    You have to possibilities:

    add an event filter for your mini screens and watch for the QMouseEvent

    subclass your mini-screens widget, add a clicked signal, reimplement the event function and emit the signal from there.

    Hope it helps[/quote]

    Excellent. I went with the eventFilter option and it worked perfectly. Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.