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. QMdiSubWindow does not go to position used in setGeometry()
Forum Updated to NodeBB v4.3 + New Features

QMdiSubWindow does not go to position used in setGeometry()

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.5k Views 1 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.
  • R Offline
    R Offline
    rizoritis
    wrote on last edited by
    #1

    Hello,

    I am trying to set a subwindow (which I have a widget placed in) in my mdiarea to a fixed position using setGeometry(). The code is as follows:

    @ programSubWindow = new QMdiSubWindow;
    programWidget = new programDisplayWidget;
    programSubWindow->setWidget(programWidget);
    programSubWindow->setWindowFlags(Qt::FramelessWindowHint);
    /Adjust size of subwindow to fit to its portion of the mdi area/
    QSize currentWindowSize;
    currentWindowSize = ui->mdiMdiArea->size();
    width = round_num(currentWindowSize.width() * .33);
    height = round_num(currentWindowSize.height() * 0.67);
    programWidget->setFixedSize(width, height);
    programSubWindow->setGeometry(200, 200, width, height);
    /Add subwindow to mdi area and show it/
    ui->mdiMdiArea->addSubWindow(programSubWindow);
    programSubWindow->show();@

    It does not seem to be taking my setGeometry() command and always places my window in the upper left hand corner of my mdiarea. Does anyone know what the problem might be?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rizoritis
      wrote on last edited by
      #2

      I'm surprised nobody has run into the same problem. I still can't figure it out. Any help?

      1 Reply Last reply
      0

      • Login

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