Qt君


  • 首页

  • 关于

  • 归档

  • 搜索

Qt官方示例-窗口标志

发表于 2019-11-24

窗口标志示例展示了如何使用Qt中可用的窗口标志类型来指定窗口系统属性。

demo

  根据示例整理出来的各窗口标志作用一览表如下:

  • 只能设置一个的窗口标志对照表
窗口标志 描述
Qt::QWidget 窗口的默认属性
Qt::Window 带有窗口系统框架和标题栏
Qt::Dialog 对话框(通常标题栏中没有最大化或最小化按钮)
Qt::Sheet macOS表单式窗口
Qt::Drawer macOS抽屉式窗口
Qt::Popup 弹出式顶层窗口
Qt::Tool 显示工具按钮的窗口
Qt::Tooltip 没有标题栏和窗口边框的窗口
Qt::SplashScreen 启动窗口类似于QSplashScreen
  • 可以设置多个的窗口标志对照表
窗口标志 描述
Qt::MSWindowsFixedSizeDialogHint Windows系统固定大小窄边框窗口
Qt::X11BypassWindowManagerHint 无窗口边框的窗口,完全忽视窗口管理器和用户无法使用键盘进行输入
(除非手动调用QWidget::activateWindow()函数
Qt::FramelessWindowHint 无法移动和改变大小的无窗口边框的窗口
Qt::NoDropShadowWindowHint 禁用窗口阴影
Qt::WindowTitleHint 带标题栏的窗口
Qt::WindowSystemMenuHint 带系统菜单和尽可能地添加一个关闭按钮的窗口
Qt::CustomizeWindowHint 关闭默认窗口标题提示栏
Qt::WindowMinimizeButtonHint 窗口添加一个最小化按钮
Qt::WindowMaximizeButtonHint 窗口添加一个最大化按钮
Qt::WindowCloseButtonHint 窗口添加一个关闭按钮
Qt::WindowContextHelpButtonHint 窗口添加一个帮助按钮
Qt::WindowShadeButtonHint 如果窗口管理器支持,则在最小化按钮的位置添加一个阴影按钮
Qt::WindowStaysOnTopHint 通知窗口系统置顶窗口
Qt::WindowStaysOnBottomHint 通知窗口系统置于最底层窗口
  • 部分代码(更新窗口标志)
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    void ControllerWindow::updatePreview()
    {
    Qt::WindowFlags flags = 0;

    if (windowRadioButton->isChecked()) {
    flags = Qt::Window;
    } else if (dialogRadioButton->isChecked()) {
    flags = Qt::Dialog;
    } else if (sheetRadioButton->isChecked()) {
    flags = Qt::Sheet;
    } else if (drawerRadioButton->isChecked()) {
    flags = Qt::Drawer;
    } else if (popupRadioButton->isChecked()) {
    flags = Qt::Popup;
    } else if (toolRadioButton->isChecked()) {
    flags = Qt::Tool;
    } else if (toolTipRadioButton->isChecked()) {
    flags = Qt::ToolTip;
    } else if (splashScreenRadioButton->isChecked()) {
    flags = Qt::SplashScreen;
    }

    if (msWindowsFixedSizeDialogCheckBox->isChecked())
    flags |= Qt::MSWindowsFixedSizeDialogHint;
    if (x11BypassWindowManagerCheckBox->isChecked())
    flags |= Qt::X11BypassWindowManagerHint;
    if (framelessWindowCheckBox->isChecked())
    flags |= Qt::FramelessWindowHint;
    if (windowNoShadowCheckBox->isChecked())
    flags |= Qt::NoDropShadowWindowHint;
    if (windowTitleCheckBox->isChecked())
    flags |= Qt::WindowTitleHint;
    if (windowSystemMenuCheckBox->isChecked())
    flags |= Qt::WindowSystemMenuHint;
    if (windowMinimizeButtonCheckBox->isChecked())
    flags |= Qt::WindowMinimizeButtonHint;
    if (windowMaximizeButtonCheckBox->isChecked())
    flags |= Qt::WindowMaximizeButtonHint;
    if (windowCloseButtonCheckBox->isChecked())
    flags |= Qt::WindowCloseButtonHint;
    if (windowContextHelpButtonCheckBox->isChecked())
    flags |= Qt::WindowContextHelpButtonHint;
    if (windowShadeButtonCheckBox->isChecked())
    flags |= Qt::WindowShadeButtonHint;
    if (windowStaysOnTopCheckBox->isChecked())
    flags |= Qt::WindowStaysOnTopHint;
    if (windowStaysOnBottomCheckBox->isChecked())
    flags |= Qt::WindowStaysOnBottomHint;
    if (customizeWindowHintCheckBox->isChecked())
    flags |= Qt::CustomizeWindowHint;

    previewWindow->setWindowFlags(flags);
    ...
    }

关于更多

  • 在QtCreator软件可以找到:

what_find

  • 或在以下Qt安装目录找到:

    1
    C:\Qt\{你的Qt版本}\Examples\{你的Qt版本}\widgets\widgets\windowflags
  • 相关链接

    1
    https://doc.qt.io/qt-5/qtwidgets-widgets-windowflags-example.html
  • Qt君公众号回复『Qt示例』获取更多内容。

大家好,我是Qt君.

发表于 2019-11-24

欢迎来到我的个人博客, 和作者交流反馈可以关注公众号『Qt君』留言.

正则表达式 | 循环体语法

发表于 2019-11-23

介绍正则表达式中的”循环体”语法,其实循环体是作者定义的,正确的描述是限定符。
通过不同的限定符,提供不同的匹配次数的作用。其基本语法是:表达式|限定符组合。

0x00 循环体:表达式|*

  • 含义:将表达式循环匹配零次或多次。
  • 例如:Hello*
  • 解析:
    1. 表达式为字符o
    2. 循环语句为*(零次或多次)
  • 结果:可以匹配Hell,Hello,Helloo和Hellooo等等。

0x01 循环体:表达式|+

  • 含义:将表达式循环匹配一次或多次。
  • 例如:Hello+
  • 解析:
    1. 表达式为字符o
    2. 循环语句为*(一次或多次)
  • 结果:可以匹配Hello,Helloo和Hellooo等等,但不能匹配Hell。

0x02 循环体:表达式|?

  • 含义:将表达式循环匹配一次或多次。
  • 例如:Hello?
  • 解析:
    1. 表达式为字符o
    2. 循环语句为?(零次或一次)
  • 结果:只能匹配Hell和Hello。

0x03 循环体:表达式|{n}

  • 含义:将表达式循环匹配确定的n次。
  • 例如:Hello{2}
  • 解析:
    1. 表达式为字符o
    2. 循环语句为{2}(只能匹配两次)
  • 结果:只能匹配Helloo。

0x04 循环体:表达式|{n,}

  • 含义:将表达式循环匹配至少n次。
  • 例如:Hello{2,}
  • 解析:
    1. 表达式为字符o
    2. 循环语句为{2,}(至少两次)
  • 结果:能匹配Helloo,Hellooo,Helloooo等等。

0x05 循环体:表达式|{n,m}

  • 含义:将表达式循环匹配最少n次且最多m次。
  • 例如:Hello{2,3}
  • 解析:
    1. 表达式为字符o
    2. 循环语句为{2,3}(最少两次且最多三次)
  • 结果:只能匹配Helloo,Hellooo等等。

注意

  • {n},{n,},{n,m}之间不能有空格。

Flat风格的Qml开关按钮

发表于 2019-11-22

可以打开或关闭的开关按钮,使用Qml的Switch控件修改而成。

demo

0x00 Switch按钮代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import QtQuick 2.0
import QtQuick.Controls 2.0

Switch {
id: root
property color checkedColor: "#0ACF97"

indicator: Rectangle {
width: 54
height: 34
radius: height / 2
color: root.checked ? checkedColor : "white"
border.width: 2
border.color: root.checked ? checkedColor : "#E5E5E5"

Rectangle {
x: root.checked ? parent.width - width - 2 : 1
width: root.checked ? parent.height - 4 : parent.height - 2
height: width
radius: width / 2
anchors.verticalCenter: parent.verticalCenter
color: "white"
border.color: "#D5D5D5"

Behavior on x {
NumberAnimation { duration: 200 }
}
}
}
}

0x01 Switch样式代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
GridLayout {
width: root.width
rows: switchRepeater.count

Repeater {
id: switchRepeater
model: ["#727CF5", "#0ACF97", "#F9375E", "#FFBC00", "#2B99B9"]
Column {
spacing: 15
Switch {
checkedColor: modelData
checked: true
}

Switch {
checkedColor: modelData
}

Switch {
checkedColor: modelData
checked: true
}
}
}
}
  • 更多请关注公众号Qt君

Qml之variant与var对比

发表于 2019-11-21

为什么Qt Quick 2中变量定义改为var呢?而不继续使用variant呢?我们看看它们的区别吧。

QtQuick 1.x

  • property variant内部是QVariant。
  • 对象被分配给variant变量时则会被转换为QVariantMap。
  • 从javascript访问该属性将导致QVariantMap转换回JS对象。
  • javascript的函数,特殊的JS值(null,undefined)无法存储在”property variant”类型的属性中。

QtQuick 2.x

  • property var内部是javascript值。
  • property var支持创建javascript的所有内容,包括函数引用。
  • 仅当从C ++(通过QObject::property()或QQmlProperty::read())访问时,才会转换为QVariant(将其他JS值转换为QVariant的转换规则相同)。
  • 在C ++端实现类型时,可以将QJSValue类用作属性/方法参数,以在C ++和QML/JS之间传输值,而不会造成类型/数据丢失。

总结

  使用property var作用更大,避免不必要的转换,性能更好。


ref: https://wiki.qt.io/Property-var

将文档导出为pdf

发表于 2019-11-20

使用QTextDocument与QPrinter实现文档导出为PDF的小示例。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <QtWidgets>
/* 需要为项目文件添加QT += printsupport */
#include <QPrinter>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QPrinter printer(QPrinter::PrinterResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setPaperSize(QPrinter::A4);
printer.setOutputFileName("hello.pdf");

QTextDocument doc;
doc.setPlainText("Hello world!"); /* 可替换为文档内容 */
doc.setPageSize(printer.pageRect().size());
doc.print(&printer);
}

