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

浙公网安备 33010602011771号