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
class Table::public QTable
{
Q_OBJECT
public:
void paintCell
(QPainter *painter,
int row, in col,
const QRect &rc,
bool selected,
const QColorGroup
&cg
);
};
void Table::paintCell( ... ... )
{
... ...
}
class Table::public QTable
{
Q_OBJECT
public:
void paintCell(QPainter *painter, int row, in col, const QRect &rc, bool selected, const QColorGroup &cg);
};
void Table::paintCell( ... ... )
{
... ...
}
To copy to clipboard, switch view to plain text mode
// mainform code starts here
void mainform::init()
{
... ...
}
void mainform::init()
{
... ...
}
To copy to clipboard, switch view to plain text mode
Bookmarks