- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一个无法共享源代码的大项目。在那个项目中,我们在 Windows(不是在 ubuntu 中)中遇到了一些可重现的堆栈溢出错误,调试器的堆栈跟踪显示进度对话框设置为窗口模式,正在递归调用 QProgressDialog::setValue(int)。
我创建了这个小 example的 QProgressDialog 尝试重现错误。尽管使用此示例(在 Windows 或 Ubuntu 中都没有)我没有遇到堆栈溢出错误,但当我通过在调试器中添加断点来查看 QProgressDailog::setValue 时,我看到它也递归调用自身(在两个操作系统中) ,只是没有足够的时间产生堆栈溢出。最令人印象深刻的是,有时它确实只调用了一次 QPrigressDialog::setValue。
查看调用堆栈或窗口的示例:
Qt5Widgets.dll!QProgressDialog::setValue(int progress) Line 653 C++
[Inline Frame] Qt5Core.dll!QtPrivate::QSlotObjectBase::call(QObject *) Line 398 C++
Qt5Core.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 626 C++
Qt5Core.dll!QObject::event(QEvent * e) Line 1339 C++
Qt5Widgets.dll!QWidget::event(QEvent * event) Line 9094 C++
Qt5Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3687 C++
Qt5Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3639 C++
Qt5Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1075 C++
[Inline Frame] Qt5Core.dll!QCoreApplication::sendEvent(QObject *) Line 1470 C++
Qt5Core.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1815 C++
qwindows.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 82 C++
Qt5Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 525 C++
qwindows.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 75 C++
Qt5Widgets.dll!QProgressDialog::setValue(int progress) Line 663 C++
[Inline Frame] Qt5Core.dll!QtPrivate::QSlotObjectBase::call(QObject *) Line 398 C++
Qt5Core.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 626 C++
Qt5Core.dll!QObject::event(QEvent * e) Line 1339 C++
Qt5Widgets.dll!QWidget::event(QEvent * event) Line 9094 C++
Qt5Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3687 C++
Qt5Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3639 C++
Qt5Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1075 C++
[Inline Frame] Qt5Core.dll!QCoreApplication::sendEvent(QObject *) Line 1470 C++
Qt5Core.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1815 C++
qwindows.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 82 C++
Qt5Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 525 C++
qwindows.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 75 C++
Qt5Widgets.dll!QProgressDialog::setValue(int progress) Line 663 C++
[Inline Frame] Qt5Core.dll!QtPrivate::QSlotObjectBase::call(QObject *) Line 398 C++
Qt5Core.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 626 C++
Qt5Core.dll!QObject::event(QEvent * e) Line 1339 C++
Qt5Widgets.dll!QWidget::event(QEvent * event) Line 9094 C++
Qt5Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3687 C++
Qt5Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3639 C++
Qt5Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1075 C++
[Inline Frame] Qt5Core.dll!QCoreApplication::sendEvent(QObject *) Line 1470 C++
Qt5Core.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1815 C++
qwindows.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 82 C++
Qt5Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 525 C++
qwindows.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 75 C++
Qt5Widgets.dll!QProgressDialog::setValue(int progress) Line 663 C++
[Inline Frame] Qt5Core.dll!QtPrivate::QSlotObjectBase::call(QObject *) Line 398 C++
Qt5Core.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 626 C++
Qt5Core.dll!QObject::event(QEvent * e) Line 1339 C++
Qt5Widgets.dll!QWidget::event(QEvent * event) Line 9094 C++
Qt5Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3687 C++
Qt5Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3639 C++
Qt5Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1075 C++
[Inline Frame] Qt5Core.dll!QCoreApplication::sendEvent(QObject *) Line 1470 C++
Qt5Core.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1815 C++
qwindows.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 82 C++
Qt5Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 525 C++
qwindows.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 75 C++
Qt5Widgets.dll!QProgressDialog::setValue(int progress) Line 663 C++
[Inline Frame] Qt5Core.dll!QtPrivate::QSlotObjectBase::call(QObject *) Line 398 C++
Qt5Core.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 626 C++
Qt5Core.dll!QObject::event(QEvent * e) Line 1339 C++
Qt5Widgets.dll!QWidget::event(QEvent * event) Line 9094 C++
Qt5Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3687 C++
Qt5Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3639 C++
Qt5Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1075 C++
[Inline Frame] Qt5Core.dll!QCoreApplication::sendEvent(QObject *) Line 1470 C++
Qt5Core.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1815 C++
qwindows.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 82 C++
Qt5Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 525 C++
qwindows.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 75 C++
Qt5Widgets.dll!QProgressDialog::setValue(int progress) Line 663 C++
[Inline Frame] Qt5Core.dll!QtPrivate::QSlotObjectBase::call(QObject *) Line 398 C++
Qt5Core.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 626 C++
Qt5Core.dll!QObject::event(QEvent * e) Line 1339 C++
Qt5Widgets.dll!QWidget::event(QEvent * event) Line 9094 C++
Qt5Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3687 C++
Qt5Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3639 C++
Qt5Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1075 C++
[Inline Frame] Qt5Core.dll!QCoreApplication::sendEvent(QObject *) Line 1470 C++
Qt5Core.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1815 C++
qwindows.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 82 C++
Qt5Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 525 C++
qwindows.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 75 C++
Qt5Widgets.dll!QProgressDialog::setValue(int progress) Line 663 C++
[Inline Frame] Qt5Core.dll!QtPrivate::QSlotObjectBase::call(QObject *) Line 398 C++
Qt5Core.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 626 C++
Qt5Core.dll!QObject::event(QEvent * e) Line 1339 C++
Qt5Widgets.dll!QWidget::event(QEvent * event) Line 9094 C++
Qt5Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3687 C++
Qt5Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3639 C++
Qt5Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1075 C++
[Inline Frame] Qt5Core.dll!QCoreApplication::sendEvent(QObject *) Line 1470 C++
Qt5Core.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1815 C++
qwindows.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 82 C++
Qt5Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 525 C++
qwindows.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 75 C++
[Inline Frame] Qt5Core.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag>) Line 138 C++
Qt5Core.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 225 C++
Qt5Core.dll!QCoreApplication::exec() Line 1383 C++
progress_bar.exe!main(int argc, char * * argv) Line 9 C++
[External Code]
#0 0x00007ffff76fa330 in QProgressDialog::setValue(int) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#1 0x00007ffff60a3dec in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (QProgressDialog::*)(int)>::call(void (QProgressDialog::*)(int), QProgressDialog*, void**) ()
at /home/apalomer/programming_workspace/progress_bar_example/build/libthreadedworker.so
#2 0x00007ffff60a3ba4 in void QtPrivate::FunctionPointer<void (QProgressDialog::*)(int)>::call<QtPrivate::List<int>, void>(void (QProgressDialog::*)(int), QProgressDialog*, void**) ()
at /home/apalomer/programming_workspace/progress_bar_example/build/libthreadedworker.so
#3 0x00007ffff60a3759 in QtPrivate::QSlotObject<void (QProgressDialog::*)(int), QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) ()
at /home/apalomer/programming_workspace/progress_bar_example/build/libthreadedworker.so
#4 0x00007ffff6ef30c2 in QObject::event(QEvent*) (this=0x555555b74610, e=<optimized out>) at kernel/qobject.cpp:1247
#5 0x00007ffff751775b in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6 0x00007ffff74d883c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7 0x00007ffff74e0104 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8 0x00007ffff6ec38d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x555555b74610, event=event@entry=0x7fffc80037a0) at kernel/qcoreapplication.cpp:1024
#9 0x00007ffff6ec604d in QCoreApplication::sendEvent(QObject*, QEvent*) (event=0x7fffc80037a0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#10 0x00007ffff6ec604d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x55555576fef0)
at kernel/qcoreapplication.cpp:1699
#11 0x00007ffff6ec65d8 in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1553
#12 0x00007ffff6f1d263 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x5555558952a0) at kernel/qeventdispatcher_glib.cpp:276
#13 0x00007ffff4221417 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x00007ffff4221650 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffff42216dc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff6f1c88f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5555558d2b80, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#17 0x00007ffff76fa4c7 in QProgressDialog::setValue(int) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007ffff60a3dec in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (QProgressDialog::*)(int)>::call(void (QProgressDialog::*)(int), QProgressDialog*, void**) ()
at /home/apalomer/programming_workspace/progress_bar_example/build/libthreadedworker.so
#19 0x00007ffff60a3ba4 in void QtPrivate::FunctionPointer<void (QProgressDialog::*)(int)>::call<QtPrivate::List<int>, void>(void (QProgressDialog::*)(int), QProgressDialog*, void**) ()
at /home/apalomer/programming_workspace/progress_bar_example/build/libthreadedworker.so
#20 0x00007ffff60a3759 in QtPrivate::QSlotObject<void (QProgressDialog::*)(int), QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) ()
at /home/apalomer/programming_workspace/progress_bar_example/build/libthreadedworker.so
#21 0x00007ffff6ef30c2 in QObject::event(QEvent*) (this=0x555555b74610, e=<optimized out>) at kernel/qobject.cpp:1247
#22 0x00007ffff751775b in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ffff74d883c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff74e0104 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007ffff6ec38d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x555555b74610, event=event@entry=0x7fffc8002ef0) at kernel/qcoreapplication.cpp:1024
#26 0x00007ffff6ec604d in QCoreApplication::sendEvent(QObject*, QEvent*) (event=0x7fffc8002ef0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#27 0x00007ffff6ec604d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x55555576fef0)
at kernel/qcoreapplication.cpp:1699
#28 0x00007ffff6ec65d8 in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1553
#29 0x00007ffff6f1d263 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x5555558952a0) at kernel/qeventdispatcher_glib.cpp:276
#30 0x00007ffff4221417 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007ffff4221650 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007ffff42216dc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007ffff6f1c88f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5555558d2b80, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#34 0x00007ffff6ec190a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffcfb0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#35 0x00007ffff6eca9b4 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1297
#36 0x0000555555554cb4 in main ()
最佳答案
从我可以从您的示例代码中收集到的信息:
关于c++ - QProgressDialog::setValue 产生随机堆栈溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60989227/
我正在使用 QProgressDialog,它显然只显示进度并且它会沿途递增。当它达到 100% 时,其上的进度条将重置为零,而不是之后显示 100%。 progress是类的成员变量。 QShare
我在使用我的应用程序上的 QProgressDialog 时遇到了一些问题。 当用户点击计算按钮时,我会显示一个从 QThread 更新的 QProgressDialog(我认为这与问题无关),当这个
我想从我的工作线程更新一个modal QProgressDialog。但是,如果我将对话框设置为模态,我的应用程序就会崩溃(并且对话框没有显示任何进度)。如果我不这样做,一切都会顺利(但用户可以修改程
我正在使用 QProgressDialog 来显示从 QTreeView 中的数据库加载数据的进度。我使用信号和槽来发送记录数和当前记录。这是插槽代码: void MainWindow::loadDa
我正在运行处理器繁重的操作并使用 QProgressDialog 向用户报告。然而,取消按钮工作不稳定 - 有时它在整个运行过程中被忽略,有时它会响应,但仅在进度的某个点之后(这一点也不一致)。在我看
我有一个根据MVC模型设计的程序。我的 View 有一个 open 按钮,我可以在其中打开文件。文件被解析,并根据文件内容完成大量计算。 现在我想显示一个加载程序来指示用户应该等待。我对 Python
我有理由在循环中使用 QProgressDialog,我希望对话框弹出并等待用户输入,然后再显示对话框。然而,在第二次循环中,对话框一直保持匿名,直到它开始正确更新。下面是一些示例代码: QProgr
这个问题在这里已经有了答案: Disable QDialogs default close button (upper left "cross button")? (5 个答案) 关闭 9 年前。
我正在开发一个无法共享源代码的大项目。在那个项目中,我们在 Windows(不是在 ubuntu 中)中遇到了一些可重现的堆栈溢出错误,调试器的堆栈跟踪显示进度对话框设置为窗口模式,正在递归调用 QP
我有一个简单的程序,我希望有一个远程更新的模式、非阻塞进度窗口(使用 QProgressDialog)。 SIZE 只是控制 QProgressDialog 的最大值。但是,如果我将它的值设置为 4
progress = QtGui.QProgressDialog("Parsing Log", "Stop", 0,numberOfLinesInFile , self) progress.s
我正在使用 QT 4.8.5。我在带有 MinimumDuration 的 QProgressDialog 上遇到了一些问题。这是文档:http://doc.qt.io/qt-4.8/qprogres
从 MFC 应用程序启动 Qt 应用程序时,我在显示模态 Qt 对话框时遇到问题。具体来说,当我将其父级设置为 QWinWidget 实例时,QProgressDialog 实例将不会显示在 MFC
我刚刚编写了一些基于 QThread 的代码来执行大型计算。为了可视化进度,我需要打开一个 QProgressDialog。该对话框是应用程序模式的(使用 open()),因为我不想在计算期间修改主窗
我正在从线程调用 QProgressDialog 并且无法将其设置为模态窗口,即使我将 setModal 设置为 true。我希望在 QProgressDialog 运行时阻塞主窗口。 以下是我的一段
我正在使用 subprocess.call 来运行需要一段时间(>5 分钟)才能运行的命令提示符命令: subprocess.call([command, param1, param2], cwd=c
我正在使用 QProgressDialog 来显示我的 initializeGL() 函数的进度,但是小窗口显示为未绘制...这是简化的代码: QProgressDialog barTest("Wai
主 GUI 线程在等待 QFuture 时更新 QProgressDialog 的正确方法是什么。具体来说,这个循环中发生了什么: QProgressDialog pd(...); QFuture f
有时我的 QProgressDialog 显示,有时它根本不显示(好像没有调用 processEvents)。 processEvents() 命令是否存在任何可能导致 QProgressDialog
考虑这个 SLOT ,在我的主线程中,由一个按钮触发,该按钮采用 QTreeWidgetItem 的列表来自QTreeWidget .它使用 QtConcurrent::map()调用来执行一个长任务
我是一名优秀的程序员,十分优秀!