Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [SOLVED] Emit a signal when a subwindow is clicked

    General and Desktop
    2
    4
    1351
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rizoritis last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • R
          rizoritis last edited by

          OK, thanks. I will try it out now.

          1 Reply Last reply Reply Quote 0
          • R
            rizoritis last edited by

            [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!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post