自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

原创 【其他】应用程序开机启动或禁用开机启动设置

禁用应用开机启动1.打开任务管理器2.

2021-01-26 17:24:58 403

原创 【Qt Quick】Json文件读写

目录读取文件写文件说明QJsonDocument并不会直接操作文件,需要自行利用QFile进行readAll或者Write;读取文件利用Qml的读写文件的操作将Json格式的文件内容传给QJsonDocument就可以操作了void UDP::analysisJson(){ FileObject fo; QJsonParseError error; //读取文件 QJsonDocument _json = QJsonDocument:

2021-01-26 16:50:30 745

原创 【Qt Quick】qDebug()

目录打印中文时出错打印中文时出错qDebug()<<QString::fromLocal8Bit("对象不正确地终止以右花括号结束")

2021-01-26 16:42:02 124

原创 【Qt Quick】QString

目录截断截断截断一个字符;QStringtempString=json.toJson(QJsonDocument::Indented).mid(1);从第0个字符开始截取5个字符,保留剩下的字符;QStringtempString=json.toJson(QJsonDocument::Indented).mid(0,5);

2021-01-26 16:40:28 363

原创 【Qt Quick】ListView

目录示例示例.qmlComponent{ id:record_Com Button{ id:btn width: parent.width-25 height: 40 Text { text: name anchors.verticalCenter: parent.verticalCenter

2021-01-26 16:34:57 344

原创 【Qt Quick】简单UDP通信

目录ServerClientServer.h#ifndef UDP_H#define UDP_H#include <QObject>#include <QUdpSocket>class UDP : public QObject{ Q_OBJECTpublic: explicit UDP(QObject *parent = nullptr); void initSocket(); //获得本机IP

2021-01-26 16:27:09 285

原创 【Qt Quick】类型转换(未完)

目录QByteArray → QStringQByteArray → 结构体结构体 → QByteArrayint → QStringQByteArray → QString头文件:#include<QTextCodec>实现:qStrGet=QTextCodec::codecForName("GBK")->toUnicode(bytRecvData);QByteArray → 结构体target是一个结构体对象QByteArray bySendData; bySend

2021-01-26 16:21:45 116

原创 【Qt Quick】滚动显示文本

//滚动显示Flickable{ anchors.fill: parent //内容的宽度 contentHeight : information_TE.implicitHeight //内容的高度 //contentWidth: information_TE.implicitWidth clip: true anchors.centerIn : parent TextEdit{

2021-01-26 16:16:00 257

原创 【Qt Quick】动态获取当前系统日期时间

效果.qmlimport QtQuick 2.0Item{ id:cdt_ROOT width : 280 height : 30 Text { id: dateTime_Text text : "" anchors.centerIn : parent color : "white" font{

2021-01-26 16:14:38 403

原创 【XML】基本介绍

目录XML简介XML是什么XML和HTML区别XML对于HTML的意义XML树结构XML语法XML文档必须有根元素XML声明XML关闭标签XML标签大小写敏感XML必须正确嵌套XML属性值必须加引号XML 中的注释XML实体引用XML 中,空格会被保留XML换行XML命名规则基于【菜鸟教程】摘抄对于我有用的部分。XML简介XML是什么XML是一种很像HTML的标级语言;XML的设计宗旨是传输数据,而不是显示数据;XML 标签没有被预定义。您需要自行定义标签;XML 被设计为具有自我描述性

2021-01-26 15:57:01 97

原创 【Qt Quick】QFile

写入读取.h#ifndef FILEOBJECT_H#define FILEOBJECT_H#include <QObject>class FileObject : public QObject{ Q_OBJECTpublic: explicit FileObject(QObject* parent = nullptr); QString readFile(); bool writeFile(const QString&

2021-01-22 15:30:59 212

原创 【Qt Quick】获取本机IP

包含头文件#include <QHostAddress>#include <QNetworkInterface>实现QString UDP::getHostIpAddress(){ QString strIpAddress; QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses(); // 获取第一个本主机的IPv4地址 int nLi

2021-01-22 15:19:29 150

原创 【Qt Quick】QDateTime

获取时间分别获取时分秒 QDateTime dateTime = QDateTime::currentDateTime(); int tempHH = dateTime.toString("hh").toInt(); int tempMM = dateTime.toString("mm").toInt(); int tempSS = dateTime.toString("ss").toInt(); int tempZZZ= dateTime.toString("zz

2021-01-22 14:40:06 104

原创 【Qt Quick】C++结构体数据的使用

说明qml没办法直接访问结构体的数据,这里我使用QMap嵌套QVariantMap的方法。步骤定义QMap和QVariantMap的对象(.cpp)QVariantMap qVMap; //存储结构体的每条数据QMap<int,QVariantMap> qMap; //存储qVMap先将需要的数据存入qVMap,再将qVMap压入qMap,相当于map套map(.cpp)qVMap.insert("targ

2021-01-20 18:06:23 502

原创 【Qt Quick】去除边框后自己实现拉伸

import QtQuick 2.0/*窗口缩放功能(未使用)*/Item { id:tzw_ROOT anchors.fill: parent property var target: 0 //目标窗口 property var tempLocationX:0 property var tempLocationY:0 property var _X: 0 property var _Y: 0 //左 Mous

2021-01-15 14:41:55 183

原创 【Qt Quick】拉伸窗口面板闪烁

说明去除原装窗口边框后,自己实现了窗口的缩放功能,但是拖拽的时候面板上的内容会闪烁。解决办法main.cppQCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);

2021-01-15 14:41:03 1011 5

原创 【Qt Quick】MouseArea

代码 MouseArea{ anchors.fill: parent hoverEnabled: true onEntered: { console.log(11111) } onWheel: { //滚轮 var datl = whe

2021-01-15 09:52:30 241

原创 【Qt Quick】ChartView

使用报错传送门范例Item{ id:view_Item anchors.top: quit_Item.bottom width: parent.width height: parent.height - 30 ChartView{ id:tgp_Chart x: 130 y: 40 anchors.fill: parent

2021-01-14 17:25:31 403

原创 【Qt Quick】ASSERT: “!“No style available without QApplication!““ in file

说明使用Charts画曲线图出现的错误。解决办法1.pro中加入QT += charts qml quick;2.main.cpp中QGuiApplication app(argc, argv);修改成QApplication app(argc, argv);

2021-01-14 17:03:25 628

原创 【Qt Quick】Slider

展示红线框部分代码 Slider{ id:time_Slider anchors.left: left_Rec.right anchors.leftMargin: 10 anchors.right: right_Rec.left anchors.rightMargin: 10 heigh

2021-01-14 15:06:39 116

原创 【Qt Quick】libpng warning: iCCP: known incorrect sRGB profile

警告内容libpng warning: iCCP: known incorrect sRGB profile解决方法将图片在ps中打开重新存一遍,替换掉原图即可,

2021-01-14 14:48:48 127

原创 【Qt Quick】打开文件对话框

//任务栏显示矩形框 Rectangle{ id:view_Rec anchors.fill: parent border.color: "black" border.width: 1 Column{ id:view_Row width: parent.width-10 height: parent.height-10 a.

2021-01-12 17:56:13 317

原创 【Qt Quick】设置程序图标

1.将要设置为图标的图片保存为.ico格式。2.创建一个后缀为.rc的文件,在文件中输入:IDI_ICON1 ICON DISCARDABLE "图片名.ico"3.在pro中添加:RC_FILE = 文件名.rc

2021-01-05 09:35:04 832

原创 【C++】ini文件

ini文件头文件#include <Windows.h>读取字符串说明:如果字符串中有中文,将ini文件重新另存为,编码选择ANSI格式即可。参数的意义:LPCSTR lpAppName:INI中的一个字段名,中括号内的名字LPCSTR lpKeyName:字段名下要读取的值的键名LPCSTR lpDefault:假如前两个参数没有值,就将这个值赋值给变量,可以写成(“”)LPSTR lpRet

2021-01-05 09:33:41 297

原创 【QT】QT下载链接

QT的下载与安装QT下载链接QT下载链接链接: link.推荐下载完整的离线安装包

2021-01-05 09:32:37 87

原创 【QT Quick】QML与C++交互

QML与C++交互Q_INVOKABLE二级目录三级目录Q_INVOKABLE说明:使用Q_INVOKABLE宏定义来修饰成员函数,目的在于被修饰的成员函数能够被元对象系统所唤起。.h文件:Q_INVOKABLE void bindWindow(int x,int y,int w,int h);.cpp文件:正常书写C++代码main.cpp文件:需包含头文件:#include <QQmlContext>包含类头文件时,如果此类代码放置于其他文件夹,则头文件需要加上文件

2021-01-05 09:31:58 256

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除