Implementing a 14 lines x 60 columns Q[Plain]TextEdit



  • I need to implement a input widget where the user can fill maximum 14 lines x 60 columns of text. The data will be printed on a form and this is the maximum allowed dimension available.

    I read some posts and there are some proposals but I did not find something really suitable. A QPlainTextEdit would be great but it works with paragraphs/blocks, and wordwrapping doesn't create a new block... also setting maximum blocks number isn't ok, since it deletes the first line to add a new line at the end...

    I may use 14 QLineEdit.... but if I need to add a line or delete a line I have to cut/paste... or add some buttons to automate some changes...

    or create a new widget from scratch trying to simulate a full editor...

    Any ideas?



  • What about using a QTableWidget with editable items? That would be much easier to handle.
    In case of too less functinallity (hence you really need some functionallity of QLineEdit/QTextEdit that cannot be solved via QTableWidgetItem), you can still insert QLineEdits/QTextEdits into the table cells via setCellWidget.. Then you can easily add/insert/delete rows/columns without copy & paste...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.