Qt官方示例-计算器

发表于 2019-11-17

该示例显示了如何使用信号和槽来实现计算器小部件的功能,以及如何使用QGridLayout将子小部件放置在网格中。

main_page

  • 通过绑定不同的按钮和不同的槽函数实现计算功能。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    private slots:
    void digitClicked();
    void unaryOperatorClicked();
    void additiveOperatorClicked();
    void multiplicativeOperatorClicked();
    void equalClicked();
    void pointClicked();
    void changeSignClicked();
    void backspaceClicked();
    void clear();
    void clearAll();
    void clearMemory();
    void readMemory();
    void setMemory();
    void addToMemory();
  • 创建执行按钮。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    for (int i = 0; i < NumDigitButtons; ++i) {
    digitButtons[i] = createButton(QString::number(i), SLOT(digitClicked())); /* 绑定数字按钮 */
    }

    Button *pointButton = createButton(tr("."), SLOT(pointClicked()));
    Button *changeSignButton = createButton(tr("\302\261"), SLOT(changeSignClicked()));

    Button *backspaceButton = createButton(tr("Backspace"), SLOT(backspaceClicked()));
    Button *clearButton = createButton(tr("Clear"), SLOT(clear()));
    Button *clearAllButton = createButton(tr("Clear All"), SLOT(clearAll()));

    Button *clearMemoryButton = createButton(tr("MC"), SLOT(clearMemory()));
    Button *readMemoryButton = createButton(tr("MR"), SLOT(readMemory()));
    Button *setMemoryButton = createButton(tr("MS"), SLOT(setMemory()));
    Button *addToMemoryButton = createButton(tr("M+"), SLOT(addToMemory()));

    Button *divisionButton = createButton(tr("\303\267"), SLOT(multiplicativeOperatorClicked()));
    Button *timesButton = createButton(tr("\303\227"), SLOT(multiplicativeOperatorClicked()));
    Button *minusButton = createButton(tr("-"), SLOT(additiveOperatorClicked()));
    Button *plusButton = createButton(tr("+"), SLOT(additiveOperatorClicked()));

    Button *squareRootButton = createButton(tr("Sqrt"), SLOT(unaryOperatorClicked()));
    Button *powerButton = createButton(tr("x\302\262"), SLOT(unaryOperatorClicked()));
    Button *reciprocalButton = createButton(tr("1/x"), SLOT(unaryOperatorClicked()));
    Button *equalButton = createButton(tr("="), SLOT(equalClicked()));
  • 创建按钮的同时绑定相关槽函数。

    1
    2
    3
    4
    5
    6
    Button *Calculator::createButton(const QString &text, const char *member)
    {
    Button *button = new Button(text);
    connect(button, SIGNAL(clicked()), this, member);
    return button;
    }
  • 加入布局。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    QGridLayout *mainLayout = new QGridLayout;
    //! [5] //! [6]
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);
    mainLayout->addWidget(display, 0, 0, 1, 6);
    mainLayout->addWidget(backspaceButton, 1, 0, 1, 2);
    mainLayout->addWidget(clearButton, 1, 2, 1, 2);
    mainLayout->addWidget(clearAllButton, 1, 4, 1, 2);

    mainLayout->addWidget(clearMemoryButton, 2, 0);
    mainLayout->addWidget(readMemoryButton, 3, 0);
    mainLayout->addWidget(setMemoryButton, 4, 0);
    mainLayout->addWidget(addToMemoryButton, 5, 0);

    for (int i = 1; i < NumDigitButtons; ++i) {
    int row = ((9 - i) / 3) + 2;
    int column = ((i - 1) % 3) + 1;
    mainLayout->addWidget(digitButtons[i], row, column);
    }

    mainLayout->addWidget(digitButtons[0], 5, 1);
    mainLayout->addWidget(pointButton, 5, 2);
    mainLayout->addWidget(changeSignButton, 5, 3);

    mainLayout->addWidget(divisionButton, 2, 4);
    mainLayout->addWidget(timesButton, 3, 4);
    mainLayout->addWidget(minusButton, 4, 4);
    mainLayout->addWidget(plusButton, 5, 4);

    mainLayout->addWidget(squareRootButton, 2, 5);
    mainLayout->addWidget(powerButton, 3, 5);
    mainLayout->addWidget(reciprocalButton, 4, 5);
    mainLayout->addWidget(equalButton, 5, 5);
    setLayout(mainLayout);

