Can you explain what was nonsense? Maybe it was nonsense for you, but I am pretty new , that's why it is posted in newbie section of the forum
Can you explain what was nonsense? Maybe it was nonsense for you, but I am pretty new , that's why it is posted in newbie section of the forum
Last edited by supratik; 12th November 2020 at 08:52.
First, maybe you can explain what you are doing here. How are you making "QTextEdit one of the widgets of QTreeWidget"? This doesn't make a lot of sense.I have designed an QTreeWidget with a QTextedit as one of the widget of the QTreeWidget.
Second, if you are using QTextEdit just to edit a two-letter string, why? QLineEdit seems a better fit.I want to restrict the input in the QTextEdit only to "OK/KO" and user should be prompted by message box to enter only this two values.
And third, if you use QLineEdit, then you can either 1) use an input mask (QLineEdit::setInputMask()) that restricts them from entering anything except "K" or "O", 2) use a QCompleter that gives only "OK" or "KO" as choices, 3) use a QValidator that accepts only "OK" or "KO", or 4) write your own handlers for the QLineEdit::textChanged(), QLineEdit::textEdited(), or QLineEdit::editingFinished() signals where you check to see if the user is entering (or has entered) the correct characters and either accept them or display your error message.
But to be honest, if the only thing the user can enter is "OK" or "KO" (whatever that means), then why don't you just use a check box? Either it is checked or it isn't, and that's your status.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
supratik (18th November 2020)
Bookmarks