Results 1 to 6 of 6

Thread: Layout drives me up the wall!

  1. #1
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Layout drives me up the wall!

    Hi all,

    I have two desktop apps, second app I created by copying first app into new folder and doing some changes in code. A few days ago I played with layout on one of the QStackedWidget pages in forms (created in designer) in app number 2. Now when I display certain page in app 2 application increase in height so much i goes beyond a scope of the screen (its getting higher than screen height) and refuses to shrink. I copied form (mainwindow.ui) from app number 1, but when I clear project and compile it result is the same.
    What is strange, when I clear and compile app number 1 - there is no problem with layout, app is not getting higher than a screen, and I can even shrink it to 2/3 of the screen height.
    App number 2 (that is using now form mainwindow.ui from app 1) after I clear and compile gets higher than screen always when I display certain page.

    So I thought that there should be no difference between this two apps because I'm using the same form file.
    Question is what is wrong? Where are the sizes of the mainwindow written? Or how can I debug this problem, what may cause my second application to increase in height.
    I'm developing on Linux with Qt 4.8.1.

    best regards
    Marek

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Layout drives me up the wall!

    Between Clear and Rebuild All did you Run qmake too?

  3. #3
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Layout drives me up the wall!

    Hi,

    Just to be sure, I tested this now, both projects use the same mainwindow.ui file, on both of them I did: clear, run qmake, rebuild project.
    Project number 1 has proper resizable window, second project resize itself beyond the scope of the screen as soon as I switch QStackedWindget to certain page.
    Don't know whats going on ????

    regards
    Marek

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Layout drives me up the wall!

    If the UI files are the same then the problem is not in the UI file. You say you copied the:
    first app into new folder and doing some changes in code
    My prediction is that the problem is in here. We cannot see your code or read your mind, so we cannot really help.

  5. #5
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Layout drives me up the wall!

    Sure You are right, I didn't provide the code because app is working with server and during start up its reading data from server, so I will have to prepare stand alone version to illustrate my problem if I don't find something in my code. I just wanted the confirmation that dimensions of main window or other stuff related to size are hidden inside UI files, and not in some other magic files, system wide preferences, or else...

    regards
    Marek

  6. #6
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Layout drives me up the wall!

    I've found the problem. The problem was layout on different page. My app consist of a few pages with QStackedWidget. Let's say I thought I have problem with page number 6, because as soon as I switched to this page app stretched itself beyond the screen. Until I stayed on pages 1,2,3,4 - everything was fine. On page number 5 there were presented data obtained from server during initialization (app number 1 was getting 2 items from server, app number 2 was getting 20 items from server - and it was to much for a single page to display, so it was stretched). However, page number 5 was never displayed because I did not make a button to switch QStackedWidget to this page. What is also strange only switching to page 6 triggered the resize of the page 5, until I stayed on pages 1,2,3,4 - there was no problem. I was trying to debug this by settings traps, but all I could see was execution of the main event loop in line " return app.exec();" in main.cpp when application was stretched. Looks like when I display certain page of the QStackedWidget all pages created before this page are triggered to update their size. I can't see any other explanation.

    regards
    Marek

Similar Threads

  1. Replies: 4
    Last Post: 21st August 2011, 02:02
  2. Qt Assistant Assistant 4.7.0 refresh drives me up the wall!
    By koan in forum Qt Tools
    Replies: 0
    Last Post: 18th November 2010, 22:18
  3. Replies: 2
    Last Post: 15th June 2010, 11:06
  4. QDirIterator and windows drives
    By invictus in forum Qt Programming
    Replies: 0
    Last Post: 8th March 2009, 19:48
  5. Qt4.4 widget wall.
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 9th June 2008, 10:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.