简体   繁体   English

使一个窗口出现在另一个窗口的上方,禁止访问其他窗口,直到单击按钮

[英]Make a window appear on top of another, block access to other windows until button clicked

Python 2.7, PyQt4.8.5 Python 2.7,PyQt4.8.5

I want to have a main app window and then a second pop up window to display com port settings. 我想要一个主应用程序窗口,然后是第二个弹出窗口来显示com端口设置。 This window should always be on top of the parent window until either the ok or the cancel button is clicked; 此窗口应始终位于父窗口的顶部,直到单击确定或取消按钮为止; closing the child window. 关闭子窗口。 (sort of like a required answer ie cant process until you choose the settings from the child window) (有点像必需的答案,即在您从子窗口中选择设置之前无法处理)

Is there a Python Qt command to do this? 有Python Qt命令可以执行此操作吗?

Apologies if this has been asked/answered before, my search returned nothing useful. 如果之前有人问过/回答道歉,我的搜索没有任何用处。

You want a modal dialog. 您需要一个模式对话框。 For example: 例如:

dialog = QInputDialog()
dialog.exec_()

You can either implement your own dialog widget (by subclassing QDialog ) or use one of the several available. 您可以实现自己的对话框窗口小部件(通过将QDialog子类化),也可以使用几种可用的窗口小部件之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从任务栏单击时,Tkinter 使覆盖重定向窗口出现在其他窗口的顶部 - Tkinter make overrideredirect window appear on top of other windows when clicked from taskbar 如何自定义(Windows OS)中的pybusyinfo窗口,使其出现在窗口的顶部和其他格式设置选项中? - How to customize pybusyinfo window in (windows OS) to make it appear at top corner of window and the other formatting options? 使tkinter窗口出现在所有其他窗口上 - Make a tkinter window appear over all other windows 在其他 windows 之上打开一个 window - Opening a window on top of other windows 单击根窗口时,使“顶级”窗口弹出到顶部 - Make Toplevel window pop up to the top when root window clicked 如何使 Windows Explorer Window 出现在 kivy 应用程序中? - How to make a Windows Explorer Window appear in a kivy app? Tkinter:如何在按下按钮时使窗口出现 - Tkinter: how to make window appear when a button is pressed 如何使窗口状态空闲直到在python tkinter中按下按钮? - How to make state of window idle until button is pressed in python tkinter? 单击按钮时加载其他窗口。 PyQt的 - Load other windows when button clicked. PyQt 制作一个在 Tkinter 中打开另一个窗口的按钮 - Make A Button That Opens Another Window in Tkinter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM