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. difference between QGraphicProxyWidget and QGraphicWidget
Forum Updated to NodeBB v4.3 + New Features

difference between QGraphicProxyWidget and QGraphicWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 498 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.
  • A Offline
    A Offline
    aymen_ladiff
    wrote on last edited by
    #1

    As mentioned in the Title i don't understand the difference Between this Widgets ,and when should i use one instead of the other.
    thanks

    eyllanescE 1 Reply Last reply
    0
    • A aymen_ladiff

      As mentioned in the Title i don't understand the difference Between this Widgets ,and when should i use one instead of the other.
      thanks

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @aymen_ladiff Could you explain that you do not understand, the documentation is very clear. QGraphicsProxyWidget is a QGraphicsWidget, that is, the former is a specialized version that allows a QWidget to be easily embedded in a scene.

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      1
      • jeremy_kJ Offline
        jeremy_kJ Offline
        jeremy_k
        wrote on last edited by
        #3

        QGraphicsProxyWidget is for embedding an existing widget in a graphics scene. Use QGraphicsProxyWidget::setWidget() to specify the widget.

        QGraphicsScene scene;
        QTreeView treeView;
        QGraphicsProxyWidget proxy;
        proxy.setWidget(treeView);
        scene.addItem(&proxy);
        

        QGraphicsWidget is QGraphicsProxyWidget's base class. It can also be used as a base class for implementing a new widget with paintEvent(), etc overridden, or with a layout and children widgets.

        Asking a question about code? http://eel.is/iso-c++/testcase/

        A 1 Reply Last reply
        2
        • jeremy_kJ jeremy_k

          QGraphicsProxyWidget is for embedding an existing widget in a graphics scene. Use QGraphicsProxyWidget::setWidget() to specify the widget.

          QGraphicsScene scene;
          QTreeView treeView;
          QGraphicsProxyWidget proxy;
          proxy.setWidget(treeView);
          scene.addItem(&proxy);
          

          QGraphicsWidget is QGraphicsProxyWidget's base class. It can also be used as a base class for implementing a new widget with paintEvent(), etc overridden, or with a layout and children widgets.

          A Offline
          A Offline
          aymen_ladiff
          wrote on last edited by aymen_ladiff
          #4

          @jeremy_k then so , if i will use a existing Widget i use QGraphicsProxyWidget and if i will make a new Widget by implementing the PaintEvent ,i use QGraphicsWidget ?

          eyllanescE 1 Reply Last reply
          0
          • A aymen_ladiff

            @jeremy_k then so , if i will use a existing Widget i use QGraphicsProxyWidget and if i will make a new Widget by implementing the PaintEvent ,i use QGraphicsWidget ?

            eyllanescE Offline
            eyllanescE Offline
            eyllanesc
            wrote on last edited by
            #5

            @aymen_ladiff Actually I simplify the rule: If you only want to embed a QWidget then only use a QGraphicsProxyWidget.

            If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

            1 Reply Last reply
            2

            • Login

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