×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Question Screen size problem

    Hello everyone,

    Could someone please tell me if there is any way, I can get an application container screen size in Qt or Symbian c++? I need to get the size of the middle part of the phone screen, without the status pane where app name, battery status and signal status are and control pane where menu and exit buttons are.

    At the moment I'm using the following to get control pane size and screen size:
    Code:
    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, aScreenRect);
    iScreenWidth  = aScreenRect.Width();
    iScreenHeight = aScreenRect.Height();
        
    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, aScreenRect);
    cpanex = aScreenRect.Width();
    cpaney = aScreenRect.Height();
    I also tried the following method:
    Code:
        QDesktopWidget* desktopWidget = QApplication::desktop();
        QRect clientRect = desktopWidget->availableGeometry();
        clientRect.getCoords ( &x1, &y1, &x2, &y2 );
        QRect screenRect = desktopWidget->screenGeometry();
        screenRect.getCoords ( &x1, &y1, &x2, &y2 );
    I thought that avaiable geometry will tell me what I'm looking for. But availableGeometry always returns 0, 0 while screen geometry returns resolution of the entire screen.

    Problem is, I don't know how to get the status pane size and without it I can't calculate the useful space for my app.

    Someone please point me to the right direction because I really don't want to hardcode every screen size that needs to be supported. I need a Qt solution if possible, if not a carbide c++ code will work as well.

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Apr 2009
    Posts
    506

    Re: Screen size problem

    actually, desktopWidget->availableGeometry() have to do the job
    may be there is wrong int6erpretation of the results somewhere in your code
    Symbian & Qt developer. http://vladest.org

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Re: Screen size problem

    Quote Originally Posted by vladest View Post
    actually, desktopWidget->availableGeometry() have to do the job
    may be there is wrong int6erpretation of the results somewhere in your code
    I don't think I get a wrong interpretation. Qt returns full screen resolution when asking about available geometry, which is the truth if you want your application to be full screen. I wanted mine to be in that central part of the screen though, so I don't cover the status pane and the control pane buttons. I can find out that size manually, but I really need an in code solution.

  4. #4
    Registered User
    Join Date
    Apr 2009
    Posts
    506

    Re: Screen size problem

    Ok, another possible reason: you asking this too early. before UI is setted up
    Symbian & Qt developer. http://vladest.org

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Re: Screen size problem

    Thanks, you were correct. Calling those functions after I called

    Code:
    w.showMaximized()
    solved the issue.

Similar Threads

  1. Multiple screen size problem
    By chandran.biju007 in forum Symbian User Interface
    Replies: 2
    Last Post: 2010-07-23, 20:04
  2. problem of background on screen size 240x320
    By nital_shah in forum Symbian
    Replies: 8
    Last Post: 2009-12-07, 10:06
  3. problem with screen size
    By akshay0912 in forum Mobile Java General
    Replies: 2
    Last Post: 2009-04-24, 10:17
  4. user name and password query dialog box problem when screen size changed
    By aamitgupta in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-10-24, 19:01
  5. Screen Size Problem...
    By ruchirvasavada in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-10-18, 05:45

Posting Permissions

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