×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    25

    Qt Designer UI in Portrait Mode

    Hi,

    I've written an application in Qt Creator and made the UI in the Qt Designer based on landscape mode sceen proportions.
    Now I want portrait mode support.
    My design consists of a MainWindow and a tabWidget which contains several other widgets in its tabs.
    I placed my widgets in layouts. Therefore when I switch to portrait mode the height of my MainWindow gets resized to the new screen size,
    but the width is to large and the the app is being cut off at the right edge.
    How do I handle this best?
    Can I resize the width of my widgets to the screen width using MainWindow::resizeEvent?

    Thanks for any hints.

    frsc

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Qt Designer UI in Portrait Mode

    If you are using layouts, the scaling can happen automagically. If not, you will have to either construct a new UI (portrait optimized) or make the resize and repositioning of the widgets manually when the orientation changes (i.e on resize).
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    25

    Re: Qt Designer UI in Portrait Mode

    Ok. I am using layouts.
    But why does only the height gets automatically resized when switching to portrait mode and the width stays to large?

    Am I able to create a second *.ui file with the designer and assign it to the app when screen orientation is changed?

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Qt Designer UI in Portrait Mode

    It is a quirk of the UI layout stuff that the bottom-most widget on which you do your UI design must always be smaller (or at least no larger) in both dimensions than the screen area it will expand to when you do showMaximized or showFullScreen. So if you're targeting a device that's 640x360 then the widget used for the design must be no larger than 360x360 to begin with, if you wish to support rotation.

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Qt Designer UI in Portrait Mode

    Unfortunately, there's no straight-forward way to do two different layouts (ie, landscape and portrait) for a given set of widgets. This is a deficiency of the UI design scheme.

  6. #6
    Registered User
    Join Date
    Jan 2011
    Posts
    25

    Re: Qt Designer UI in Portrait Mode

    Ok. Thanks for the answers.
    I got the problem now.

Similar Threads

  1. Qt Designer / Qt Creator : Adding custom layout
    By daudrain in forum [Archived] Qt SDKs and Tools
    Replies: 0
    Last Post: 2010-09-29, 11:28
  2. portrait / landscape mode in application
    By mando7stam in forum Qt
    Replies: 14
    Last Post: 2010-08-26, 15:48
  3. Fix portrait mode in N97 fw v.20
    By diegoves in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2009-11-16, 12:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×