qt 手搓ui

简介: qt 手搓ui
#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include "QHBoxLayout"
#include "QVBoxLayout"
#include "QCheckBox"
#include "QRadioButton"
#include "QPlainTextEdit"
#include "QPushButton"

class Dialog : public QDialog
{
    Q_OBJECT

public:
    Dialog(QWidget *parent = nullptr);
    ~Dialog();
private:
    QCheckBox *cheBoxUnder;

};
#endif // DIALOG_H
#include "dialog.h"


Dialog::Dialog(QWidget *parent)
    : QDialog(parent)
{
    cheBoxUnder = new QCheckBox("点击关闭");
    QHBoxLayout* HLayl = new QHBoxLayout();
    HLayl->addWidget(cheBoxUnder);
    setLayout(HLayl);
    connect(cheBoxUnder,SIGNAL(clicked(bool)),this,SLOT(close()));

}

Dialog::~Dialog() {}
目录
相关文章
|
4月前
|
算法 数据可视化 程序员
【Qt UI】调色板QPalette类在Qt编程中的应用
【Qt UI】调色板QPalette类在Qt编程中的应用
114 0
|
4月前
|
算法 API C++
【Qt UI】QT 窗口/控件置顶方法详解
【Qt UI】QT 窗口/控件置顶方法详解
343 0
|
4月前
|
算法 前端开发 C++
【Qt UI相关】Qt设置窗体或控件的背景色透明
【Qt UI相关】Qt设置窗体或控件的背景色透明
475 0
|
4月前
|
存储 测试技术 UED
Qt中实现界面回放的艺术:从理论到代码“ (“The Art of Implementing UI Playback in Qt: From Theory to Code
Qt中实现界面回放的艺术:从理论到代码“ (“The Art of Implementing UI Playback in Qt: From Theory to Code
112 1
|
4月前
|
C++
QT第一个程序命名空间详解,解释ui_widget的和xxx.cpp的联系
QT第一个程序命名空间详解,解释ui_widget的和xxx.cpp的联系
82 0
|
4月前
|
编解码 C++
Qt第一课 第一个ui界面
Qt第一课 第一个ui界面
56 2
|
4月前
|
算法 API 开发者
【Qt UI相关】Qt中如何控制 窗口的最大化、最小化和关闭按钮?一文带你掌握用法
【Qt UI相关】Qt中如何控制 窗口的最大化、最小化和关闭按钮?一文带你掌握用法
767 1
|
4月前
|
算法 开发者
【Qt UI相关】Qt5和Qt6中关于高DPI缩放属性
【Qt UI相关】Qt5和Qt6中关于高DPI缩放属性
413 1
|
4月前
Qt6学习笔记四(ui使用、资源文件添加)
Qt6学习笔记四(ui使用、资源文件添加)
154 0
|
4月前
|
C++
[Qt5&VS] VS编译生成Qt的ui_头文件
[Qt5&VS] VS编译生成Qt的ui_头文件
183 0