如何设置 QDialog 在 exec() 方法上不可见?
我使用 exec() 方法启动 QDialog,现在我喜欢它不可见,直到它内部的某个内部对象(Qwebkit)完成它的工作。
在 QDialog 构造函数中,我将其设置为:
setVisible(false);
hide()
但是当我这样做时,pAuthenticationDialogContainer 是指向 QDialog 的指针:
if(pAuthenticationDialogContainer->exec() != QDialog::Accepted ) { ....}
我可以看到 QDialog 几秒钟(1-2 秒)
我怎样才能让它完全隐形?
谢谢
i start QDialog with exec() method , now i like it to invisible until some inner object inside it (Qwebkit ) will finish its stuff.
in the QDialog constructor i set it to :
setVisible(false);
hide()
but will when i do where pAuthenticationDialogContainer is pointer to QDialog :
if(pAuthenticationDialogContainer->exec() != QDialog::Accepted ) { ....}
i can see the QDialog for few seconds (1-2 seconds )
how can i make it fully invisible ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否考虑过将用户按下的按钮与 QDialog 中的
close()
或accept()
槽连接起来?应该隐藏对话框。您必须使此代码准确并进行测试,但这应该会自动为您完成此操作。除此之外,我认为发布条件的
else
子句的代码会很有帮助。Have you considered connecting the button the user presses with
close()
oraccept()
slots from QDialog?Which supposed to hide the dialog. You will have to make this code exact and test it but this should do this automatically for you. Beyond that I think posting code for the
else
clause of the condition would be helpful.