Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtTreePropertyBrowser / Getting mouse double click
Forum Updated to NodeBB v4.3 + New Features

QtTreePropertyBrowser / Getting mouse double click

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 376 Views 2 Watching
  • 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.
  • E Offline
    E Offline
    excelitas_pco
    wrote on last edited by
    #1

    Hi all,

    I'm using a derived QtTreePropertyBrowser. After adding some property items I want to get a signal, when user does a double mouse click. However I do not get the event in mouseDoubleClickEvent in my derived QtMyTreePropertyBrowser. I've seen that the event goes into a QTreeView::mouseDoubleClickEvent. QTreeView is created in the constructor of QtTreePropertyBrowser. In QTreeView::mouse... I see that there is information about row and column of the item double clicked (QPersistentModelIndex) and there is also an emit doubleClicked(persistent), but I do not know how to get this event in my app.

    Anybody here how can help?

    Regards

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Which base version are you using for your class ?
      What do you want to do with that double click event ?

      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
      0
      • E Offline
        E Offline
        excelitas_pco
        wrote on last edited by
        #3

        Hi SGaist,

        thanks for answering. I did not expect to get an answer from a Champion. Thanks for the welcome.

        I'm using the sample 'decoration', which is part of Qt source code. There exists a class QtTreePropertyBrowser, which I derived to get signals, and so on.

        The property I want to create has got two functionalities. First is a value from 0...100. Second is on/off. A doubleclick should switch the state on/off, while the 0..100 value controls intensity of a light source.

        With MFC on windows (sorry for that, but this is my current root...) I've created this kind of control already:

        grafik.png

        Probably I have to split up the functionality into subitems. However this seems to be less user friendly.

        Regards

        1 Reply Last reply
        0
        • E Offline
          E Offline
          excelitas_pco
          wrote on last edited by
          #4

          This is where the doubleclick hits:

          grafik.png
          I would also like to know what this emit doubleClick(persistent) does and where I can get it in my app. persistent is related to row/column and thus the item created.

          jsulmJ 1 Reply Last reply
          0
          • E excelitas_pco

            This is where the doubleclick hits:

            grafik.png
            I would also like to know what this emit doubleClick(persistent) does and where I can get it in my app. persistent is related to row/column and thus the item created.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @excelitas_pco said in QtTreePropertyBrowser / Getting mouse double click:

            I would also like to know what this emit doubleClick(persistent) does

            It emits signal doubleClick(...).
            You can connect a slot to it.
            If you're not familiar with signals/slots then you really should read about them, else you will not be able to use Qt.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • E Offline
              E Offline
              excelitas_pco
              wrote on last edited by excelitas_pco
              #6

              @jsulm: Signal/Slot is known.
              If you talk about this:
              void mouseDoubleClickEvent(QMouseEvent* event) override;
              It is not hit!

              The initial mouse double click hits QTreeView and not the widget I've derived from QtTreePropertyBrowser.
              QtTreePropertyBrowser internally creates QTreeView. There's no access for me, as far as I can see.

              See callstack:
              62e728e1-afe8-44ad-a4b4-5326dc0f6f84-grafik.png

              Regards

              Pl45m4P 1 Reply Last reply
              0
              • E excelitas_pco

                @jsulm: Signal/Slot is known.
                If you talk about this:
                void mouseDoubleClickEvent(QMouseEvent* event) override;
                It is not hit!

                The initial mouse double click hits QTreeView and not the widget I've derived from QtTreePropertyBrowser.
                QtTreePropertyBrowser internally creates QTreeView. There's no access for me, as far as I can see.

                See callstack:
                62e728e1-afe8-44ad-a4b4-5326dc0f6f84-grafik.png

                Regards

                Pl45m4P Offline
                Pl45m4P Offline
                Pl45m4
                wrote on last edited by Pl45m4
                #7

                @excelitas_pco

                Hi,

                do you inherit from QtTreePropertyBrowserPrivate directly?
                Might not be the best idea, since your widget depends on that specific Qt version as the internal Qt code may change just like that. Then your widget does not work anymore.

                The initial mouse double click hits QTreeView and not the widget I've derived from QtTreePropertyBrowser.

                Events always start at the innermost child widget at that position and then go bottom-up to the topmost.
                Probably the QTreeView "eats"/accepts the event, so the propagation ends there.

                If your code was "inpired" by the Qt source you can fix that,
                if you inherit the Qt private classes directly, you cannot.


                If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                ~E. W. Dijkstra

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved