summaryrefslogtreecommitdiffstats
path: root/src/styles/qcommonstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/styles/qcommonstyle.cpp')
-rw-r--r--src/styles/qcommonstyle.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp
index 3e61282..2614bbf 100644
--- a/src/styles/qcommonstyle.cpp
+++ b/src/styles/qcommonstyle.cpp
@@ -49,6 +49,7 @@
#include "qpixmap.h"
#include "qpushbutton.h"
#include "qtabbar.h"
+#include "qtabwidget.h"
#include "qlineedit.h"
#include "qscrollbar.h"
#include "qtoolbutton.h"
@@ -226,6 +227,7 @@ QStyle::ControlElementFlags getControlElementFlagsForObject(const QObject* objec
if (widget->parentWidget()) cef = cef | QStyle::CEF_HasParentWidget;
if (widget->focusProxy()) cef = cef | QStyle::CEF_HasFocusProxy;
if (widget->hasFocus()) cef = cef | QStyle::CEF_HasFocus;
+ if (widget->hasMouse()) cef = cef | QStyle::CEF_HasMouse;
if (populateReliantFields) {
if (widget->isActiveWindow()) cef = cef | QStyle::CEF_IsActiveWindow;
if (widget->isTopLevel()) cef = cef | QStyle::CEF_IsTopLevel;
@@ -332,6 +334,7 @@ QStyleControlElementData populateControlElementDataFromWidget(const QWidget* wid
const QTabBar *tb = dynamic_cast<const QTabBar*>(widget);
if (tb) {
ceData.tabBarData.tabCount = tb->count();
+ ceData.tabBarData.currentTabIndex = tb->currentTab();
ceData.tabBarData.shape = tb->shape();
ceData.tabBarData.identIndexMap.clear();
const QTab* currentTab;
@@ -341,6 +344,38 @@ QStyleControlElementData populateControlElementDataFromWidget(const QWidget* wid
ceData.tabBarData.identIndexMap[currentTab->identifier()] = tb->indexOf(currentTab->identifier());
}
}
+ const QTabWidget *tw = dynamic_cast<const QTabWidget*>(tb->parent());
+ if (tw) {
+ QWidget *cw;
+ cw = tw->cornerWidget(Qt::TopLeft);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopLeft].pos = cw->pos();
+ }
+ cw = tw->cornerWidget(Qt::TopRight);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_TopRight].pos = cw->pos();
+ }
+ cw = tw->cornerWidget(Qt::BottomLeft);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomLeft].pos = cw->pos();
+ }
+ cw = tw->cornerWidget(Qt::BottomRight);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[QStyleControlElementTabBarData::CWL_BottomRight].pos = cw->pos();
+ }
+ }
}
}
if (ceData.widgetObjectTypes.contains("QToolBox")) {