I would like the text to be inserted from right to left style commercial bank, I'm using a mask with a "," type #####,##
Have you researched how to make and found no solution, anyone have any idea how to solve this?
I would like the text to be inserted from right to left style commercial bank, I'm using a mask with a "," type #####,##
Have you researched how to make and found no solution, anyone have any idea how to solve this?
Found this http://stackoverflow.com/questions/1...in-a-qlineedit it may be useful
in main.cpp add
for layout direction use //for each qwidget intializerQt Code:
To copy to clipboard, switch view to plain text mode
Screenshot.jpgQt Code:
this->setLayoutDirection(Qt::RightToLeft);To copy to clipboard, switch view to plain text mode
Last edited by alrawab; 24th February 2013 at 18:58.
I think the OP wants the numeric entry to fill from the right with a forced decimal point like a commercial calculator, not text in a RTL language. For example, entering 123.56 one digit at a time...
Simple right-alignment gets part way there, but the input mask causes issues. There should be a way to use the alignment with a QValidator instead of the mask. Have QValidator::validate() remove any non-digit, insert a decimal two chars from the right (if the string is long enough), and set the editor's string.Qt Code:
[ 1] [ 12] [ 1.23] [ 12.35] [ 123.56]To copy to clipboard, switch view to plain text mode
If it was intended as said colleague ChrisW67
Thus the solution
QLineEdit=new QLineEdit(this);
QDoubleValidator *myDblVal = new QDoubleValidator(0, 99999999999999, 2,LineEdit );
LineEdit->setValidator(myDblVal);
LineEdit->setAlignment(Qt::AlignRight);
Bookmarks