0

There is one Arabic string as: اختبار عرض اللغة العربية في QTE. The displaying on QLabel and QPushButton is different with same interface setText(). See picture below:

enter image description here

Anyone can help on why the displaying behavior is different?

m7913d
  • 10,244
  • 7
  • 28
  • 56
  • 1
    Please [edit] your question to provide a [mcve] that can be used to reproduce the problem. – G.M. Nov 24 '21 at 10:35

1 Answers1

0

possibly you need to change the direction of the layout. in detail here

setLayoutDirection(tr("LTR")=="RTL" ? Qt::RightToLeft : Qt::LeftToRight)
arutar
  • 1,015
  • 3
  • 9
  • Thanks for the suggestion. It seems that it takes effect when use qApp->setLayoutDirection(Qt::RightToLeft). But this will also affect the overall application layout. Here I only want to change the string direction on QPushButton to make it same as QLabel. However qPushButton->setLayoutDirection(Qt::RightToLeft) doesn't have effect. – jaredzhou Nov 26 '21 at 03:47