I have an Android app written in C ++ using Qt Creator.
After updating the Qt version (from 4.8 to 5.4 ), I observed strange behavior: all QPushButton received a duplicate text label, one is in the right position, and the other is slightly shifted. This behavior can be observed on the Acer Iconia Tab A700 tab , but not on another device (Samsung Galaxy Tab).

I created a completely new QDialog menu in QT Creator using only a graphical editor, but it displayed the same thing.
Has anyone else observed the same thing? I am new to Qt and have no idea how to fix this ...
EDIT
Here are some snippets:
mydialog.ui
<widget class="QPushButton" name="startButton"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> <string>Start</string> </property> <property name="default"> <bool>true</bool> </property> </widget>
ui_mydialog.h
public: QPushButton *startButton; QPushButton *stopButton; ... void setupUi(QDialog *MyDialog) { ... // some layout stuff here startButton = new QPushButton(MyDialog); startButton->setObjectName(QStringLiteral("startButton")); QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(startButton->sizePolicy().hasHeightForWidth()); startButton->setSizePolicy(sizePolicy); startButton->setDefault(true); ... // later QWidget::setTabOrder(startButton, stopButton); } void retranslateUi(QDialog *MyDialog) { MyDialog->setWindowTitle(QApplication::translate("MyDialog", "Dialog", 0)); startButton->setText(QApplication::translate("MyDialog", "Start", 0)); stopButton->setText(QApplication::translate("MyDialog", "Stop", 0)); ... }
But then again, I used the Qt Creator GUI to create a dialog, so I guess it should be some configuration error. Or maybe something related to the retranslateUi() function?
Here's what it looks like in Qt Creator:

EDIT No. 2
I dug up some instructions where a specific button style was defined. Here he is:
foreach (QToolButton* bt, listOfToolButtons) { bt->setAttribute(Qt::WA_AcceptTouchEvents); bt->installEventFilter(scrollAreaForToolBar); bt->setIconSize(QSize(iconSize, iconSize)); bt->setStyleSheet("QToolButton{ background-color: #051a49; border: none;}"); scrollAreaContainer->layout()->addWidget(bt); }
c ++ android text qt qpushbutton
Steve M. Bay
source share