Results 1 to 11 of 11

Thread: [Symbian] Show widgets maximized on different resolutions

  1. #1
    Join Date
    Jan 2011
    Posts
    9
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default [Symbian] Show widgets maximized on different resolutions

    Hi,

    i'm trying to develop an application for symbian with QT. I'm having problems displaying widgets maximized in different resolutions.

    Lets say i have one QMainWindow and few QWidgets. One of the QWidgets is called BrandTabs

    In QMainWindow i do:

    Qt Code:
    1. BrandTabs* tabs = new BrandTabs(this, this->dbManager);
    2. tabs->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    3. tabs->showMaximized();
    4. setCentralWidget(tabs);
    To copy to clipboard, switch view to plain text mode 


    BrandTabs has a QVBoxLayout, inside it a QTabWidget and inside first tab again QVBoxLayout with QListWidget.

    QTabWidget, QListWidget have their size policies set to QSizePolicy::MinimumExpanding.

    But still, thei are not maximed if resolution is bigger than defined in editor (i'm using QT creator).

    Any hints, thanks

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: [Symbian] Show widgets maximized on different resolutions

    Why do you show that tabs and not the mainWindow (since tabs is the central part of a mainWindow)?
    You should have something like this (in your main.cpp):
    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication a(argc, argv);
    4. MainWindow w; //replace MainWindow with the name of your mainwindow class
    5.  
    6. w.showMaximized();
    7.  
    8. return a.exec();
    9. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2011
    Posts
    9
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: [Symbian] Show widgets maximized on different resolutions

    Well my main window has other UI elements (buttons, images, etc) and on one of those buttons click, BrandTabs widget should be shown only. Or maybe this is incorrect approach?

  4. #4
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: [Symbian] Show widgets maximized on different resolutions

    showMaximized() only affects windows, so that is not ok.
    That tabs is supposed to become a new window or show() inside mainWindow?

  5. #5
    Join Date
    Jan 2011
    Posts
    9
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: [Symbian] Show widgets maximized on different resolutions

    Tabs should become the only component on the screen, no other components from previous widgets or windows. My initial idea is that i would have many QWidgets, and simply swap in with setCentralWidget. But now i have fullscreen problem Or should i have many QMainWindows and somehow display them ?
    Last edited by tryinghard; 9th January 2011 at 23:33.

  6. #6
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: [Symbian] Show widgets maximized on different resolutions

    Then derive your tabs widget from QDialog and use exec() to show it modal on top of the mainwindow, or showMaximized().
    Also you can derive from QMainWindow (you can make it modal and maximized too).

    LE: and of-course you shouldn't set it as a central widget in mainWindow.

    LE2: also creating there an new and empty QDialog/QMainWindow and use that as a parent for tabs should work (and then showMaximized() or whatever is apropiate)
    Last edited by Zlatomir; 9th January 2011 at 23:44.

  7. #7
    Join Date
    Jan 2011
    Posts
    9
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: [Symbian] Show widgets maximized on different resolutions

    Thanks! Last question i guess Lets say from a list in tabs, i want to show a map control (again fullscreen, no other inputs). Options are the same as i understand - either use QMainWindow, or QDialogs? And if want to handle user navigating back, i simply close those QDialogs, and that is it?

    Edit:

    ok, QDialog solution does not work or i am doing something really wrong. I've created class that derives from QDialog with QT Creator. Added a QVBoxLayout inside it, then QTabWidget and inside first tab QVBoxLayout and then QListView. QSizePolicy is set for all (MinimumExpanding). And no good... it takes up space that it has in the designer, and does not maximize.

    Tried without QVBoxLayout - the same. I think the main QDialog is maximized, but QTabWidget inside it - no.
    Last edited by tryinghard; 10th January 2011 at 00:24.

  8. #8
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: [Symbian] Show widgets maximized on different resolutions

    Well that is a solution, but you also must think about your users (i wouldn't like to open a lot of dialogs, and then make a check a checkbox and close them again), well now 3 isn't quite a lot, but don't exaggerate with that
    So think of other solutions that fit the problems you are trying to solve.

    Show/hide Widgets is another solution, it really depends on what are you trying to do, so just try think as a user too

    I'm not sure if you can replace/show/replace the centralWidget of a mainWindow, but you can definitely show/hide widgets from the centralWidget and if you play with sizePolicy you can even have a nice dynamic ui (the widgets can expand or remain the same size related to what changes in ui)

    LE: then post a little project (a compilable example) that show your problem, archive the project and attach it here so we can have a look on what are you doing wrong...

    As i said in one edit to my previous post you don't necessary need to subclass QDialog, you can just create a QDialog on the heap (give the original mainWindow pointer as a parent to the new dialog) then create your tabs and give the new dialog as a parent (and delete setCentralWidget(tabs) of the original mainWindow... or put whatever necessary in there)
    Then show the new QDialog when ever is appropriate for you...
    Last edited by Zlatomir; 10th January 2011 at 01:41.

  9. #9
    Join Date
    Jan 2011
    Posts
    9
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: [Symbian] Show widgets maximized on different resolutions

    I think that problem is with QT Creator. As i am using visual designer, it generates its own header files (aka ui_brandtabs.h) and in those files there is a call to setGeometry().

    Will try to create sample project and upload it here.


    Added after 18 minutes:


    ok, made a sample application. As i understand, the list should be displayed full screen, though it does not.

    Thanks again
    Attached Files Attached Files
    Last edited by tryinghard; 10th January 2011 at 10:07.

  10. #10
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: [Symbian] Show widgets maximized on different resolutions

    You just need to add layouts to the form itself too (if you use the Designer this is done by selecting the background Form and then press the button for the needed layout.
    See the attachment, it should be working fine
    Also a recommended reading Layout management documentation
    Attached Files Attached Files

  11. #11
    Join Date
    Jan 2011
    Posts
    9
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: [Symbian] Show widgets maximized on different resolutions

    Thanks!!!!! Superb, works like a charm

Similar Threads

  1. [Symbian] show device's menu within a fullscreen application
    By curreli in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 12th September 2010, 07:54
  2. show widget over other widgets
    By maston in forum Qt Programming
    Replies: 3
    Last Post: 23rd June 2010, 09:31
  3. Replies: 0
    Last Post: 2nd February 2010, 09:44
  4. Interview: Show statusbar or other widgets in a view?
    By uiop21 in forum Qt Programming
    Replies: 6
    Last Post: 6th March 2008, 16:51
  5. is it possible to animate sliding widgets on show/hide
    By discostu in forum Qt Programming
    Replies: 2
    Last Post: 4th March 2007, 08:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.