Results 1 to 20 of 54

Thread: QTableWidget problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #25
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QTableWidget problem

    So, wysota, I've finnaly setup the table view. It is blank rectangle with white background. Now, like your hint was telling me, I used QModelIndex (not subclassed). How do I notify now the model about data source, which is QList of:
    Qt Code:
    1. typedef struct
    2. {
    3. qint16 iMerchandizeID;
    4. QString strMerchandizeName;
    5. qreal rMerchandizePrice;
    6. qint16 iMerchandizeQuantity;
    7. qreal rSubtotal;
    8. } structOrder;
    To copy to clipboard, switch view to plain text mode 
    And I've setup the view with:
    Qt Code:
    1. m_pShoppingCartTableView->setShowGrid(false);
    2. m_pShoppingCartTableView->setModel(m_pShoppingCartModel);
    3. m_pShoppingCartTableView->setItemDelegate(m_pShoppingCartItemDelegate);
    4. m_pShoppingCartTableView->horizontalHeader()->hide();
    5. m_pShoppingCartTableView->verticalHeader()->hide();
    6. m_pShoppingCartTableView->horizontalHeader()->setMinimumSectionSize(1);
    7. m_pShoppingCartTableView->verticalHeader()->setMinimumSectionSize(1);
    To copy to clipboard, switch view to plain text mode 
    I've copied this chunk of code from pixelator example and I've reused it. If i comment the first line, I still do not get grid (for instance). Does this mean view is not setup properly?
    Last edited by MarkoSan; 11th April 2008 at 10:19. Reason: spelling error
    Qt 5.3 Opensource & Creator 3.1.2

Similar Threads

  1. Replies: 3
    Last Post: 11th August 2007, 10:00
  2. experiencing problem at printing out QTableWidget
    By rmagro in forum Qt Programming
    Replies: 9
    Last Post: 27th June 2007, 16:04
  3. QTableWidget Problem, setRowWidget? :P
    By VireX in forum Newbie
    Replies: 17
    Last Post: 6th April 2007, 18:12
  4. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 18:46
  5. Problem inserting in QTableWidget
    By DPinLV in forum Qt Programming
    Replies: 2
    Last Post: 2nd August 2006, 00:10

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.