Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMainWindow||QWidget problem?
Forum Updated to NodeBB v4.3 + New Features

QMainWindow||QWidget problem?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 679 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EpicLoyd
    wrote on last edited by
    #1

    Can't even describe it. How can i make QMainWindow ( QWidget, behavior of both same ) draw whole image? http://prntscr.com/9jgehl - as it shouldn't be.
    http://prntscr.com/9jgeu0 - 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

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

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

      1 Reply Last reply
      1
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by Chris Kawa
        #3

        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);
        w->show();
        
        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved