• 7461阅读
  • 3回复

QT4下有没有类似sleep下的函数? [复制链接]

上一主题 下一主题
离线yleesun
 

只看楼主 倒序阅读 楼主  发表于: 2008-08-05
— 本帖被 XChinux 执行加亮操作(2008-08-05) —
QT4下有没有类似sleep下的函数?
因为在unix下运行,所以win32的sleep应该不可用。
请问有没有其他可以解决的办法?
离线txiejun
只看该作者 1楼 发表于: 2008-08-05
void QApplication::setOverrideCursor ( const QCursor & cursor )  [static]
你看看这个用法能不能满足你的要求:
void QApplication::setOverrideCursor ( const QCursor & cursor )  [static]

Sets the application override cursor to cursor.
Application override cursors are intended for showing the user that the application is in a special state, for example during an operation that might take some time.
This cursor will be displayed in all the application's widgets until restoreOverrideCursor() or another setOverrideCursor() is called.
Application cursors are stored on an internal stack. setOverrideCursor() pushes the cursor onto the stack, and restoreOverrideCursor() pops the active cursor off the stack. changeOverrideCursor() changes the curently active application override cursor. Every setOverrideCursor() must eventually be followed by a corresponding restoreOverrideCursor(), otherwise the stack will never be emptied.

Example:
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
calculateHugeMandelbrot();              // lunch time...
QApplication::restoreOverrideCursor();
See also overrideCursor(), restoreOverrideCursor(), changeOverrideCursor(), and QWidget::setCursor().
三分天注定,七分靠打拼,爱拼才会赢!
离线yfx2003

只看该作者 2楼 发表于: 2008-08-05
linux系统也有 sleep 函数
www.qtcn.org/gpq4/
ajaxref.okajax.com/
离线uyoufaith

只看该作者 3楼 发表于: 2008-08-07
QT在QThread封装了一个sleep()
快速回复
限100 字节
 
上一个 下一个