Qt教程
https://zhuanlan.zhihu.com/p/28472916
http://c.biancheng.net/view/1820.html
https://github.com/feiyangqingyun/QWidgetDemo
http://www.qtcn.org/
https://qtguide.ustclug.org/
https://github.com/cwc1987/QmlBook-In-Chinese
Qt 计算文件的 md5 值
https://www.jianshu.com/p/fe774becf239
QString fileMd5(const QString &sourceFilePath) {
QFile sourceFile(sourceFilePath);
qint64 fileSize = sourceFile.size();
const qint64 bufferSize = 10240;
if (sourceFile.open(QIODevice::ReadOnly)) {
char buffer[bufferSize];
int bytesRead;
int readSize = qMin(fileSize, bufferSize);
QCryptographicHash hash(QCryptographicHash::Md5);
while (readSize > 0 && (bytesRead = sourceFile.read(buffer, readSize)) > 0) {
fileSize -= bytesRead;
hash.addData(buffer, bytesRead);
readSize = qMin(fileSize, bufferSize);
}
sourceFile.close();
return QString(hash.result().toHex());
}
return QString();
}
Qt打包发布程序
https://www.cnblogs.com/god-of-death/p/9876777.html
qtPack.sh
#! /bin/sh
#./qtenv.sh
#exe="simulator"
#des="./src/source_code/XlinkDeviceSimulator/qt/build-simulator-Desktop_Qt_5_12_1_GCC_64bit-Release/release"
#deplist=$(ldd $exe | awk '{if (match($3,"/")){ printf("%s "),$3 } }')
#cp $deplist $des
build_day=$(date +%Y%m%d)
RELEASE_DIR="./linux-xlinkUpgradeTools"
SRC_EXE_DIR="./build-*-Release"
OUTPUT_DIR="../output"
EXE="xlinkUpgradeTools"
mkdir -p $RELEASE_DIR
mkdir -p $OUTPUT_DIR
cp -rf $SRC_EXE_DIR/$EXE $RELEASE_DIR/
cd $RELEASE_DIR
envpath="/opt/Qt/5.12.2"
basepath=$(cd `dirname $0`; pwd)
source /etc/profile
export PATH=${envpath}/gcc_64/bin:$PATH
export LD_LIBRARY_PATH=${envpath}/gcc_64/lib/:$LD_LIBRARY_PATH
echo "FILE PATH IS:"
echo $basepath
echo "BIN PATH IS:"
printenv PATH
echo "LD_LIBRARY_PATH IS:"
printenv LD_LIBRARY_PATH
linuxdeployqt-5-x86_64.AppImage $EXE -appimage
#cp ../../CHANGELOG.md .
cd ../
#zip -r $OUTPUT_DIR/$build_day-qt-simulator.zip $RELEASE_DIR