摘要: #include "dialog.h" #include "ui_dialog.h" Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); resize(320,150); 阅读全文
posted @ 2023-12-08 14:07 秃头的C# 阅读(112) 评论(0) 推荐(0)
摘要: private: QGridLayout * glayout; QPushButton *inputStudentNoButton; QLineEdit *inputStudentNoButtonLine; QPushButton *inputStudentNameButton; QLineEdit 阅读全文
posted @ 2023-12-08 11:24 秃头的C# 阅读(132) 评论(0) 推荐(0)
摘要: #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include<QPushButton> #include<QLineEdit> #include<QFontDialog> #include<QGridLayout> class Dialo 阅读全文
posted @ 2023-12-08 09:11 秃头的C# 阅读(21) 评论(0) 推荐(0)
摘要: QColorDialog类 Qt中提供标准对话框,其中QColorDialog类(颜色对话框)。备注:不同系统平台显示效果有所不同,(原因是系统主题风格不一样,但功能一样)。 #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include 阅读全文
posted @ 2023-12-07 16:24 秃头的C# 阅读(113) 评论(0) 推荐(0)
摘要: QFileDialog类(文件对话框) #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include <QLabel> #include <QLineEdit> #include <QPushButton> #include <QHBox 阅读全文
posted @ 2023-12-07 15:40 秃头的C# 阅读(16) 评论(0) 推荐(0)
摘要: 常用算法 double x=-92.42,y=25.98; double result1=qAbs(x); //取正数 qDebug() << "x="<<x<<";result="<<result1; double maxResult=qMax(result1,y); // 求2个数的最大数 qD 阅读全文
posted @ 2023-12-01 17:02 秃头的C# 阅读(26) 评论(0) 推荐(0)
摘要: QVariant,被称为万能数据类型,实际上它是类似C++的联合union类型。简单的说自定义性能强就像一个盒子几乎可以让你放任意的qt类型,同时可以轻松构造任意类型的任意复杂数据结构,但请注意复杂类型意味着性能和效率的让步。 qt6在文档中如下描述: 由于C++禁止联合union包含具有非默认构造 阅读全文
posted @ 2023-12-01 16:47 秃头的C# 阅读(252) 评论(0) 推荐(0)
摘要: QList类 对于不同数据类型,QList<T>采取不同的存储策略 如果T是一个指针类型或者指针大小的基本类型(该基本类型占有的字节数和指针类型占有的字节数相同),QList<T>将数值直接存储在它的数组中。 如果QList<T>存储对象的指针,则该指针只想实际存储的对象。 //QList类 QLi 阅读全文
posted @ 2023-11-22 17:29 秃头的C# 阅读(100) 评论(0) 推荐(0)
摘要: QMap QMap<Key,T>提供一个从类型为Key的键到类型为T的值的映射。形式为一个键对应一个值。按照键Key的次序存储数据。为了能够支持一键多值,QMap提供QMap<Key,T>::insertMulti()和QMap<Key,T>::values()的函数。 //QMap类 //1:创建 阅读全文
posted @ 2023-11-22 16:14 秃头的C# 阅读(163) 评论(0) 推荐(0)
摘要: QString::append() 将字符串末尾添加另一个字符串 QString str1 ="Good"; QString str2= "Sutdent"; str1.append(str2); 拼接字符串 int aa=99; int aa=99; double b=89.7; char c[1 阅读全文
posted @ 2023-11-21 16:02 秃头的C# 阅读(44) 评论(0) 推荐(0)