Skip to content

Commit f14441d

Browse files
committed
add Qt processEvents
1 parent 6568905 commit f14441d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
- [qDebug常用特性](src/Qt/qDebug.md)
165165
- [QWebEngineView 调试](src/Qt/QWebEngineViewDebugging.md)
166166
- [QPushButton](src/Qt/QPushButton.md)
167+
- [processEvents使用](src/Qt/processEvents.md)
167168
4. [数字孪生](src/DigitalTwin/README.md)
168169
4. [GTK](src/GTK/README.md)
169170
- [GTK简介](src/GTK/GTK.md)

src/Qt/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@
5252
- [QDateTime与QTime获取系统当前时间](QTime.md)
5353
- [qDebug常用特性](qDebug.md)
5454
- [QWebEngineView 调试](QWebEngineViewDebugging.md)
55-
- [QPushButton](QPushButton.md)
55+
- [QPushButton](QPushButton.md)
56+
- [processEvents使用](processEvents.md)

src/Qt/processEvents.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## processEvents
2+
- 定义
3+
4+
void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents)
5+
- 文档
6+
- Processes some pending events for the calling thread according to the specified flags.
7+
- 根据指定的标志处理调用线程的一些挂起事件。
8+
- You can call this function occasionally when your program is busy performing a long operation (e.g. copying a file).
9+
- 当程序忙于执行长时间操作(例如复制文件)时,您可以偶尔调用此函数。
10+
- In the event that you are running a local loop which calls this function continuously, without an event loop, the DeferredDelete events will not be processed. This can affect the behaviour of widgets, e.g. QToolTip, that rely on DeferredDelete events to function properly. An alternative would be to call sendPostedEvents() from within that local loop.
11+
- Calling this function processes events only for the calling thread, and returns after all available events have been processed. Available events are events queued before the function call. This means that events that are posted while the function runs will be queued until a later round of event processing.

0 commit comments

Comments
 (0)