3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
Qt 4.7 學習紀錄~C++ 13 – Resource Files.mp4[建立qrc檔,讀取rc內定義的路徑檔案就只要在路徑前面加上冒號即可(影片03:03有明確教學)](YOUTUBE 教學備份) 教學影片來源:https://www.youtube.com/watch?v=6KtOzh0StTc&list=PL2D1942A4688E9D63 Tool來源:http://qt.software.informer.com/download/ Github資源收藏:https://github.com/jash-git/Win_Qt_Learn 本教學內容,建立qrc檔,讀取rc內定義的路徑檔案就只要在路徑前面加上冒號即可(影片03:03有明確教學) 內容重點         建立一個Qt Console的專案程式而非一個QT空專案         測試確定qrc內所指定的檔案會被包覆到執行檔中,所以在任何地方都可執行 #include #include #include #include #include #include using namespace std; void Pause() {     printf(“Press Enter key to continue…”);     fgetc(stdin); } int main(int argc, char *argv[]) {     //–Pause()取代 QCoreApplication a(argc, argv);     std::cout<     QString src(“:/Qrc_Path/main.cpp”);     QFile file(src);     if (!file.open(QIODevice::ReadOnly)) {         cerr << “Cannot open file for reading:”              << qPrintable(file.errorString()) << endl;         return false;     }     QTextStream in(&file);     while (!in.atEnd()) {         cout << qPrintable(in.readLine()) << endl;     }     in.flush();     file.close();     Pause();     return 1;//return a.exec(); }                Your browser does not support the HTML5 video tag.        

本文由jashliaoeuwordpress提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