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 create dynamic drag and drop functionality
Forum Updated to NodeBB v4.3 + New Features

How to create dynamic drag and drop functionality

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 4 Posters 971 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.
  • K ketaki

    wanted to create UI with drag and drop functionality. Is it possible using PyQt?

    Gojir4G Offline
    Gojir4G Offline
    Gojir4
    wrote on last edited by
    #2

    Hi @ketaki,
    Yes that's already natively supported in QWidget.

    Some UI element are already implementing drag & drop, like QTableWidget for example.

    But if you want to make your own widget with drag and drop, what you have to do is:

    • Calling setAcceptDrops(true); (usually in the widget's constructor) for accepting drops
    • Re-implement dropEvent() and dragEnterEvent()

    See the documentation for more details: https://doc.qt.io/qt-5/dnd.html

    1 Reply Last reply
    3
    • K Offline
      K Offline
      ketaki
      wrote on last edited by ketaki
      #3

      Wanted to create simulator type of app where user can able to drag and drop components(images) from UI app. User should able to dynamically change those component images at real time.
      Is this possible using PyQt5 designer?

      jsulmJ 1 Reply Last reply
      0
      • K ketaki

        Wanted to create simulator type of app where user can able to drag and drop components(images) from UI app. User should able to dynamically change those component images at real time.
        Is this possible using PyQt5 designer?

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

        @ketaki said in How to create dynamic drag and drop functionality:

        Is this possible using PyQt5 designer?

        Designer is used to design the UI. You still have to write code for the actual functionality.
        Please read the documentation (@Gojir4 gave you the link).

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

        K 1 Reply Last reply
        0
        • jsulmJ jsulm

          @ketaki said in How to create dynamic drag and drop functionality:

          Is this possible using PyQt5 designer?

          Designer is used to design the UI. You still have to write code for the actual functionality.
          Please read the documentation (@Gojir4 gave you the link).

          K Offline
          K Offline
          ketaki
          wrote on last edited by
          #5

          @jsulm Is QT supports that?

          jsulmJ 1 Reply Last reply
          0
          • K ketaki

            @jsulm Is QT supports that?

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

            @ketaki said in How to create dynamic drag and drop functionality:

            Is QT supports that?

            What exactly?
            Drag and drop? Yes, it does, just read the link...

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

            K 1 Reply Last reply
            1
            • jsulmJ jsulm

              @ketaki said in How to create dynamic drag and drop functionality:

              Is QT supports that?

              What exactly?
              Drag and drop? Yes, it does, just read the link...

              K Offline
              K Offline
              ketaki
              wrote on last edited by
              #7

              @jsulm Can we create UI having icons of different elements lets suppose electric components, and user should able to select component of his/her interest to design a sysetm?

              jsulmJ 1 Reply Last reply
              0
              • K ketaki

                @jsulm Can we create UI having icons of different elements lets suppose electric components, and user should able to select component of his/her interest to design a sysetm?

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

                @ketaki yes

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

                K 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @ketaki yes

                  K Offline
                  K Offline
                  ketaki
                  wrote on last edited by
                  #9

                  @jsulm Can you please share any example code

                  jsulmJ JonBJ 2 Replies Last reply
                  0
                  • K ketaki

                    @jsulm Can you please share any example code

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

                    @ketaki Qt is full of examples: https://doc.qt.io/qt-5/qtexamplesandtutorials.html

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

                    1 Reply Last reply
                    1
                    • K ketaki

                      @jsulm Can you please share any example code

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

                      @ketaki
                      What about you reading through the documentation link you have been given? What about, say, the Draggable Icons Example referenced there?

                      K 1 Reply Last reply
                      3
                      • JonBJ JonB

                        @ketaki
                        What about you reading through the documentation link you have been given? What about, say, the Draggable Icons Example referenced there?

                        K Offline
                        K Offline
                        ketaki
                        wrote on last edited by
                        #12

                        @JonB Thank you

                        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