[static] QString QCoreApplication::applicationDirPath()
qApp->applicationDirPath();
2.Returns pathName with the '/' separators converted to separators that are appropriate for the underlying operating system.
The returned string may be the same as the argument on some operating systems, for example on Unix.
This function was introduced in Qt 4.2.
[static] QString QDir::toNativeSeparators(const QString &pathName)
QString path = QApplication::applicationDirPath() + "/" + "24rgb.bmp";
path = QDir::toNativeSeparators(path);
QImage QImage::convertToFormat(Format format, Qt::ImageConversionFlags flags = Qt::AutoColor) const
4.获取文件路径的绝对路径
QString QFileInfo::absolutePath() const
QFileInfo file("C:\\Program Files\\Microsoft SQL Server\\80\\COM\\sqlvdi.dll");
QString absolutePath = file.absolutePath(); // "C:/Program Files/Microsoft SQL Server/80/COM"
5.显示非模态对话框,阻塞后面的调用,直到该非模态对话框关闭
QDialog dlg;
dlg.show();
QEventLoop loop;
connect(&dlg, SIGNAL(finished(int)), &loop, SLOT(quit()));
loop.exec(QEventLoop::ExcludeUserInputEvents);//loop.exec(),不排除用户输入事件
http://blog.youkuaiyun.com/cocoasprite/article/details/54631692
6.测量运行时间:QElapsedTimer与QTime
458



被折叠的 条评论
为什么被折叠?



