incartasa
25th November 2009, 05:21
Hi,
I am an absolute Newbie to Qt just trying to understand the best approach to a problem I am working on:
I need to build a "spreadsheet" style of application that has a very specific presentation and as such it is not possible to use a pre-built spreadsheet widget. I decided to start my work by sub classing QLineEdit as a "Cell" class, add appropriate functionality and then combine cells into rows.
The first issue I discovered was that although I could set the text of a QLineEdit object in the Cell class constructor, the only way I could change the text later on was to use a signal: setText() - using, this->setText("Hello") seems to load the text (as it can be read back) but it does not display.
Also, I have noted after looking at other spreadsheet code that another approach may be to use a label widget as the cell basis and then create a QLineEdit widget whenever the cell is edited - not sure of the advantage of this?
I guess that these are fairly basis questions - nevertheless andy assiastance would be appreciated...
Mark
I am an absolute Newbie to Qt just trying to understand the best approach to a problem I am working on:
I need to build a "spreadsheet" style of application that has a very specific presentation and as such it is not possible to use a pre-built spreadsheet widget. I decided to start my work by sub classing QLineEdit as a "Cell" class, add appropriate functionality and then combine cells into rows.
The first issue I discovered was that although I could set the text of a QLineEdit object in the Cell class constructor, the only way I could change the text later on was to use a signal: setText() - using, this->setText("Hello") seems to load the text (as it can be read back) but it does not display.
Also, I have noted after looking at other spreadsheet code that another approach may be to use a label widget as the cell basis and then create a QLineEdit widget whenever the cell is edited - not sure of the advantage of this?
I guess that these are fairly basis questions - nevertheless andy assiastance would be appreciated...
Mark