UI布局Demo:
样式文件如下:
Tabstyle.h#ifndef CUSTOMTABSTYLE_H
#define CUSTOMTABSTYLE_H
#include
#include
#include
class CustomTabStyle : public QProxyStyle
{
public:
CustomTabStyle();
QSize sizeFromContents(ContentsType type,
const QStyleOption *option,
const QSize &size,
const QWidget *widget) const;
void drawControl(ControlElement element,
const QStyleOption *option,
QPainter *painter,
const QWidget *widget) const;
};
#endif // CUSTOMTABSTYLE_H
Tabstyle.cpp#include "Tabstyle.h"
CustomTabStyle::CustomTabStyle()
{
}
QSize CustomTabStyle::sizeFromContents(ContentsType type,
const QStyleOption *option,
const QSize &size,
const QWidget