1.  QtSvg: No such file or directory

Applications that use Qt's SVG classes need to be configured to be built against the QtSvg module. To include the definitions of the module's classes, use the following directive:

    #include <QtSvg>

To link against the module, add this line to your qmake .pro file:

    QT += svg

   这样就可以了,OK。

   在Cmake中,需要改变以下语句:

   FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtSvg)

   或者添加以下语句:

   SET(QT_USE_QTSVG TRUE)

2.  Qt中进度条QProgressDialog使用

 

progress.setCancelButton(false);//将进度条中的取消按键设为false,不显示取消按键

progress.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);

                                 //不显示进度条上的“最小化”“最大化”“关闭”

progress.setWindowModality(Qt::ApplicationModal);//进度条读到头时自动关闭

progress.show();//进度条显示

progress.setRange(0,100);//进度条的进度范围

3.  Qt:发布程序的简单方式

 
编译时选择release模式, 如果用debug模式, 需要的相关dll文件会非常大, 如QtCore4d.dll就有70多M.
1. 拷贝release文件夹下生成的可执行程序到文件夹target
2. 拷贝 <qt root>\bin 文件夹下mingwm10.dll QtGui4.dll QtCore4.dll和QtSql4.dll4个DLL到文件夹target
3. target文件夹就可以作为完整的程序发布了。