KTabWidget vs QTabWidget

Jeremy Whiting jpwhiting at kde.org
Sat Sep 19 01:46:24 BST 2015


Hey all,

In looking into fixing the remaining issues in Okular's frameworks
branch I realized that in part of the effort to port it away from
KDELibs4Support it got some functionality removed. It was ported from
KTabWidget to QTabWidget but QTabWidget doesn't seem to support drag
and drop the way KTabWidget did. In looking at the KTabWidget
documentation on api.kde.org it still says that KTabWidget is
preferred over QTabWidget [1]. If that's the case why did it end up in
KDELibs4Support?

In reading Qt documentation about drag and drop [2] it seems that you
need to subclass widgets in order to specify any additional mime types
that should be handled by a drop event (which okular made use of so
you could drop documents on it's tab bar to open them). Without
KTabWidget we lose that feature completely unless we subclass
QTabWidget (which we have in KTabWidget... so why not just use it...).
Am I missing something? If not I suggest we reconsider and maybe
move/copy? KTabWidget into KF5::WidgetsAddons as it still provides
functionality we want/need in some cases. I'm not sure what would be
BC or SC in this case tbh (or maybe users of KTabWidget should just
keep using KDELibs4Support?)

BR,
Jeremy


1. http://api.kde.org/frameworks-api/frameworks5-apidocs/kdelibs4support/html/classKTabWidget.html
2. http://doc.qt.io/qt-5/dnd.html




More information about the kde-core-devel mailing list