关于更多

  • 在QtCreator软件可以找到:

what_find

  • 或在以下Qt安装目录找到:

    1
    C:\Qt\{你的Qt版本}\Examples\{你的Qt版本}\widgets\widgets\calculator
  • 相关链接

    1
    https://doc.qt.io/qt-5/qtwidgets-widgets-calculator-example.html
  • Qt君公众号回复『Qt示例』获取更多内容。

翻译 | 为什么QObject子类不可复制?

发表于 2019-11-16

本文翻译自: https://www.cleanqt.io/blog/why-qobject-subclasses-are-not-copyable
原作者: Alexander Fagrell
原文发布时间:2018年8月14日

  如果您尝试复制QObject派生的类,则会导致编译器错误,例如:

1
2
3
4
5
class MyClass : public QObject {
Q_OBJECT
} my_class;

auto my_class_copy = my_class;

使用Qt5并使用C++11(支持=delete):

错误:使用已删除的函数’MyClass::MyClass(const MyClass&)’

或更早版本:

错误:’QObject::QObject(const QObject&)’在此上下文中是私有的。

  此行为是设计使然。但是为什么要删除复制构造函数(以及赋值运算符)?如果您仍要复制该怎么办?如果它不可复制,那么它可以移动吗?以下文章将研究这些问题,并探讨在自定义子类中重复删除操作是否是一种好习惯。就让我们一探究竟吧!

  不能复制QObject有几个原因。其中两个最大的原因是:

  • QObjects之间通常使用信号和槽机制进行通信。不清楚连接的信号和/或插槽是否应该转移到副本。如果它们将被转移,则意味着其他qobject将自动订阅该副本。这很可能会给开发人员带来混乱和不必要的副作用。

  • QObjects被组织在对象树中。通常一个QObject的一个实例有一个父对象和几个子对象。在这个层次结构中副本应该组织在哪里?孩子(和孙子……)也应该被复制吗?

  其他原因,但可能不那么重要,是:

  • 一个QObject可以被认为是唯一的,方法是给它一个可以用作参考键的名称,即通过设置QObject::objectName()。如果设置了名称,则不清楚应该为副本指定哪个名称。
  • QObjects可以在运行时使用新的属性进行扩展。副本是否也应该继承这些新属性?

  一般来说,QObjects是通过它们的指针地址被其他对象引用的。例如,前面提到的信号和槽机制就是这种情况。因此,QObjects无法移动;他们之间的联系就会消失。在QObject的源代码中,我们可以看到没有声明move构造函数或move赋值运算符。但是,由于复制构造函数被删除,所以不会隐式地生成move构造函数,如果开发人员试图移动QObject,就会报编译器错误。

  因此,您不能复制,也不能移动QObject,但是如果要复制底层数据(或属性)怎么办?Qt的文档在Qt对象模型中区分了两种对象类型:值对象和身份对象。值对象,如:QSize,QColor和QString是可被复制和分配的对象。相反,身份对象无法复制,但可以克隆。您可能已经猜到过,身份对象的一个​​示例是QOBject或从其派生的任何类。克隆的含义可以从官方文档中读取:

