class SettingsWidget : public QDialogSettingsWidget::SettingsWidget(QWidget *parent) : QDialog(parent) { //setFixedSize(500, 500); setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint); setAttribute(Qt::WA_TranslucentBackground); setContentsMargins(0, 0, 0, 0); init();}void SettingsWidget::init() { tabWidget = new QTabWidget(this); connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(onTabChanged(int)));... QBoxLayout *mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this); mainLayout->addWidget(tabWidget, 0, Qt::AlignCenter); setLayout(mainLayout); //refreshWidgetForCurrentUser();}
settingsWidget->setStyleSheet("font-size: " + QString::number(CfgManager::Instance()->getSizeSettings()->getWidgetFontSize()) + "pt;");
C++ (Qt)SettingsWidget->setGeometry(0, 0, tabWidget->width() + x, tabWidget->height() + y);
void SettingsWidget::paintEvent(QPaintEvent *evt) { QPainter painter(this); QRect bg = evt->rect(); // background QLinearGradient bgGradient(bg.topLeft(), bg.bottomLeft()); bgGradient.setColorAt(0, QColor(255, 255, 255, 80)); bgGradient.setColorAt(1, QColor(255, 255, 255, 50)); painter.fillRect(bg, bgGradient);}
void SettingsWidget::paintEvent(QPaintEvent *evt) {}