09 2019 档案

摘要:需要 #include <QPainter> #include "win.h" #include "ui_win.h" #include <QDebug> #include <QPainter> Win::Win(QWidget *parent) : QWidget(parent), ui(new 阅读全文
posted @ 2019-09-27 08:56 天子骄龙 阅读(1962) 评论(0) 推荐(0) 编辑
摘要:QTextStream 类(文本流)和 QDataStream 类(数据流)Qt 输入输出的两个核心类,其作用分别如下: ①、QTextStream 类:用于对数据进行文本格式的读/写操作,可在 QString、QIODevice或 QByteArray 上运行,比如把数据输出到 QString、Q 阅读全文
posted @ 2019-09-25 19:43 天子骄龙 阅读(6510) 评论(1) 推荐(0) 编辑
摘要:与Arduino的接线方法: 米其林编程: 阅读全文
posted @ 2019-09-24 10:50 天子骄龙 阅读(731) 评论(0) 推荐(0) 编辑
摘要:窗口标志 setWindowFlag(Qt::WindowStaysOnTopHint); /* Qt::FramelessWindowHint 产生一个无边框的窗口,此时用户无法移动窗口和改变窗口的大小 Qt::MSWindowsFixedSizeDialogHint 窗体不能调整大小 Qt::W 阅读全文
posted @ 2019-09-23 20:25 天子骄龙 阅读(961) 评论(0) 推荐(0) 编辑
摘要:定时器方式一: 定时器事件 需要 #include <QTimerEvent> #include "win.h" #include <QDebug> #include <QPushButton> Win::Win(QWidget *parent) : QWidget(parent) { this-> 阅读全文
posted @ 2019-09-19 16:32 天子骄龙 阅读(1257) 评论(0) 推荐(0) 编辑
摘要:需要 #include <QLabel> qmake: QT += widgets Inherits: QFrame QLabel 类是 QFrame 类的直接子类,因此 QLabel 可以使用从 QFrame 类继承而来的边框效果 可用于显示纯文本、富文本、电影、图像等 QLabel 会试图猜测输 阅读全文
posted @ 2019-09-19 06:54 天子骄龙 阅读(2497) 评论(0) 推荐(0) 编辑
摘要:位置和大小动画 this->resize(500,500); QLabel* label=new QLabel("动画",this); label->move(10,10); label->setStyleSheet("background-color: rgb(255, 251, 100)"); 阅读全文
posted @ 2019-09-15 16:12 天子骄龙 阅读(806) 评论(0) 推荐(0) 编辑
摘要:this->resize(300,200); button=new QPushButton("AAA",this); button->move(10,10); button->resize(50,50); button->setCursor(Qt::UpArrowCursor); //给部件设置光标 阅读全文
posted @ 2019-09-15 12:17 天子骄龙 阅读(2314) 评论(0) 推荐(0) 编辑
摘要:需要 #include <QSlider> 实例下载地址:https://share.weiyun.com/5pS1nZQ 阅读全文
posted @ 2019-09-14 19:46 天子骄龙 阅读(2575) 评论(0) 推荐(0) 编辑
摘要:#include <QSpinBox> #include <QDoubleSpinBox> QSpinBox 用于整数的显示和输入,一般显示十进制数,也可以显示二进制、十六进制的数,而且可以在显示框中增加前缀或后缀 QDoubleSpinBox 用于浮点数的显示和输入,可以设置显示小数位数,也可以设 阅读全文
posted @ 2019-09-14 10:27 天子骄龙 阅读(2508) 评论(0) 推荐(0) 编辑
摘要:视频教程地址:https://www.bilibili.com/video/av51766541/?p=30 阅读全文
posted @ 2019-09-13 14:07 天子骄龙 阅读(997) 评论(0) 推荐(0) 编辑
摘要:需要 #include <QTableWidget> #include <QTableWidgetItem> 实例下载地址:https://share.weiyun.com/5XJEW44 阅读全文
posted @ 2019-09-11 07:07 天子骄龙 阅读(5011) 评论(0) 推荐(0) 编辑
摘要:需要 #include <QTreeWidget> #include <QTreeWidgetItem> 实例下载地址:https://share.weiyun.com/5BhTQXr 阅读全文
posted @ 2019-09-10 10:34 天子骄龙 阅读(2410) 评论(0) 推荐(0) 编辑
摘要:需要 #include <QListWidget> #include <QListWidgetItem> 列表控件可以让我们以列表形式呈现内容,是界面更加有序美观。QListWidget列表控件应当与QListWidgetItem一起使用,后者作为项被添加入列表控件中,也就是说列表控件中的每一项都是 阅读全文
posted @ 2019-09-08 20:44 天子骄龙 阅读(6397) 评论(0) 推荐(0) 编辑
摘要:颜色对话框——QColorDialog: 需要 #include <QColorDialog> QColor color=QColorDialog::getColor(QColor(255,0,0,255)); //打开颜色对话框选择颜色 静态方法 //参数 起始选中的颜色 //返回值 选中的颜色 阅读全文
posted @ 2019-09-08 09:37 天子骄龙 阅读(254) 评论(0) 推荐(0) 编辑
摘要:需要 #include <QMessageBox> 阅读全文
posted @ 2019-09-07 08:13 天子骄龙 阅读(886) 评论(0) 推荐(0) 编辑
摘要:需要 #include <QDialog> this->resize(500,400); this->setWindowTitle("主窗口"); QDialog d(this); d.resize(200,200); d.setWindowTitle("模态还是非模态"); d.exec();// 阅读全文
posted @ 2019-09-06 12:30 天子骄龙 阅读(2058) 评论(0) 推荐(0) 编辑
摘要:一、QApplication、QGuiApplication、QCoreApplication 简介 1、继承关系见下图,其中左侧为顶级父类 QObject < QCoreApplication < QGuiApplication < QApplication 2、一个程序中只能有一个 QCoreA 阅读全文
posted @ 2019-09-05 23:10 天子骄龙 阅读(516) 评论(0) 推荐(0) 编辑
摘要:QMainWindow是一个为用户提供主窗口程序的类,包含一个菜单栏(menu bar)、多个工具栏(tool bars)、多个锚接部件(dock widgets)【就是浮动窗口】、一个状态栏(status bar)及一个中心部件(central widget) 阅读全文
posted @ 2019-09-03 15:26 天子骄龙 阅读(514) 评论(0) 推荐(0) 编辑
摘要:队列queue:先进先出 import threading import queue #队列模块 import time def func(q): while True: #s=q.get() #从队列里取值.如果q里没有值,会一直处于等待状态 #q.get_nowait() #从队列里取值.如果q 阅读全文
posted @ 2019-09-03 14:27 天子骄龙 阅读(374) 评论(0) 推荐(0) 编辑
摘要:格式: [函数对象参数] (形参) mutable 或 exception 声明 -> 返回值类型 {函数体} [函数对象参数]: []表示表达式的开始,必须有;用来设置如何捕获匿名函数外的变量 [ ]里为空 [ ]里为空,表示任何变量都不会传递给lambda表达式,没有参数 int a = 10; 阅读全文
posted @ 2019-09-02 20:36 天子骄龙 阅读(335) 评论(0) 推荐(0) 编辑
摘要:QString-->Char* str.toUtf8().data() pointf=QPointF(point); //将QPoint转换为QPointF point=pointf.toPoint(); //将QPointF转换为QPoint qreal: qreal是Qt的数据类型,在桌面操作系 阅读全文
posted @ 2019-09-02 12:45 天子骄龙 阅读(3927) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示