原创 QTranslator使用

pro文件中添加 TRANSLATIONS += my_CN.ts(my_CN名字自起) 打開qt 命令行工具,執行lupdate F:\qt_test\untitled1\untitled1.pro(路徑爲項目的pro路徑)

原创 QMutexLocker測試

mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QThread> class ThreadA :

原创 設計模式之——訪問者模式

element.h #ifndef ELEMENT_H #define ELEMENT_H #include "visitor.h" class Element { public: Element() {} vi

原创 Qt: QWidget、QMainWindow、QDialog和QFrame的區別

繼承關係: 在Qt中所有的類都有一個共同的基類QObject ,QWidget直接繼承與QPaintDevice類,QDialog、QMainWindow、QFrame直接繼承QWidget 類。 QWidget: QWidget

原创 Cannot create children for a parent that is in a different thread.

在線程中new對象時添加this提示: Cannot create children for a parent that is in a different thread. 去掉this就好了 void SocketThread:

原创 Qt Ftp操作

dialog.h #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include <QNetworkAccessManager> namespace Ui { cl

原创 qt 簡單UDP編程

dialog.h #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include <QUdpSocket> namespace Ui { class Dialog;

原创 FileZilla服務器,客戶端搭建

官網:https://filezilla-project.org/ 下載地址:https://download.csdn.net/download/sinat_33859977/11541309 一、FileZilla Serve

原创 qt文本檢索工具

概述 根據關鍵字,檢索文件夾下的文件內容 代碼 #include "widget.h" #include "ui_widget.h" #include <QDir> #include <QtDebug> #include <QF

原创 mariadb備份

數據庫備份與還原 1、備份 進入到數據庫安裝目錄\MariaDB 10.4\bin目錄下,執行mysqldump -uroot -p123456 databaseName > backpath\FileName_%date:,

原创 qt5.12 連接mariadb數據庫

介紹 mariadb是mysql的一個分支,代碼編寫上跟調用mysql一樣。 mariadb安裝 mariadb64下載: https://downloads.mariadb.org/. qt編譯mysql驅動 因爲qt5.12

原创 Qt進程間通信——QProcess

簡介 execute:阻塞運行 start:異步運行 delete process時,調用的exe結束進程 代碼 調用進程 #include "widget.h" #include "ui_widget.h" #include <

原创 Qt進程間通信——共享內存

說明 setkey:設置密鑰,密鑰是Qt應用程序用來標識共享內存段的標識符。 create:創建共享內存空間 lock/unlock:加鎖解鎖 attach:將進程與共享內存綁定 isAttached:判斷是否綁定 detach

原创 qt tableview 鼠標移動顯示QToolTip

QAbstractItemView 模型視圖框架,鼠標移動顯示座標數值 源碼:https://download.csdn.net/download/sinat_33859977/11930601 #include "widget.

原创 QT 打包程序

1、在桌面創建test文件夾 2、將生成的.exe可執行程序拷到test文件夾中 3、從開始菜單打開 Qt 命令行 4、輸入命令:cd /d C:\Users\sun\Desktop\test 。指定到exe目錄下 5、輸入命令