Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
But not everything. Please help me out a bit.
Quoted
Originally posted by Michiel
setCellContentFromEditor(): Here I save the editor-content to my data-structure and delete the QTextEdit widget, so it won't take up more memory. What I don't understand is where I get the QTextEdit pointer address from. It's not a parameter, and I don't think it's a member I can access.
Quoted
Incidentally, is there a better way to avoid a warning in a place like this?
Quoted
item(), setItem(), takeItem(): These I don't understand at all. The first returns a QTableItem. The other two take one as an argument. How could I re-implement them to not use QTableItems? What do these functions really do, anyway? Will I (or my table) ever use them?
Quoted
clearCell(): I suppose this deletes the entry in my data-structure of that cell, but I'm not positive.
Quoted
insertWidget(), cellWidget(), clearCellWidget(): I'm not sure on these. Is the widget that these functions manipulate the QTextEdit? I don't think so. What do these functions do? Do I need them?
Quoted
swapRows(), swapCells(), swapColumns(): Here I just manipulate the data in my data-structure accordingly, right? Nothing to do with painting anything. The table automatically repaints after these functions are called, right?
.
Quoted
If you don't use QTableItems and want your users to be able to swap rows, e.g. for sorting, you will need to reimplement this function. (See the notes on large tables.)
This post has been edited 1 times, last edit by "Michiel" (Aug 23rd 2005, 11:11pm)
Quoted
Originally posted by Michiel
Then I'll have to use multiple inheritance, or just give the QTableItem a pointer. I prefer the second.
|
|
Source code |
1 2 3 4 |
class MyTableItem : public QTableItem {
private:
my_structure data;
};
|
Quoted
Originally posted by Michiel
Do you have any idea what kind of functions I must re-implement in QTable to tell it to use LMTableItems instead of QTableItems?
Quoted
Originally posted by Michiel
Thanks! That, indeed, seems to be the best way to handle it. Just use the setItem function on every single cell that is created.
Quoted
I have another related question. I would like the cells to have OnTyping edit-mode, but when I type when a cell is selected (but not showing an editor yet), my own edit-widget (QTextEdit) doesn't appear.
A normal QLineEdit appears,