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. Why adjustSize doesn't work?
Qt 6.11 is out! See what's new in the release blog

Why adjustSize doesn't work?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 752 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.
  • Q Offline
    Q Offline
    qwe3
    wrote on last edited by
    #1

    Hi,

    I have simple app. In MainWindow constructor I have:

        _someWidget = new someWidgetClass(this);
        _someWidget ->setFixedSize(700,700);
        _someWidget ->move(50,50);
       
        wid = new QWidget(this);
        wid->move(800,800);
        wid->setFixedSize(100,100);
    
        centralWidget()->adjustSize();
        adjustSize();
    

    I would like to change MainWindow size to:
    mainWind.png

    So I would like to resize MainWindow like that, his right bottom corner should be the right bottom corner the green widget too ( no matters margins ). When I try adjustSize() I can't achieve that.

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

      Hi,

      What result do you get ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        I don't see why adjustSize() should do anything - there is no layout on it so ... (as already told you on stackoverflow)

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        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