mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 23:51:33 +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 <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);
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,9 @@ private:
|
||||
friend struct SideTabBarPrivate;
|
||||
friend class DockWidgetSideTab;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
|
||||
public:
|
||||
using Super = QWidget;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user