简体   繁体   English

将QWidget或其他QWidget派生的控件添加到QWindow中

[英]Add QWidget or other QWidget derived controls into QWindow

QtGUI and QtWidgets have been separated in Qt5. QtGUIQtWidgets在Qt5中已分开。

How can I add QWidget or other QWidget derived controls into QWindow ? 如何将QWidget或其他QWidget派生的控件添加到QWindow

A QWindow is not meant to be used that way. QWindow不能以这种方式使用。 Instead of using a QWindow directly, you need a QWidget instead. QWindow直接使用QWindow ,而是需要QWidget A parentless QWidget by default becomes a top-level window. 默认情况下,无父母的QWidget成为顶层窗口。

If you have a particular reason to use a QWindow , you'll have to edit your question to provide details on your design; 如果由于特殊原因需要使用QWindow ,则必须编辑问题以提供有关设计的详细信息。 most likely your design is incorrect. 您的设计很可能不正确。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM