mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-13 16:42:06 +08:00
add paintEvent override for styling purposes.
This commit is contained in:
parent
f3305b95d2
commit
48163d2679
@ -35,6 +35,8 @@
|
|||||||
#include "DockWidgetTab.h"
|
#include "DockWidgetTab.h"
|
||||||
|
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
|
#include <QStyleOption>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
namespace ads
|
namespace ads
|
||||||
{
|
{
|
||||||
@ -99,4 +101,13 @@ void CSideTabBar::removeSideTab(CDockWidgetSideTab* SideTab)
|
|||||||
{
|
{
|
||||||
d->TabsLayout->removeWidget(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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,9 @@ private:
|
|||||||
friend struct SideTabBarPrivate;
|
friend struct SideTabBarPrivate;
|
||||||
friend class DockWidgetSideTab;
|
friend class DockWidgetSideTab;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void paintEvent(QPaintEvent* event) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Super = QWidget;
|
using Super = QWidget;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user