Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jun 2010

    Strange Resize Problem when hidding and showing widget in QGridLayout

    I have a strange problem with the QGridLayout. I have a QGridLayout that has two rows. The lower holds a small bar with menu buttons and the upper row holds a QStackedWidget. I use the QStackedWidget to change the windows. In one window I want not to show the Menubar. So i hide it by calling QWidget::hide() (Menubar is implemented as a normal QWidget). When I later call again QWidget::show(), the menubar is shown again, but not at the old position. You can only see the topmost five pixels, the rest is shifted out of the display at the lower edge. It looks like if you show again the menubar, it is appended at the end of the QGridLayout, but the layout is not adjusted again to the new content, but is simply made longer, ignoring that the display isn't longer. When I let me give out the height of the layout, it gives me 694 Pixels, anyway the screen size is 640 Pixels. Does anybody has also encountered problems with Layout resizing and knows how to solve them?

    Thanks Guys

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2007

    Re: Strange Resize Problem when hidding and showing widget in QGridLayout

    Hi lukiluuk,

    You are facing the strange problem. As per my view, once you add the widget to the lay out and than hide it or show it must be shown to the its orinal position. If you dont mind, Can you paste here the part of your code to have a look at it.
    Jajal Mehul

  3. #3
    Regular Contributor
    Join Date
    Jun 2010

    Re: Strange Resize Problem when hidding and showing widget in QGridLayout

    Hi James
    I cannot post the code, as it is too complex and contains too many files. But I can describe what I do. I have a QGridLayout with two rows. The upper one contains the main screen ( a QWIdget), and in the lower one there is a menu with a heigth of about 50 Pixels (another QWidget). To make sure that the menu stays the size of 50 Pixels, I made the minimum size of the Menuwidget 50 Pixels and gave the upper row a row stretch of 50 (setRowStretch(0,50)). The QWidget in the upper row is a QStackedWidget and I have several QWidgets added to this stack. These widgets are my different windows. Now, in one window I don't like to have the menu shown. Just before I switch to this window, I call menu->hide() and the new window comes with no menubar. When I go back to the other window, i call menu->show() and the comes again, but I can only see the upper edge of the menu, because the rest is shifted out of the display. When I check the screen size with

    QDesktopWidget* desktopWidget = QApplication::desktop();
    QRect screenRect = desktopWidget->screenGeometry();

    I get a heigt that is bigger than the real display size, what is really strange.

    I know, code example would be better, but that's the most accurate description I can provide.:-)

    Cheers, Luki

Similar Threads

  1. Replies: 3
    Last Post: 2011-03-06, 06:32
  2. [Moved & Merged] Hidding SMS
    By rohitsingh81 in forum Symbian Networking & Messaging (Closed)
    Replies: 12
    Last Post: 2010-05-19, 13:41
  3. isswue when any QWidget is inserted in a QGridLayout
    By learning_sathya in forum [Archived] Qt SDKs and Tools
    Replies: 1
    Last Post: 2009-11-13, 10:02
  4. Hidding an application
    By mcadirci in forum Mobile Java General
    Replies: 9
    Last Post: 2009-03-24, 10:04
  5. Showing WAP page in widget
    By Halem_Aad in forum Symbian
    Replies: 2
    Last Post: 2008-11-27, 17:19

Posting Permissions

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