zoukankan      html  css  js  c++  java
  • Qt之样式

    1.在Qt Designer 中添加样式

    2.在代码中添加样式

    // 对单个控件;

    ui->pushButton->setStyleSheet("QPushButton{border-radius:5px;background:rgb(150, 190, 60);color:red;font-size:15px;}")

    // 对整个界面(包括界面上所有的控件)

    this->setStyleSheet("QPushButton{border-radius:5px;background:rgb(150, 190, 60);color:red;font-size:15px; QToolButton{border-radius:5px;background:rgb(34, 231, 131);color:brown;font-size:15px;}")

    3.将样式写在文件中,通过读取文件的方式设置样式

    将样式保存在MyStyle.qss文件中。

    QPushButton
    {
      border-radius:8px;
      background:rgb(150,190,60);
      color:red;
      font-size:15px;
    }
    QToolButton
    {
      border-radius:8px;
      background:rgb(34,231,131);
      color:brown;
      font-size:15px;
    }

  • 相关阅读:
    Scala-文件操作
    python-数字
    python-访问模型
    scala-包
    Scala对象
    Scala-类
    sql存储过程
    sql视图
    sql基本语句
    sql中级语句
  • 原文地址:https://www.cnblogs.com/mathyk/p/9021433.html
Copyright © 2011-2022 走看看