Results 1 to 3 of 3

Thread: Problem in QTableWidget::columnSpan()

  1. #1
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Post Problem in QTableWidget::columnSpan()

    Hi,

    I am working on Qt 4.4.0 release. There seems to be a problem in the QTableWidget::columnSpan() method.

    Qt Code:
    1. QTableWidget *tableWidget = new QTableWidget();
    2. tableWidget->setColumnCount(5);
    3. tableWidget->setRowCount(6);
    4. QTableWidgetItem *aItem = new QTableWidgetItem("Test");
    5. for(int i=0;i<6;i++)
    6. {
    7. for(int j=0;j<5;j++)
    8. {
    9. tableWidget->setItem(i, j, aItem );
    10. }
    11. }
    12. tableWidget->setSpan(1,2,1,2);
    13. tableWidget->setSpan(2,3,1,2);
    14.  
    15. int aSpan = tableWidget->columnSpan(1,2);
    16. aSpan = tableWidget->columnSpan(2,3); :( aSpan is set to 1, which is incorrect.
    To copy to clipboard, switch view to plain text mode 

    Can somebody help me..

    Thanks,
    Mahesh
    Last edited by jpn; 16th January 2009 at 15:37. Reason: missing [code] tags

  2. #2
    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: Problem in QTableWidget::columnSpan()

    Update to a more recent version of Qt. It returns 2 at least with Qt 4.5.0-beta1.

    PS. It makes no sense to set the same item to multiple cells.
    J-P Nurmi

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

    mah_singh1 (18th January 2009)

  4. #3
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Smile Re: Problem in QTableWidget::columnSpan()

    Thanks a lot for the answer. I will upgrade to the latest Qt version.

Similar Threads

  1. deployment problem: msvc++ 2008 Express, Qt 4.4.3
    By vonCZ in forum Qt Programming
    Replies: 7
    Last Post: 10th November 2008, 14:38
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  4. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  5. Replies: 16
    Last Post: 7th March 2006, 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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.