Results 1 to 2 of 2

Thread: Window Layout - Custom Sizing

  1. #1
    Join Date
    Jun 2013
    Posts
    46
    Thanks
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Post Window Layout - Custom Sizing

    Notes to understand problem
    I have a group box with buttons and a label in a vertical-layout in a window.
    The label is set to expanding according to window size.
    How do I set the initial window to only display group-box(window is fixed around group box)
    When I load an image to label the window size increases, displaying the label
    the label size is set to image size(hence initially 0,0)
    Since the image is scaled to label(checked property)
    I dont need to worry of images smaller than window size.

    Problem
    how ever if the image is bigger than window size- I want it to maximise the screen
    how do I set a maximum window size to fullscreen maximise(for any screen)

    I know more or less, how to do it?
    Just need some direction
    & maybe sample code on comparing image sizes

    or is there another way of hiding label & setting window size smaller until uploading image

    Thnks

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Window Layout - Custom Sizing

    how ever if the image is bigger than window size- I want it to maximise the screen
    if the image is bigger than the window, the window is by default resized to fit the image, unless the window is already maximized

    how do I set a maximum window size to fullscreen maximise(for any screen)
    Use showMaximized();

    is there another way of hiding label & setting window size smaller until uploading image
    explicitly hide the label, use hide(), and add a vertical and horizontal spacers outside the group box
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. layout's widget does not autofit to window.
    By Niamita in forum Qt Programming
    Replies: 11
    Last Post: 19th October 2011, 13:09
  2. Custom widgets in layout
    By Palmik in forum Newbie
    Replies: 11
    Last Post: 26th January 2009, 12:08
  3. Custom Scroll Widget Sizing Problem
    By sepehr in forum Qt Programming
    Replies: 2
    Last Post: 28th November 2008, 11:42
  4. Window Layout issue.
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 26th August 2008, 21:46
  5. Custom plugin for a layout
    By cocheci in forum Qt Tools
    Replies: 2
    Last Post: 12th June 2006, 18:36

Tags for this Thread

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.