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. How can i change a form with Qgraphicsproxywidget ?
QtWS25 Last Chance

How can i change a form with Qgraphicsproxywidget ?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 684 Views
  • 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.
  • X Offline
    X Offline
    xmaze
    wrote on last edited by
    #1

    Hi at all,

    I have used a Qgraphicproxywidget to add a form into a scene, but the problem is how can i have access to the gui form and how can i edit the elements during the runtime.

    My code is this one :

    proxy = new CustomProxy(0, Qt::Widget);
    proxy->setWidget(new Form);
    scene->addItem(proxy); 
    

    And the Form is a Qt designer form Class. I have a pushbutton and a QLabel, and i want to put some live data on the QLabel from a databank. How can i have access to this Gui form ?

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

      Hi,

      Keep a pointer to the Form you set on the proxy, then connect what you need to update its label.

      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

      X 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Keep a pointer to the Form you set on the proxy, then connect what you need to update its label.

        Hope it helps

        X Offline
        X Offline
        xmaze
        wrote on last edited by
        #3

        @SGaist

        Thank you, could you be more clear, could you give me an example ?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4
          proxy = new CustomProxy(0, Qt::Widget);
          Form *newForm = new Form;
          proxy->setWidget(newForm);
          scene->addItem(proxy);
          newForm->doSomethingCool();
          

          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

          • Login

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