Здравствуйте, гость ( Вход | Регистрация )
SABROG | Дата 20.3.2009, 11:59 |
WaitForSingleObject в виндовом API юзается для: * Change notification * Console input * Event * Memory resource notification * Mutex * Process * Semaphore * Thread * Waitable timer Где именно возник затык? В Qt нет хэндлеров для каждого из подобного варианта, т.ч. ожидание чего-то достигается для каждого случая разными способами. Что именно надо, заморозить программу до наступления определенного события (эвента)? Тогда локальный QEventLoop и выход из него по приходу нужного эвента. |
|
kuler | Дата 20.3.2009, 10:59 |
для QEvent что является аналогом WaitForSingleObject. То что ответил ViGOur это совсем не то | |
ViGOur | Дата 9.10.2007, 19:38 |
В принципе функции в Qt похожи названиями с виндовыми, тому пример QWidget::showNormal(), который тебе поможет. | |
Гость | Дата 9.10.2007, 19:36 |
еше вопрос Как минимализированное приложение (в таск баре), программно восстановить? |
|
ViGOur | Дата 9.10.2007, 19:34 |
смотри waitForFinished: Цитата bool QProcess::waitForFinished ( int msecs = 30000 ) Blocks until the process has finished and the finished() signal has been emitted, or until msecs milliseconds have passed. Returns true if the process finished; otherwise returns false (if the operation timed out or if an error occurred). This function can operate without an event loop. It is useful when writing non-GUI applications and when performing I/O operations in a non-GUI thread. Warning: Calling this function from the main (GUI) thread might cause your user interface to freeze. If msecs is -1, this function will not time out. bool QThread::wait ( unsigned long time = ULONG_MAX ) Blocks the thread until either of these conditions is met: The thread associated with this QThread object has finished execution (i.e. when it returns from run()). This function will return true if the thread has finished. It also returns true if the thread has not been started yet. time milliseconds has elapsed. If time is ULONG_MAX (the default), then the wait will never timeout (the thread must return from run()). This function will return false if the wait timed out. This provides similar functionality to the POSIX pthread_join() function. |
|
Гость | Дата 9.10.2007, 19:31 |
Есть ли аналог WaitForSingleObject в QT. Сейчас пока обхожусь QEvent. | |
Просмотр темы полностью (откроется в новом окне) | |
Текстовая версия | Сейчас: 19.4.2024, 5:21 |