[Drag&Drop;] QTabWidget

  • I've reimplemented QTabBar and QTabWidget in order to make tabs moveable between different TabWidgets in my application (tab is moved, NOT copied). If somebody is using Firefox it's possible to do such thing with tabs between two firefox's windows.

    My idea how to do that: let's say that the widget inside each tab is called ExampleWidget (there's only one such widget per tab). It is to work only inside one app that's why I'm thinking about passing a pointer to source TabWidget and a pointer to ExampleWidget via MIME. Then I'm going to use this information in DropEvent in order to move the tab (delete tab from source TabWidget, create a new tab in TabWidget which receives DropEvent and add ExampleWidget using second pointer from MIME). I hope my description is understandable. My question is: is it a proper way to do it or somebody has better idea?

    Talking about drag&drop; I have one more question. How can I get to know if the user drops something outside the window? In Firefox you can open new window when you drop tab outside it.

  • Hi,

    for the first question, it is doable thatw ay, yes. If it is the nicest version is another question, but as you only want to use it inside your process, I would say it is ok.

  • Thx for the answer. I think I'm going to this that way because I haven't found anything better yet.

    Could anybody say something about my last question?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.