Qt Forum

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

    Solved How Can I add pressed() signal to Qdialog ?

    General and Desktop
    2
    6
    839
    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.
    • Z
      zeroptr last edited by

      Hi All,

      How can I add pressed() signal to Qdialog ?

      is there any way?

      Linux Mint 20.04 64 Bit QT6.0.1

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

        Hi
        What you mean?
        You want a completely empty dialog where it will signal Pressed if u click anywhere?

        1 Reply Last reply Reply Quote 0
        • Z
          zeroptr last edited by

          No of course it's not completely empty.. There are many widgets on the Qdialog buttons progressbars etc.. But I want to catch if user press on dialog on an empty space..

          Linux Mint 20.04 64 Bit QT6.0.1

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @zeroptr last edited by mrjj

            @zeroptr
            Ahh
            well you can override
            mousePressEvent
            to catch such clicking

            void yourdiaog::mousePressEvent(QMouseEvent *event)

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

              oh
              and if u want a signal
              just define it
              and then
              emit DialogPressed()

              if you want to connect to this signal from "outside"

              1 Reply Last reply Reply Quote 1
              • Z
                zeroptr last edited by

                :mousePressEvent(QMouseEvent *event) solved the issue thanks...

                Linux Mint 20.04 64 Bit QT6.0.1

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