Results 1 to 9 of 9

Thread: QTable - paintCell() - how to do with it?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Posts
    42
    Thanks
    13
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default QTable - paintCell() - how to do with it?

    Hi, hopefully, someone can help me out about the "paintCell()" issues.

    All I wanted to do is paint a few selected cells in a relatively large table.

    I have done all the seraches in the internet. All I saw were "re-implement" the paintCell(). OK I did it.

    1. I created a form - mainForm and drag a table into the form.
    2. So, in my project, I have mainform.ui mainform.ui.h and main.cpp
    3. So, how can I re-implement paintCell()? I create a class coded in the mainform.ui.h named Table which is inheriated from QTable. And re-write the paintCell() function, sounds right?
    4. Then, I pass the compiler. But, I did not pass the linker. The error message is: undefined refernce to mainform:aintCell(... ...) So, what went wrong?

    Then, I am thinking, I can pass the linker, how I can invoke this paintCell()? My table was dragged into the form and its the object of the QTable.

    I will be really appreciated if anyone can give me a clue.

    Best Regards,

    Here is the structure of my code:

    // filename: mainform.ui.h

    Qt Code:
    1. class Table::public QTable
    2. {
    3. Q_OBJECT
    4. public:
    5. void paintCell(QPainter *painter, int row, in col, const QRect &rc, bool selected, const QColorGroup &cg);
    6. };
    7.  
    8. void Table::paintCell( ... ... )
    9. {
    10. ... ...
    11. }
    To copy to clipboard, switch view to plain text mode 

    // mainform code starts here
    Qt Code:
    1. void mainform::init()
    2. {
    3. ... ...
    4. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 25th March 2009 at 23:27.

Similar Threads

  1. Searching a QTable
    By nategoofs in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 22:15
  2. a question about QTable
    By qtopiahooo in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2007, 01:25
  3. QTable column stretchable with minimum Width
    By sunil.thaha in forum Qt Programming
    Replies: 0
    Last Post: 24th April 2006, 13:17
  4. Problem with QTable
    By zlatko in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2006, 10:00
  5. QTable..Vs.. QListView
    By :db:sStrong in forum Qt Programming
    Replies: 1
    Last Post: 15th February 2006, 21:03

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.