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 to implement a simple widget that like QT Designer?

How to implement a simple widget that like QT Designer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 424 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.
  • H Offline
    H Offline
    hei6775
    wrote on last edited by
    #1

    Hi, I want to make an application that is used to simulate certain things. I need a window similar to qtdesigner, but much simplified. There is a list on the left side of this widget, and you can drag something from this list to the right window. But I don't know how to implement it, I have no idea. Hope to give me some hints, or tell me where there are some simple examples.

    thanks for your help.

    jsulmJ raven-worxR 2 Replies Last reply
    0
    • H hei6775

      Hi, I want to make an application that is used to simulate certain things. I need a window similar to qtdesigner, but much simplified. There is a list on the left side of this widget, and you can drag something from this list to the right window. But I don't know how to implement it, I have no idea. Hope to give me some hints, or tell me where there are some simple examples.

      thanks for your help.

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

      @hei6775 You should start here: https://doc.qt.io/qt-5/dnd.html

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

      H 1 Reply Last reply
      1
      • H hei6775

        Hi, I want to make an application that is used to simulate certain things. I need a window similar to qtdesigner, but much simplified. There is a list on the left side of this widget, and you can drag something from this list to the right window. But I don't know how to implement it, I have no idea. Hope to give me some hints, or tell me where there are some simple examples.

        thanks for your help.

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #3

        @hei6775
        In QtWidgets you should probably use QGraphicsView framework:
        https://doc.qt.io/qt-5/qtwidgets-graphicsview-dragdroprobot-example.html

        Your list widget/model could then provide custom mime-type data which is interpreted by the graphics view on a drop event and creates the simple items in the graphics view.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        H 1 Reply Last reply
        2
        • jsulmJ jsulm

          @hei6775 You should start here: https://doc.qt.io/qt-5/dnd.html

          H Offline
          H Offline
          hei6775
          wrote on last edited by
          #4

          @jsulm yes, i am reading it. thanks

          1 Reply Last reply
          0
          • raven-worxR raven-worx

            @hei6775
            In QtWidgets you should probably use QGraphicsView framework:
            https://doc.qt.io/qt-5/qtwidgets-graphicsview-dragdroprobot-example.html

            Your list widget/model could then provide custom mime-type data which is interpreted by the graphics view on a drop event and creates the simple items in the graphics view.

            H Offline
            H Offline
            hei6775
            wrote on last edited by
            #5

            @raven-worx hi, I want to ask, which class do you suggest my list widget should use?

            raven-worxR 1 Reply Last reply
            0
            • H hei6775

              @raven-worx hi, I want to ask, which class do you suggest my list widget should use?

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by raven-worx
              #6

              @hei6775
              QListView with a custom QAbstractListModel i guess.
              also read this: https://doc.qt.io/qt-5/model-view-programming.html#using-drag-and-drop-with-item-views
              to make your model provide custom drag data

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              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