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. Get the drop event inside child widgets in a MainWindow.
Forum Updated to NodeBB v4.3 + New Features

Get the drop event inside child widgets in a MainWindow.

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 323 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.
  • Huy ManhH Offline
    Huy ManhH Offline
    Huy Manh
    wrote on last edited by
    #1

    Hello Qt Devs, I have been using Qt for 3 months but still don't sure about event handlers.
    I have a MainWindow with 10 list widgets for dropping inside and a LineEdit for counting the items inside these widgets. What I want to do is whenever an item is dropped inside the widgets, lineedit count plus 1. Can someone suggest for me a method, I tried dropEvent and eventFilter but didn't work. Thank you for reading.

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

      Hi and welcome to devnet,

      What exactly did you implement ?

      One simple way is to create a subclass and re-implement the dropEvent method and emit a signal from there. Then you connect that signal in the main window to increment your counter.

      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