Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User sathyanarayanan.se's Avatar
    Join Date
    Jun 2010
    Location
    bangalore
    Posts
    23
    hi i am trying to delete the old layout and then set the other layout... i used delete layout before setting the new layout... this sets the new layout on top of the old layout and both are visible... is there any function for clearing the screen before setting another layout?

  2. #2
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Call widget->update();

  3. #3
    Registered User sathyanarayanan.se's Avatar
    Join Date
    Jun 2010
    Location
    bangalore
    Posts
    23
    this also doesnot solve my problem...
    i am posting a sample code... hope it will help ..
    first i am adding a widget to the QGridlayout layout using the following lines.
    Code:
    layout->addWidget(treeWidget,0,0);
    setLayout(layout);
    then removing that widget and updating and deleting the gridlayout.
    Code:
    layout->removeWidget(treeWidget);
    layout->update();
    delete layout;
    here i am trying to set the new gridlayout on screen
    Code:
    layout1->addWidget(checkbox,j,0);
    setLayout(layout1);
    if i do like this the layout recently set appears over the old one...
    Last edited by divanov; 2010-10-05 at 08:36. Reason: forcing CODE tag

  4. #4
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Did you consider possibility to re-use layout?
    Code:
    layout->addWidget(treeWidget,0,0);
    setLayout(layout);
    // do something
    layout->removeWidget(treeWidget);
    layout->addWidget(checkbox,j,0);

  5. #5
    Registered User sathyanarayanan.se's Avatar
    Join Date
    Jun 2010
    Location
    bangalore
    Posts
    23
    yeah ... but that also didnot work as expected..

  6. #6
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by sathyanarayanan.se View Post
    yeah ... but that also didnot work as expected..
    This must work as expected unless there is something else in your code.

  7. #7
    Registered User sathyanarayanan.se's Avatar
    Join Date
    Jun 2010
    Location
    bangalore
    Posts
    23
    i dont find any problem with my code... ok do u mean that reusing the layout is the only option and creating another layout and setting it cannot be done?

  8. #8
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by sathyanarayanan.se View Post
    i dont find any problem with my code... ok do u mean that reusing the layout is the only option and creating another layout and setting it cannot be done?
    If you don't find problems it doesn't mean they are absent. You can measure performance to see that re-using is actually faster.

  9. #9
    Nokia Developer Moderator achipa's Avatar
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327
    Quote Originally Posted by sathyanarayanan.se View Post
    i dont find any problem with my code... ok do u mean that reusing the layout is the only option and creating another layout and setting it cannot be done?
    If you are operating with two layouts, you will need to synchronize their relation/appearance yourself, while if you are reusing one layout, it's both faster and avoids the need for strategically placed calls to update, processEvents, show and similar. If your layout break because of this, then you are not cleaning things up properly (in plain English: you are solving a problem by introducing a different one )

Similar Threads

  1. Replies: 6
    Last Post: 2010-08-04, 13:33
  2. Nokia E61 Keyboard Layout issue in J2ME
    By jar.raj in forum Mobile Java General
    Replies: 2
    Last Post: 2010-06-03, 10:18
  3. Getting layout
    By Kvet in forum Symbian C++
    Replies: 2
    Last Post: 2010-02-23, 07:47
  4. Detecting Keypad Layout and Screen Layout
    By chonada in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-02-01, 03:13
  5. Fonts and LAyout
    By ranboutros in forum Symbian C++
    Replies: 0
    Last Post: 2003-06-10, 15:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved