![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Qt/C++
小码一只
这个作者很懒,什么都没留下…
展开
-
QT 文件或目录拷贝,线程、进度条
文件/或目录拷贝,在子线程中实现,可实时通知拷贝进度#ifndef SYSTEMFILECOPY_H#define SYSTEMFILECOPY_H#include <QObject>class QThread;class SystemFileCopy : public QObject{ Q_OBJECTpublic: SystemFileCopy(const QString& SourcePath, const QString& TargetP原创 2020-12-04 16:14:18 · 894 阅读 · 0 评论 -
Qt QSettings 开机自启动软件
#include <QSettings>const QString REG_PATH = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run";void RegAppAutoStart(bool isAuto){ QString appPath = QCoreApplication::applicationFilePath(); QString appName = QCoreApplic原创 2020-11-26 14:58:43 · 150 阅读 · 0 评论 -
Qt HTTP上传文件
QT HTTP上传文件,主要功能在uploadFile函数中#ifndef HTTPMANGER_H#define HTTPMANGER_H#include <QObject>#include <QNetworkReply>class QNetworkAccessManager;class LoadingWidget;class HTTPManger : public QObject{ Q_OBJECTpublic: explicit HTTPMa原创 2020-09-21 16:29:44 · 1415 阅读 · 0 评论 -
强制写入磁盘
最近项目中调用库函数保存数据到磁盘,保存成功,但是发现写入磁盘会延时,导致看起来保存成功,但是突然断电后,发现数据写入磁盘不完整解决方案void FlushToDisk(const QString& fileName){ HANDLE phandle = CreateFile((LPCWSTR)(fileName.utf16()), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_ALW原创 2020-07-28 17:38:26 · 452 阅读 · 0 评论 -
Qt QWidget 去除默认边框,可自由拉伸缩放
插件类,可使得Qt QWidget去除边框,可自由拉伸/////.h#ifndef COMRESIZER_H#define COMRESIZER_H#include <QObject>#include <QMouseEvent>#include <QWidget>class COMResizer : public QObject{ Q_OBJECTpublic: explicit COMResizer(QWidget *parent =原创 2020-07-27 15:38:03 · 3006 阅读 · 0 评论 -
QToolBox的简易用法
QToolBox简单用法//.h#ifndef MYTOOLBOX_H#define MYTOOLBOX_H#include <QToolBox>class MyToolBox : public QToolBox{ Q_OBJECTpublic: explicit MyToolBox(QWidget *parent = nullptr);signals:public slots:private: void initUI();};#end原创 2020-07-27 14:10:04 · 489 阅读 · 0 评论 -
QListWidget鼠标滑动,滚轮滑动
QListWidget鼠标滑动,滚轮滑动//头文件.h#ifndef MYLISTWIDGET_H#define MYLISTWIDGET_H#include <QListWidget>class MyListWidget : public QListWidget{ Q_OBJECTpublic: MyListWidget(QWidget *parent = nullptr); ~MyListWidget();protected: void原创 2020-07-23 10:23:42 · 2461 阅读 · 2 评论