Blue drop on android with QComboBox using
-
Good day!
I have some trouble with using QComboBox on android device: sometimes after touching combobox blue drop is appeared on screen in strange position, like on the screenshot:
What's wrong with it?
Qt Creator 4.9.1 (based on Qt 5.12.3).
Compilator Android for arm64-v8a (Clang Qt 5.12.3 for Android ARM64-v8a) or Android for armeabi-v7a (Clang Qt 5.12.3 for Android ARMv7) (both have same result)
Phone Huawei Mate 10 Pro on Android 9.0
-
@Russian-Happy-Seal said in Blue drop on android with QComboBox using:
What's wrong with it?
I don't know - you did not explain much. You did not provide any code and you did not explain how you actually show this blue drop.
-
@jsulm Cause where is no code.
I created new QtWidget project with one MainWindow, added on it QComboBox with some items and build it.
After that I started app on my android device and clicked several times on combobox and it's items. Some of this clicks generated this blue drop, like on the screen.
-
A little update: it's happened only after click on QComboBox's item.
On google nexus tablet (Android 6.0.1) the same problem.
-
Here is my Solve:
class AndroidItemModel : public QStandardItemModel {
Q_OBJECT
public:
AndroidItemModel(QObject *parent = nullptr): QStandardItemModel(parent) {}
Qt::ItemFlags flags(const QModelIndex &index) const override {
if (!index.isValid()) {return Qt::NoItemFlags;}
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
}
};QComboBox * cb = new QComboBox();
cb ->setModel(new AndroidItemModel());