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. Issue with customlistWidgetmenue: Menu pops up at application start
Qt 6.11 is out! See what's new in the release blog

Issue with customlistWidgetmenue: Menu pops up at application start

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 712 Views 1 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.
  • L Offline
    L Offline
    lacuna
    wrote on last edited by
    #1

    Hi Everybody,

    i have a strange issue with a listWidgetmenue.
    I add a costumContext listWidgetMenu to my application.
    When I start the application the menu pops in the top left corner at the screen.

    Because this is hard to catch as a screenshot I have made a minimal code example - also to proof this issue. Download is here:
    https://code.ademmler.com/QtMinimaIGraphicsscene.zip

    Any ideas what I am doing wrong here.

    Alexander

    Pl45m4P 1 Reply Last reply
    0
    • L lacuna

      Hi Everybody,

      i have a strange issue with a listWidgetmenue.
      I add a costumContext listWidgetMenu to my application.
      When I start the application the menu pops in the top left corner at the screen.

      Because this is hard to catch as a screenshot I have made a minimal code example - also to proof this issue. Download is here:
      https://code.ademmler.com/QtMinimaIGraphicsscene.zip

      Any ideas what I am doing wrong here.

      Alexander

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

      @lacuna

      void MainWindow::on_listWidget_customContextMenuRequested(const QPoint &pos)
      {
          listWidgetMenu->popup(ui->listWidget->viewport()->mapToGlobal(pos));
      }
      

      Check the coordinates here. What is pos and what does ui->listWidget->viewport()->mapToGlobal(pos) return?


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

      ~E. W. Dijkstra

      L 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @lacuna

        void MainWindow::on_listWidget_customContextMenuRequested(const QPoint &pos)
        {
            listWidgetMenu->popup(ui->listWidget->viewport()->mapToGlobal(pos));
        }
        

        Check the coordinates here. What is pos and what does ui->listWidget->viewport()->mapToGlobal(pos) return?

        L Offline
        L Offline
        lacuna
        wrote on last edited by
        #3

        @Pl45m4

        Thanks for your response. The coordinates in operation mode are fine.
        For example: Global pos: QPoint(1009,354)

        My question is about "application launch" - there this menu flickers/pops/ up without any right mouse click be done. At this moment you can see it at the left top corner.

        What I want is: That this menu does not appear at application launch ...

        JonBJ 1 Reply Last reply
        0
        • L lacuna

          @Pl45m4

          Thanks for your response. The coordinates in operation mode are fine.
          For example: Global pos: QPoint(1009,354)

          My question is about "application launch" - there this menu flickers/pops/ up without any right mouse click be done. At this moment you can see it at the left top corner.

          What I want is: That this menu does not appear at application launch ...

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @lacuna
          Can you supply a minimal example of the code necessary to reproduce this? For my part I am certainly not going to download a .zip of goodness knows what/how many files in a project in order to spot a small coding issue....

          L 1 Reply Last reply
          0
          • M Offline
            M Offline
            Molydoly
            Banned
            wrote on last edited by
            #5
            This post is deleted!
            L 1 Reply Last reply
            0
            • JonBJ JonB

              @lacuna
              Can you supply a minimal example of the code necessary to reproduce this? For my part I am certainly not going to download a .zip of goodness knows what/how many files in a project in order to spot a small coding issue....

              L Offline
              L Offline
              lacuna
              wrote on last edited by lacuna
              #6

              @JonB Pls see my first entry - there is a download for a minimal example.
              For your convenience this is a Qt creator project, which contains minimal code to reproduce the effect.

              1 Reply Last reply
              0
              • M Molydoly

                This post is deleted!

                L Offline
                L Offline
                lacuna
                wrote on last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0

                • Login

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