How to customize the working smoothly QTabWidget to enhance the user experience like Navicat?
-
Hello, everyone, I want to create the extend tabwidget like navicat that has dragging and dropping feature to detach and attach.
To enable the detaching the widget from tabwidget by dragging the tab in tabbar.
When the dragging the tab in tabbar, if cursor is in the tabbar, tab only is only movable like default tabwidget with setMovable(true).
if the cursor is outside of the tabbar, the current widget will be detached and tab will be dissapear.
And also, widget is dragging and movable freely to change the position.To enable the attaching the widget from tabwidget by dragging and dropping into the tabbar.
By dragging the widget detached from tabwidget to bring closer to the tabbar, If the tabbar region contains the cursor, the widget will be semi-transparent and tab will be appeared and dragging status that enabled to change the order index of the tabbar.
And then next by dropping the widget, the widget will be attached.
Please help me if you have any idea or have an experience.
Thank you in advance. -
@crimson1023
You have to code this yourself, it does not come withQTabWidget
.Googling for
qtabwidget detach tabs
will show you some questions/answers.For all I know https://github.com/epasveer/QDetachTabWidget might be what you want, it was at least updated recently. I don't know whether Google searches might reveal better solutions.
-
I have already googled and every open source in github is not smooth and not same as a tabwidget in the navicat.
When detaching the tab, almost is using QDrag and Qpixmap to implement the detaching and moving the widget, but in the navicat real widget is dragged. And also when attaching the widget can't add the tab that enables to change the order index.
Have you got any opinion?
-
Yeah, you are right, but I don't know how to implement this so came here to discuss with you.
-
This post is deleted!