Results 1 to 3 of 3

Thread: setFixedSize doesn't work as expected

  1. #1
    Join Date
    Jun 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question setFixedSize doesn't work as expected

    I'm using the latest stable version of Qt 5 built statically with GCC 4.8 on Windows 8.

    I've created a simple QMainWindow-based application with just one button. When I do setFixedSize(minimumSizeHint()) the window gets resized as I want it to and the maximize button gets disabled, but I can still see the double-sided arrows, when I hover my pointer over the edges, and I can resize the window vertically by 14 pixels. If I add 14 pixels (or more) to the minimum height (or insert a second button) - it becomes truly fixed, but I can still see the arrows, which isn't normal.

    This is very weird, because absolutely the same code (and its variations) works perfectly well in PyQt4 (please, note, I use C++ now). I tried:
     
    • layout()->setSizeConstraint(QLayout::SetFixedSize) - same behavior
    • setWindowFlags(Qt::MSWindowsFixedSizeDialogHint) - the window just disappears


    I was suggested to use Qt 4 instead, but that isn't a real solution. Any way to fix this?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: setFixedSize doesn't work as expected

    Are you fixing the main window widget or its central widget?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: setFixedSize doesn't work as expected

    The main window. I tried creating it without any widgets at all (just setFixedSize(256, 128) and show() in its constructor) - nothing changed.

    UPD: Just built with Qt 4 - works as expected. Could that be a bug in Qt 5? Anyway, reported.

    UPD 2: Turns out that if I put setWindowFlags(Qt::MSWindowsFixedSizeDialogHint) before show() - it works just as expected.
    Last edited by jeremejevs; 3rd June 2013 at 09:47.

Similar Threads

  1. Qt.openUrlExternally doesn't work
    By vinayaka in forum Newbie
    Replies: 1
    Last Post: 16th November 2011, 22:59
  2. Replies: 2
    Last Post: 6th August 2010, 09:10
  3. QDataStream doesn't work as expected
    By mastupristi in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2010, 07:08
  4. Replies: 9
    Last Post: 2nd December 2009, 18:59
  5. QHTTP::GET doesn't work as expected !
    By tuthmosis in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2008, 15:45

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.