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. Detecting Drop Events Outside Application in QT C++
Forum Updated to NodeBB v4.3 + New Features

Detecting Drop Events Outside Application in QT C++

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 259 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.
  • M Offline
    M Offline
    M4cM4rco
    wrote on last edited by
    #1

    Hello everyone,

    I'm currently working on a project using QT C++ and facing a unique challenge that I hope to get some insights from you guys.

    I've implemented a custom QTabBar and QTabWidget in my application to ensure smooth drag-and-drop functionality for tabs both within and between different tab bars. My current focus is on enhancing this feature by allowing a new window to open with the content of a tab when it's dropped outside of any tab bar (like in every modern browser). However, I'm unsure how to detect drop events that occur outside the application.

    In theory, I've considered using a hook to detect such events, but I'm aware that this approach is platform-specific and may lead to complications. Does anyone have experience or suggestions on alternative methods to achieve this functionality?

    Any guidance or pointers to relevant resources would be greatly appreciated!

    Thanks :)

    Axel SpoerlA 1 Reply Last reply
    0
    • M M4cM4rco

      Hello everyone,

      I'm currently working on a project using QT C++ and facing a unique challenge that I hope to get some insights from you guys.

      I've implemented a custom QTabBar and QTabWidget in my application to ensure smooth drag-and-drop functionality for tabs both within and between different tab bars. My current focus is on enhancing this feature by allowing a new window to open with the content of a tab when it's dropped outside of any tab bar (like in every modern browser). However, I'm unsure how to detect drop events that occur outside the application.

      In theory, I've considered using a hook to detect such events, but I'm aware that this approach is platform-specific and may lead to complications. Does anyone have experience or suggestions on alternative methods to achieve this functionality?

      Any guidance or pointers to relevant resources would be greatly appreciated!

      Thanks :)

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      @M4cM4rco
      You can just override drag events in your custom Widgets like documented here. The drag override makes sure that the user observes the outside of main window as a valid drop area. The drop override has to implement a new window being created. I’d look into dock widget options, because much of the required functionality comes out of the box here.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      2
      • M M4cM4rco has marked this topic as solved on

      • Login

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