Results 1 to 6 of 6

Thread: Still facing Alignment problem in QTable

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default Still facing Alignment problem in QTable

    hai All


    I am still facing some problem with ALIGNMENT ( cell_data in QTable) while am trying to include QCheckTableItem as cell_data in QTable

    This is the class i have created to support Left alignment in QTable

    Qt Code:
    1. class MyTableItem : public QTableITem
    2. {
    3. QString m_strAlign ;
    4. public :
    5. -----
    6. -------- // other constructors support pixmap, text..etc
    7.  
    8. // new constructor which support QCheckTableItem in Cell_Data
    9. DWCTableItem( QTable * table,
    10. EditType editType,
    11. const QCheckTableItem * chkTableItem,
    12. const QString & AlignSpec = "LeftCenter" )
    13. : QTableItem ( table, editType ) , m_strAlign ( AlignSpec )
    14. {
    15.  
    16. }
    17. virtual alignment() const
    18. {
    19. ---
    20. ---// after some process
    21. ---
    22. return Qt::AlignLeft ;
    23.  
    24. }
    25.  
    26.  
    27. };
    To copy to clipboard, switch view to plain text mode 

    In run time am calling this as follows.....

    Qt Code:
    1. -----------------
    2. QTable *myTable = new QTable(.... );
    3. QCheckTableItem *myCheckTableItem = new QCheckTableItem ( myTable, "SomeText" );
    4.  
    5.  
    6.  
    7. myTable->setItem ( row, col, new MyTableItem(
    8. myTable,
    9. QTableItem::Never,
    10. myCheckTableItem ) );
    11. ------------------
    To copy to clipboard, switch view to plain text mode 

    After this QTable is not showing any thing in that cell , where we used the funciton

    Qt Code:
    1. myTable->setItem ( row, col, new MyTableItem(
    2. myTable,
    3. QTableItem::Never,
    4. myCheckTableItem ) );
    To copy to clipboard, switch view to plain text mode 

    Please tell me whether am using the appropriate constructor of QTableITem in MyTableITem...??
    please tell me what's wrong with this...!!


    Thanks in advance
    Last edited by wysota; 14th December 2006 at 15:15. Reason: changed [html] to [code]

Similar Threads

  1. Regarding alignment in QTable
    By joseph in forum Qt Programming
    Replies: 4
    Last Post: 5th December 2006, 10:35
  2. QTable resize problem with large tables
    By Robzzz in forum Newbie
    Replies: 3
    Last Post: 22nd May 2006, 14:13
  3. Facing problem with Q3Canvas
    By jnana in forum Qt Programming
    Replies: 3
    Last Post: 6th May 2006, 07:00
  4. Facing problem with tool bar icons
    By jnana in forum Qt Programming
    Replies: 4
    Last Post: 20th April 2006, 08:37
  5. Problem with QTable
    By zlatko in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2006, 10:00

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.