×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    landscape and portrait mode for Nokia N97

    Hello Friends...

    I am facing some problem in viewing Window controls like Buttons, for landscape and portrait mode.

    I have a background image for the Main window and the image works fine for both Landscape and portrait mode. But the controls like Buttons inside this Window are not displayed in Landscape mode...They are only visible in Portrait mode...

    I am using the following code snippet for background image viewing for both Landscape and portrait mode:

    void MyEventDetails::resizeEvent (QResizeEvent* event)
    {
    SetBackgroundImage();
    // QWidget::resizeEvent(event);
    QMainWindow::resizeEvent(event);
    }
    Any idea on this issue of displaying the Button like controls in both Portrait and landscape mode?

    Thanks....

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: landscape and portrait mode for Nokia N97

    One question ,You are doing in full screen mode or not ?

    If yes, then remove the full screen mode in Portrait....

    If no then ok,,

    Try to decrease the size of the image in the background.

  3. #3
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: landscape and portrait mode for Nokia N97

    Hi Rahulvala,

    I am not doing this in Fullscreen Mode, as I have Menu options.

    As I mentioned.... background Image size is adjustable as per Portrait or Landscape....The only problem is that the controls on this Background image, I mean on the window are not adjustable as per Portrait or Landscape.

    Controls are visible only in Portrait mode....In Landscape mode few controls are not viewable..In fact the controls come down, so not viewable.

    Any suggestions... Please....

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

    Re: landscape and portrait mode for Nokia N97

    Are you using a layout manager? It sounds like you have absolute positioning, or the layout is simply running out of room -- too crowded.

  5. #5
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: landscape and portrait mode for Nokia N97

    I am not using Layout Manager! Simply put the controls on the "mainwindow.ui". Yes, there is code for the size of the window in "ui_mainwindow.h" like:

    MainWindow->resize(800, 480);
    Do you think that the above piece of code creating the problem?

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

    Re: landscape and portrait mode for Nokia N97

    If you're not using a layout manager that's your problem. If you don't use a layout manager then you must provide your own logic for repositioning widgets on the screen when orientation changes.

  7. #7
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: landscape and portrait mode for Nokia N97

    Hi...

    As per your suggestion, I tried to use the Layout Manager....

    I followed the follwoing links for this:

    http://wiki.forum.nokia.com/index.ph...g_with_QWidget

    http://wiki.forum.nokia.com/index.ph..._changes_in_Qt

    However, I didn't get the success.

    Actually my back ground image size is 320X480, and I have a button at location x=120 and y=220. Both are working fine and visible for Portrait mode, however in Landscape mode, the background image gets resized and properly visible except the Button. That button comes below the screen so not able to viewable.

    Do you have any other examples on Layout Manager...

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

    Re: landscape and portrait mode for Nokia N97

    If you do the layout correctly you don't define absolute widget positions, but rather define spacers between the items. The spacers are parameterized to grow and shrink based on available space.

  9. #9
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: landscape and portrait mode for Nokia N97

    Hey...

    With Layout manager, landscape and portrait mode is working for all the controls placed on the Window.
    However I am using background image for the window, so the layout manager doesn't work for this. I am getting 2 images for the landscape mode. So I think I have to use another image for landscape mode.

    For the controls placed on the window, one can open .ui file in Qt Creator and use "Layout in a Grid" or "Layout in a Form Layout" to view all the controls properly on landscape and portrait mode, both.

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

    Re: landscape and portrait mode for Nokia N97

    You could in theory detect the layout change and then change the background image, leaving everything else up to the layout manager.

Similar Threads

  1. portrait / landscape mode in application
    By mando7stam in forum Qt
    Replies: 14
    Last Post: 2010-08-26, 15:48
  2. N97/5800 Video Player in Portrait and Landscape mode help!
    By laker in forum Mobile Java General
    Replies: 4
    Last Post: 2009-12-18, 18:38
  3. Supporting landscape/Portrait mode
    By gpalvia in forum Symbian User Interface
    Replies: 4
    Last Post: 2009-01-30, 08:50
  4. Screen Mode from portrait to landscape
    By rami75lu in forum Symbian User Interface
    Replies: 0
    Last Post: 2008-10-15, 04:57
  5. Nokia N90 Portrait to Landscape Mode
    By alokkumarsingh in forum Symbian User Interface
    Replies: 2
    Last Post: 2005-12-14, 13:24

Posting Permissions

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