zoukankan      html  css  js  c++  java
  • Qt 基础360UI学习

    1、setWindowFlags(Qt::FramelessWindowHint);  去掉操作系统提供的窗口边框

    2、setAttribute(Qt::WA_TranslucentBackground);

    Indicates that the widget should have a translucentbackground, i.e. ,any nonopaque regions of the widgets will be translucent because the widget will have an alpha     channel. Setting this flag causes WA_NoSystemBackground to be set. On Windows the widget also needs the Qt::FramelessWindowHint window flag to be set. This flag is     set or cleared by the widget's author.

    3、m_vecBtn[i]->setAutoExclusive(true);

    其中m_vecBtn 为Vector<QPushButton。
    If auto-exclusivity is enabled, checkable buttons that belong to the same parent widget behave as if they were part of the same exclusive buttongroup. In an exclusive  buttongroup, only one button canbe checked at anytime; checking another button automatically unchecks the previously checked one.

    3、label_checkUpdate->setOpenExternalLinks(true);

    4、背景半透明

    void MainWindow::paintEvent(QPaintEvent *)
    {
    //    QPainter painter(this);
    //    painter.drawPixmap(m_pixmapBg.rect(), m_pixmapBg);
        QPainter painter(this);
        QLinearGradient grad(0, 0, rect().width(), rect().height());
        {
                QGradientStops gs;
                gs << QGradientStop(0.0, QColor(0,0,0,100))
                        << QGradientStop(0.5, QColor(0,0,0,100))
                        << QGradientStop(1.0, QColor(0,0,0,100));
                grad.setStops(gs);
        }
        painter.fillRect(0, 0, rect().width(), rect().height(), grad);
    }
  • 相关阅读:
    菜根谭#69
    菜根谭#68
    菜根谭#67
    菜根谭#66
    菜根谭#65
    菜根谭#64
    菜根谭#63
    更新centos本地仓库(换源)
    docker初探
    centos python版本升级到3.x
  • 原文地址:https://www.cnblogs.com/wiessharling/p/3021726.html
Copyright © 2011-2022 走看看