Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/widgets/psitabbar.cpp b/src/widgets/psitabbar.cpp
- index c674d142..662b94f5 100644
- --- a/src/widgets/psitabbar.cpp
- +++ b/src/widgets/psitabbar.cpp
- @@ -26,6 +26,10 @@
- #include <QMimeData>
- #include <QMouseEvent>
- #include <QPainter>
- +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- +#include <QMetaProperty>
- +#include <QStyleOptionTab>
- +#endif
- /**
- * Constructor
- @@ -37,6 +41,19 @@ PsiTabBar::PsiTabBar(PsiTabWidget *parent) : TabBar(parent)
- setMovable(true);
- setTabsClosable(true);
- setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab);
- +//Hack to place Qt6 tabs not at center with minimal tab width
- +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- + setExpanding(false);
- + auto propName = "position";
- + auto *metaObject = PsiTabBar::metaObject();
- + int count = metaObject->propertyCount();
- + for (int i = 0; i < count; ++i) {
- + if(std::strcmp(metaObject->property(i).name(), propName)) {
- + setProperty(propName, QStyleOptionTab::Beginning);
- + break;
- + }
- + }
- +#endif
- }
- /**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement