0

QtGUI and QtWidgets have been separated in Qt5.

How can I add QWidget or other QWidget derived controls into QWindow?

Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
  • Add QT += widgets in pro file and add QWidget in designer or in code. Does this answer your question? – demonplus Dec 07 '16 at 06:04
  • Why not take a `QMainWindow` which is in widgets module. From the docs: An application will typically use QWidget or QQuickView for its UI, and not QWindow directly. Still, it is possible to render directly to a QWindow with QBackingStore or QOpenGLContext, when wanting to keep dependencies to a minimum or when wanting to use OpenGL directly. The Raster Window Example and OpenGL Window Example are useful reference examples for how to render to a QWindow using either approach. – Sebastian Lange Dec 07 '16 at 06:11

1 Answers1

0

A QWindow is not meant to be used that way. Instead of using a QWindow directly, you need a QWidget instead. A parentless QWidget by default becomes a top-level window.

If you have a particular reason to use a QWindow, you'll have to edit your question to provide details on your design; most likely your design is incorrect.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313