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);
    }
  • 相关阅读:
    Java vs Python
    Compiled Language vs Scripting Language
    445. Add Two Numbers II
    213. House Robber II
    198. House Robber
    276. Paint Fence
    77. Combinations
    54. Spiral Matrix
    82. Remove Duplicates from Sorted List II
    80. Remove Duplicates from Sorted Array II
  • 原文地址:https://www.cnblogs.com/wiessharling/p/3021726.html
Copyright © 2011-2022 走看看