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. Items in ScrollArea move to another Scroll area when clicked
Forum Updated to NodeBB v4.3 + New Features

Items in ScrollArea move to another Scroll area when clicked

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 362 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.
  • C Offline
    C Offline
    chaikovskyii
    wrote on last edited by
    #1

    50ad7329-69c4-492b-aec7-aac320e71228-image.png

    How can I make items from scroll area(on the left) move to scroll area2(on the right), when these items are clicked?
    I don't even know where to begin, and what type these Items should be?(PushButtons or just Labels?)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dan1973
      wrote on last edited by
      #2

      You can use QListWidget for both scroll areas. And then use MouseClickEvent to capture the click event and remove the Object (QWidget) from source to destination QListWidget.

      Try working on QListWidget examples to get an idea.

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

        Hi,

        As @dan1973 wrote, using the model view framework provided by Qt is the way to go. However there's no need to go down to the custom mouse events. Proper configuration of the already implemented drag and drop feature should cover your use case.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        C 1 Reply Last reply
        0
        • D dan1973

          You can use QListWidget for both scroll areas. And then use MouseClickEvent to capture the click event and remove the Object (QWidget) from source to destination QListWidget.

          Try working on QListWidget examples to get an idea.

          C Offline
          C Offline
          chaikovskyii
          wrote on last edited by
          #4

          @dan1973 Thanks a lot, Dan!!!

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            As @dan1973 wrote, using the model view framework provided by Qt is the way to go. However there's no need to go down to the custom mouse events. Proper configuration of the already implemented drag and drop feature should cover your use case.

            C Offline
            C Offline
            chaikovskyii
            wrote on last edited by
            #5

            @SGaist Thank you man, I'm so happy that there are still people, who are willing to help each other.. Appreciate it!

            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