×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Question How to use Layouts in Qt Creator for Portrait and Landscape modes?

    I'm not sure if this is the right place to ask this, but here is what I'm trying to do:

    I got two layouts, A and B, which have buttons labels and stuff in it. When the device is in Portrait mode, I want the layout A to be on the top and layout B on the bottom of the screen. When the device is in Landscape mode, I want the layout A to be on the left and layout B on the right of the screen.

    How can I do that? Is it even possible?

    Cheers

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to use Layouts in Qt Creator for Portrait and Landscape modes?

    There is an example how to do that
    http://wiki.forum.nokia.com/index.ph...e_Layout_in_Qt

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Re: How to use Layouts in Qt Creator for Portrait and Landscape modes?

    Quote Originally Posted by divanov View Post
    Thanks

    But what I had in mind, would this be possible to do in Qt Creator without using any code? I like to use the Designer for the UI. I find it much faster when I can see what I'm doing right away.

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to use Layouts in Qt Creator for Portrait and Landscape modes?

    You can use Qt Designer as if we can stop you.

  5. #5
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Re: How to use Layouts in Qt Creator for Portrait and Landscape modes?

    Quote Originally Posted by divanov View Post
    You can use Qt Designer as if we can stop you.
    Thanks for the permission

    Let me try to rephrase the question: Is it possible to do the following in Qt Designer without any need for code?

    I got two layouts, A and B, which have buttons labels and stuff in it. When the device is in Portrait mode, I want the layout A to be on the top and layout B on the bottom of the screen. When the device is in Landscape mode, I want the layout A to be on the left and layout B on the right of the screen.

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to use Layouts in Qt Creator for Portrait and Landscape modes?

    Qt Designer creates static UI (however, you can connect available signals to available slots), but to add anything dynamic, you will need to add code manually.

  7. #7
    Regular Contributor
    Join Date
    Jul 2007
    Location
    Eindhoven, the Netherlands
    Posts
    187

    Re: How to use Layouts in Qt Creator for Portrait and Landscape modes?

    I haven't found a way to do this properly from the designer view, neither in QtCreator nor QtDesigner. I am using QBoxLayout to do this, but it seems to be missing in the designer (see my topic here: http://discussion.forum.nokia.com/fo...ing-QBoxLayout ).
    QBoxLayout is a base class of QHBoxLayout and QVBoxLayout, and can be instructed to toggle between the two layouts, using the setDirection() method.
    (see for example the resizeEvent implementation in QCurrentTrackTab widget here: http://code.google.com/p/qtracker/so...rackdialog.cpp )
    This seems much easier to me than what is done in the mentioned example.

    Regards,
    Mark.
    Last edited by hurenkam; 2010-09-14 at 08:14.

  8. #8
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to use Layouts in Qt Creator for Portrait and Landscape modes?

    You can try your luck and report a bug against Qt Creator in bug tracker
    http://bugreports.qt.nokia.com/secure/Dashboard.jspa

Similar Threads

  1. How to change system layouts to landscape mode on OS 9.2?
    By Mozart2007 in forum Symbian User Interface
    Replies: 2
    Last Post: 2007-11-13, 08:57
  2. Portrait/Landscape N95
    By IkerJ in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-09-12, 09:26
  3. Replies: 2
    Last Post: 2007-08-09, 23:20

Posting Permissions

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