Results 1 to 4 of 4

Thread: Dynamically sized QTableWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Dynamically sized QTableWidget

    Hmm, I can't see a problem there which could cause a crash..

    You still should check the value if ok was even pressed, though, and only change the size when appropriate..
    Qt Code:
    1. bool ok = false;
    2. tableSize = QInputDialog::getInteger(...);
    3. if(ok)
    4. {
    5. demands->setRowCount(tableSize);
    6. demands->setColumnCount(tableSize);
    7. }
    To copy to clipboard, switch view to plain text mode 

    But anyway, that's not causing a crash. You seem to be forcing the integer value between 0-100, which is ok, and QTableWidget has a check for negative values so that's not the case either.. So I can't say..
    Maybe the problem lies somewhere else?

    Edit: Erm... what's that label doing there? I see it's adapted from the example piece of code in docs.. But you are allocating a new label each time the size is changed. Instantiate the label somewhere else, and only change it's value here..
    Last edited by jpn; 31st March 2006 at 21:09.

  2. The following user says thank you to jpn for this useful post:

    therealjag (1st April 2006)

Similar Threads

  1. How to make headers fixed sized? (QTableWidget)
    By macias in forum Qt Programming
    Replies: 4
    Last Post: 13th August 2007, 15:57

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.