Results 1 to 5 of 5

Thread: QGridLayout update

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Location
    China
    Posts
    127
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    30
    Thanked 4 Times in 4 Posts

    Question QGridLayout update

    Hi to all:

    I use a QGridLayoutin my QMainWindow, and have added some QToolButtonsinto it. But when I delete some QToolButtons in another dialog, the QGridLayout don't update itself. What's worse, even if I call the QGridLayout::update(),it still show part of the QToolButtonsthat have been deleted!!
    why??

  2. #2
    Join Date
    Feb 2009
    Posts
    79
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    11
    Thanked 5 Times in 5 Posts

    Default Re: QGridLayout update

    Without seeing any code, i would suspect that you only think that you have deleted these buttons. Are you really sure that they have been deleted?

  3. #3
    Join Date
    Apr 2009
    Location
    China
    Posts
    127
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    30
    Thanked 4 Times in 4 Posts

    Default Re: QGridLayout update

    Yeah, I'm sure I have deleted the chosen QToolButton, using the following codes:
    Qt Code:
    1. ui->gridLayout->removeWidget(iter.value());
    To copy to clipboard, switch view to plain text mode 
    the
    Qt Code:
    1. iter.value()
    To copy to clipboard, switch view to plain text mode 
    returns the a pointer to the QToolButtonin the GRridLayoutto be deleted.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: QGridLayout update

    What's the "iter.value()" parent? What's happen if you additionaly call
    Qt Code:
    1. delete iter.value();
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Apr 2009
    Location
    China
    Posts
    127
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    30
    Thanked 4 Times in 4 Posts

    Default Re: QGridLayout update

    Actually, I keep some QToolButtons in an QMap<QString, QToolButton *>,and I through the Iterator to delete the chosen QToolButton, and delete it in the QGridLayoutat the same time.
    But, failed

Similar Threads

  1. Problem in QProgressBar update
    By nikhilqt in forum Qt Programming
    Replies: 0
    Last Post: 10th March 2009, 10:20
  2. Is Update() the right way?
    By td in forum Newbie
    Replies: 1
    Last Post: 5th December 2008, 14:54
  3. Qt Update project - Opinions wanted
    By pvdk in forum Qt Programming
    Replies: 0
    Last Post: 8th November 2008, 08:41
  4. QPainter update()
    By csvivek in forum Qt Programming
    Replies: 5
    Last Post: 24th March 2008, 09:42
  5. Qt 3.3 QGridLayout
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 23rd February 2007, 17:40

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
  •  
Qt is a trademark of The Qt Company.