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. Not able to set ProxyWidget Position (solved)
Qt 6.11 is out! See what's new in the release blog

Not able to set ProxyWidget Position (solved)

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 918 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.
  • H Offline
    H Offline
    houmingc
    wrote on last edited by houmingc
    #1

    proxy has a method (setPos) but i can't seems to be able to move the proxyWidget.

    '''
    WidgetCountdown *CountdownTest = new WidgetCountdown;
    QGraphicsProxyWidget *proxy = scene.addWidget(CountdownTest);
    proxy->setPos(0,0);
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Where do you expect that position to be ?

      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
      • H Offline
        H Offline
        houmingc
        wrote on last edited by houmingc
        #3

        I looked at the "colliding mouse example":http://doc.qt.nokia.com/4.7-snapshot/graphicsview-collidingmice.html that ships with Qt.
        The mouse is place at random location using setPos Method
        '''
        mouse->setPos(::sin((i * 6.28) / MouseCount) * 200, ::cos((i * 6.28) / MouseCount) * 200);

        I expect proxy->setPos(0,0) to be top left side of the screen.
        The coordinates mapping into scene confuse me...

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

          You should update your documentation link. The from nokia time is a bit outdated to say the least.

          The setPos call you are showing is just a way to position a mouse at random points on the scene

          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
          • H Offline
            H Offline
            houmingc
            wrote on last edited by
            #5

            What are other ways of positioning, please comment.

            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