随笔分类 -  QT basis

摘要:FramelessWindowHint: 生成无边界窗口。用户不能通过窗口系统移动或调整无边界窗口的大小。 WindowStaysOnTopHint:通知窗口系统该窗口应位于所有其他窗口的顶部 阅读全文
posted @ 2021-03-17 20:43 countryboy666 阅读(192) 评论(0) 推荐(0)
摘要:需要注意的是:mutable不能修饰const 和 static 类型的变量。 #include <iostream> using namespace std; class Person{ public: Person(); ~Person(); int getAge() const; int ge 阅读全文
posted @ 2021-03-17 13:15 countryboy666 阅读(129) 评论(0) 推荐(0)
摘要:pro文件添加 sql: (1)QSqlQueryModel类为SQL结果集提供只读数据模型。 void QSqlQueryModel::setQuery(const QSqlQuery &query): 重置模型并将数据提供程序设置为给定查询。 bool QSqlQueryModel::canFe 阅读全文
posted @ 2021-03-01 20:35 countryboy666 阅读(241) 评论(0) 推荐(0)
摘要:canvas 绘制图片 Canvas{ id: canvas onImageLoaded: requestPaint() // 加载图片后,重绘图片 Compent.onCompleted:{ loadImage("qrc:/Tux.png") } onPaint:{ var ctx = getCo 阅读全文
posted @ 2021-02-24 00:19 countryboy666 阅读(46) 评论(0) 推荐(0)
摘要:第一步: 在百度官网创建应用 第二步: 点击技术文档使用 阅读全文
posted @ 2021-02-24 00:14 countryboy666 阅读(234) 评论(0) 推荐(0)
摘要:void QMapToJson() { QMap<QString,QVariant> mapData = QMap<QString,QVariant>(); // 定义一个map mapData.insert("id","30001"); // 插入数据 mapData.insert("number 阅读全文
posted @ 2020-12-01 14:57 countryboy666 阅读(1699) 评论(0) 推荐(0)
摘要:settings = Qsettings(“MySoft”,”QtPad”)Mainwindow = QmainWindow() settings.setValue(“pos”,QVariant(Mainwindow.pos())settings.setValue(“size”,QVariant(M 阅读全文
posted @ 2019-11-10 20:39 countryboy666 阅读(447) 评论(0) 推荐(0)
摘要:1 怎么创建的数据库? 2 怎么把界面从端口发送到外显屏? 3 打印机的操作? 1 怎么创建的数据库? (1) 把一个QVariantMap 存入数据库: bool Parameter::insertEventData(const QVariantMap &event) { bool bRet = 阅读全文
posted @ 2019-11-10 20:27 countryboy666 阅读(174) 评论(0) 推荐(0)
摘要:qt串口通信:#ifdef _TTY_POSIX#include "posix_qextserialport.h"#define QextBaseType Posix_QextSerialPort #else#include "win_qextserialport.h"#define "QextBa 阅读全文
posted @ 2019-09-15 18:13 countryboy666 阅读(308) 评论(0) 推荐(0)
摘要:insertRecord(const QVariantMap &trans){ bool ret = false; if(trans.isEmpty()) { return ret; } QString dbName = QString("./data/Record.db") QString sql 阅读全文
posted @ 2019-09-10 14:50 countryboy666 阅读(261) 评论(0) 推荐(0)
摘要:今天买的QT5.9到手了。看了前两章:namespce ui{class widget;}class widget:public QWidget{ }两个widget 不是同一个类。ui的设计:伙伴关系是指将一个组件和另一个组件相关联。Tab顺序是指在程序运行时按下的Tab输入焦点的移动顺序。 阅读全文
posted @ 2019-09-10 00:15 countryboy666 阅读(97) 评论(0) 推荐(0)
摘要:<!-- p, li { white-space: pre-wrap; } --> <!--StartFragment-->#ifndef MAINWINDOW_H #define MAINWINDOW_H QT += core gui sql #include <QMainWindow> #inc 阅读全文
posted @ 2019-06-23 14:17 countryboy666 阅读(87) 评论(0) 推荐(0)
摘要:<!-- p, li { white-space: pre-wrap; } --> QSystemTrayIcon 阅读全文
posted @ 2019-06-23 06:46 countryboy666 阅读(125) 评论(0) 推荐(0)
摘要:QT += core gui webenginewidgets //窗口引擎部件//显示原码的dialog #ifndef DIALOG_H #define DIALOG_H #include <QDialog> namespace Ui { class Dialog; } class Dialog 阅读全文
posted @ 2019-06-23 05:56 countryboy666 阅读(545) 评论(0) 推荐(0)
摘要:<!-- p, li { white-space: pre-wrap; } --> <!--StartFragment-->#ifndef MAINWINDOW_H #define MAINWINDOW_H <!-- p, li { white-space: pre-wrap; } --> <!-- 阅读全文
posted @ 2019-06-23 05:39 countryboy666 阅读(167) 评论(0) 推荐(0)
摘要:<!-- p, li { white-space: pre-wrap; } --> <!--StartFragment-->#include <QGuiApplication> <!-- p, li { white-space: pre-wrap; } --> <!--StartFragment-- 阅读全文
posted @ 2019-06-23 05:29 countryboy666 阅读(213) 评论(0) 推荐(0)
摘要:<!-- p, li { white-space: pre-wrap; } --> <!--StartFragment-->#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QSharedMemory 阅读全文
posted @ 2019-06-22 12:04 countryboy666 阅读(454) 评论(0) 推荐(0)
摘要:<!-- p, li { white-space: pre-wrap; } --> <!--StartFragment-->#include <QCoreApplication> //Qt Console Application 桌面控制台 #include <QDir>//文件夹 #include 阅读全文
posted @ 2019-06-22 10:20 countryboy666 阅读(179) 评论(0) 推荐(0)
摘要:<!-- p, li { white-space: pre-wrap; } --> <!--StartFragment-->#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QTimer> //定时期 阅读全文
posted @ 2019-06-22 10:11 countryboy666 阅读(169) 评论(0) 推荐(0)
摘要:<!-- p, li { white-space: pre-wrap; } --> <!--StartFragment-->#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QListWidgetIt 阅读全文
posted @ 2019-06-22 10:02 countryboy666 阅读(111) 评论(0) 推荐(0)