add paintEvent override for styling purposes.

This commit is contained in:
Nick D'Ademo 2022-09-14 14:17:28 +08:00
parent f3305b95d2
commit 48163d2679
2 changed files with 14 additions and 0 deletions

View File

@ -35,6 +35,8 @@
#include "DockWidgetTab.h"
#include <QBoxLayout>
#include <QStyleOption>
#include <QPainter>
namespace ads
{
@ -99,4 +101,13 @@ void CSideTabBar::removeSideTab(CDockWidgetSideTab* SideTab)
{
d->TabsLayout->removeWidget(SideTab);
}
//============================================================================
void CSideTabBar::paintEvent(QPaintEvent* event)
{
QStyleOption option;
option.initFrom(this);
QPainter painter(this);
style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
}
}

View File

@ -50,6 +50,9 @@ private:
friend struct SideTabBarPrivate;
friend class DockWidgetSideTab;
protected:
void paintEvent(QPaintEvent* event) override;
public:
using Super = QWidget;