Results 1 to 8 of 8

Thread: Half-resizable window

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    18
    Thanks
    2

    Default Half-resizable window

    Hello everyone,

    I'm working on a main window. I want the user to be allowed to resize it vertically, but not horizontally.
    The fisrt idea I got was to put :
    resize(630, 380);
    setFixedWidth (630);
    in the constructor but it automatically disable the resize buton of the title bar (between close and reduce)
    Is it possible to impose an horizontal size but let this auto-resize option available verticaly?

  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: Half-resizable window

    You can set both the minimum and maximum width to the same value.

    LE: i have tried setFixedWidth and it works as expected with SDK 1.1 on Windows 7.

  3. The following user says thank you to Zlatomir for this useful post:

    evergreen (16th May 2011)

  4. #3
    Join Date
    May 2011
    Posts
    18
    Thanks
    2

    Default Re: Half-resizable window

    I've tried it : setMaximumWidth(630); setMinimumWidth(630);

    The window gets the size I want but the recize button of the tittle bar is still disabled.
    To be clearer I want that when the user click on this button, the window's width stays at 630px but the heigth be miximized.

  5. #4
    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: Half-resizable window

    My bad - i didn't understood what you meant by "auto-resize" and "resize button" - but i don't think that is possible to keep that button usable with one fixed size, that maximize button is for maximizing the window on both directions, not on only on one.

    But your users can manually drag the margin of the window to "maximize" it on only one direction, isn't it acceptable?

Similar Threads

  1. Qt Widgets seen half transparent when using stylesheets
    By codeslicer in forum Qt Programming
    Replies: 5
    Last Post: 14th December 2010, 09:52
  2. Window Style: No border but resizable
    By Peppy in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2010, 18:21
  3. Why QGraphicsItem moveing is valid in half?
    By litterflybug in forum Qt Programming
    Replies: 2
    Last Post: 13th December 2009, 13:14
  4. color one half of the button?
    By tommy in forum Qt Programming
    Replies: 4
    Last Post: 26th December 2007, 19:42
  5. making an application window non resizable
    By aegis in forum Qt Programming
    Replies: 16
    Last Post: 13th May 2007, 19:14

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
  •  
Qt is a trademark of The Qt Company.