Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2010

    How to set application to occupy screen client area in Symbian.


    I am just learning the use of Qt for Symbian. I have made a simple application QtCreator and UI is made with its visual editor. The problem is that UI size seems to be always fixed to the size set in visual editor making the application unusable with different screen orientations and devices. My UI includes following UI entities:

        | |---QLCDNumber
        | |---QLCDNumber
    How can I make the UI to dynamically to resize to the currently available client area? The QMainWindow is started with showMaximed() but it does not maximize the UI elements to occupy whole client area. I have tried to set the sizePolicies to allow expanding of the QWidgets but it does not seem to help. I also tried to override the screen resizing by capturing the resizeEvent() and setting the geometry of the QMainWindow to the current size, but it did not help either.

    Is there any good tutorial about handling the UI size dynamically?

  2. #2
    Registered User
    Join Date
    Apr 2009

    Re: How to set application to occupy screen client area in Symbian.

    You can read some informations about Layout Management
    in Qt here: http://doc.trolltech.com/4.6.2/layout.html

    From your hierarchy it seems that the QWidget on the QMainWindow isn't in a layout which should be at the QMainWindow

    But this code should work:

            QMainWindow *mainWindow = new QMainWindow();
            QWidget *centralWidget = 0;
            QVBoxLayout *verticalLayout = 0;
            QHBoxLayout *horizontalLayout = 0;
            QLCDNumber *lcdNumber_2 = 0;
            QLCDNumber *lcdNumber = 0;
            QSlider *horizontalSlider = 0;
            QSlider *horizontalSlider_2 = 0;
            centralWidget = new QWidget(mainWindow);
            verticalLayout = new QVBoxLayout(centralWidget);
            horizontalLayout = new QHBoxLayout();
            lcdNumber_2 = new QLCDNumber(centralWidget);
            lcdNumber = new QLCDNumber(centralWidget);
            horizontalSlider = new QSlider(centralWidget);
            horizontalSlider_2 = new QSlider(centralWidget);
    Same is possible with the designer please klick on QMainWindow in QtDesigner or designer mode of Qt Creator menu: "Tools" -> "Form Editor" and then all "Lay Out ..." things. Same actions can be found at the toolbar in the designer mode of Qt Creator.

  3. #3
    Registered User
    Join Date
    Aug 2010

    Re: How to set application to occupy screen client area in Symbian.

    Hi Timson,

    Yes, the "Lay Out..." settings for the QMainWindow did the trick. Thanks a lot for your help.

Similar Threads

  1. Calendar doesn't occupy the whole screen
    By kalastaja in forum Symbian User Interface
    Replies: 10
    Last Post: 2009-04-09, 08:00
  2. Replies: 3
    Last Post: 2009-03-19, 11:46
  3. Replies: 0
    Last Post: 2008-12-28, 16:00
  4. Replies: 2
    Last Post: 2007-02-21, 09:35
  5. occupy nokia7650 screen on incoming call?
    By dkoppenho in forum Symbian
    Replies: 1
    Last Post: 2003-03-06, 12:55

Posting Permissions

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