克隆意味着创建一个新的身份,而不是旧身份的完全副本。例如,双胞胎有不同的身份。他们可能看起来一样,但是他们有不同的名字,不同的地点,可能有完全不同的社交网络。

  我对克隆的理解是,你可以在一个子类中暴露一个clone()函数,它创建了一个新的身份,但不是一个真正的副本,即:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class MyClass : public QObject {
Q_OBJECT

public:
MyClass* clone() {
auto copy = new MyClass;
//copy only data
return copy;
}

private:
//data
};
...

auto my_class = new MyClass;
auto my_class_clone = my_class->clone();

  虽然这是可能做到的,但我不建议这样做。这可能会导致不必要的副作用,因为Qt开发人员很可能对QObject有一些假设。如果您需要创建一个克隆,我建议您查看一下您的总体设计和体系结构。也许数据可以解耦或分解?

Q_DISABLE_COPY(Class)在子类中重复

  在stackoverflow帖子建议总是在你自己的类中重新声明宏Q_DISABLE_COPY(Class),即:

1
2
3
4
5
6
class MyClass : public QObject {
Q_OBJECT
Q_DISABLE_COPY(MyClass) // See macro below
public:
QObject() {}
};

注:(stackoverflow帖子https://stackoverflow.com/questions/19854371/repeating-q-disable-copy-in-qobject-derived-classes)

1
2
3
#define Q_DISABLE_COPY(Class) \
Class(const Class &); \
Class &operator=(const Class &);

  正如stackoverflow帖子中所述,主要原因是为了*改善错误信息。如果没有宏,则使用Qt4报告以下错误信息:

错误:’QObject::QObject(const QObject&)’在此上下文中是私有的。

使用宏,将会报以下错误信息:

错误:’MyClass::MyClass (const MyClass&)’在此上下文中是私有的。

  对于Qt的新手来说,最后一条错误消息要容易得多。

  但是从Qt5开始,宏被更改并声明为:

1
2
3
4
5
6
7
8
9
#ifdef Q_COMPILER_DELETE_MEMBERS 
# define Q_DECL_EQ_DELETE = delete
#else
# define Q_DECL_EQ_DELETE
#endif

#define Q_DISABLE_COPY(Class) \
Class(const Class &) Q_DECL_EQ_DELETE;\
Class &operator=(const Class &) Q_DECL_EQ_DELETE;

  不在子类中添加宏,则显示以下错误消息:

错误:使用已删除的函数’MyClass::MyClass (const MyClass&)’。

  复制构造函数和赋值操作符使用=delete声明,而不再是声明私有,从而产生了一个首选的错误消息。

  即使错误消息已得到改善,我仍然相信在派生类中重新声明宏是有价值的,因为它记录了类的行为。刚接触Qt的人可以快速了解预期的用法:不应(也不能)复制对象!

Qt开源版 vs 商业版

发表于 2019-11-15

简单整理Qt开源版与商业版有哪些差别,仅供参考。

  • 简单对比
开源版 商业版
许可证 大部分采用对商业使用不友好的LGPLv3 具备商业许可证保护代码专有
许可证相关 大部分模块使用LGPLv3和部分模块使用GPL组成 仅第三方开源组件使用Qt的其他许可证
Qt模块功能 支持 支持
技术支持 不支持 支持
嵌入式开发工具和解决方案 不支持 支持
费用 免费 桌面&移动端大约4万元一个开发者使用,嵌入式看具体使用&支持程度
  • 详细对比
    main_page

链接地址:https://www.qt.io/cn/download

注:
  由于开源版不提供售后,商业版的提供售后(技术支持),即Bug修复率会高于开源版,当然软件性能,稳定性和资源消耗的表现也会优于开源版。
  LGPLv3对商业化代码不友好。LGPL允许商业软件通过类库引用(link)方式使用LGPL类库而不需要开源商业软件的代码,但需要提供引用LGPL的库代码或提供可重链接的动态库。

写于2019年11月15日

Flat风格的Qml按钮

发表于 2019-11-14

使用Qml的Button控件修改而成。

demo.gif

源码

  • Button源码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    import QtQuick 2.0
    import QtQuick.Controls 2.0
    import QtGraphicalEffects 1.0

    Button {
    id: root
    property color backgroundDefaultColor: "#4E5BF2"
    property color backgroundPressedColor: Qt.darker(backgroundDefaultColor, 1.2)
    property color contentItemTextColor: "white"

    text: "Button"
    contentItem: Text {
    text: root.text
    color: root.contentItemTextColor
    font.pixelSize: 15
    font.family: "Arial"
    font.weight: Font.Thin
    horizontalAlignment: Text.AlignHCenter
    verticalAlignment: Text.AlignVCenter
    elide: Text.ElideRight
    }

    background: Rectangle {
    implicitWidth: 83
    implicitHeight: 37
    color: root.down ? root.backgroundPressedColor : root.backgroundDefaultColor
    radius: 3
    layer.enabled: true
    layer.effect: DropShadow {
    transparentBorder: true
    color: root.down ? root.backgroundPressedColor : root.backgroundDefaultColor
    samples: 20
    }
    }
    }
  • 按钮组样式源码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    GridLayout {
    anchors.centerIn: parent
    rows: 3
    columns: 3
    rowSpacing: 30
    columnSpacing: 30

    Button {
    text: "First"
    backgroundDefaultColor: "#727CF5"
    }

    Button {
    text: "Secondary"
    backgroundDefaultColor: "#5A6268"
    }

    Button {
    text: "Success"
    backgroundDefaultColor: "#0ACF97"
    }

    Button {
    text: "Danger"
    backgroundDefaultColor: "#F9375E"
    }

    Button {
    text: "Warning"
    contentItemTextColor: "#313A46"
    backgroundDefaultColor: "#FFBC00"
    }

    Button {
    text: "Info"
    backgroundDefaultColor: "#2B99B9"
    }

    Button {
    text: "Light"
    contentItemTextColor: "#313A46"
    backgroundDefaultColor: "#EEF2F7"
    }

    Button {
    backgroundDefaultColor: "#212730"
    backgroundPressedColor: "#313A46"
    }

    Button {
    backgroundDefaultColor: "#3498DB"
    }
    }
12…32
Qt君

Qt君

313 日志
41 标签
© 2019 Qt君
由 Hexo 强力驱动
|
主题 — NexT.Gemini v5.1.4
粤ICP备 - 16070052号