Important: Please read the Qt Code of Conduct -

QMainWindow||QWidget problem?

  • Can't even describe it. How can i make QMainWindow ( QWidget, behavior of both same ) draw whole image? - as it shouldn't be. - as it should be, but without frame and black background
    P.S: x cord of window is -140 and Settings window are child or Another ( main ) QMainWindow

  • Lifetime Qt Champion

    the second window is clipped to mainwindow. (normal for childs)
    So I think to avoid clipping, you should not set it as child.

  • Moderators

    There are couple of ways to do that:

    • as @mrjj suggested don't give it a parent and explicitly call show() on it. The downside is that without a parent you need to manually keep track of its lifetime (delete at some point).
    • give it a parent, derive from QDialog and call show() (or exec() if it's suppose to be modal).
    • give it a parent, set it a dialog flag and show it i.e.
    SomeWindow w = new SomeWindow(someParent);
    w->setWindowFlags(w->windowFlags() | Qt::Dialog);

Log in to reply