Running application in Android reduced functionalities for QList
-
@AdrianLV I doubt this has anything to do with QList.
This will not work on Android (also not on any other OS if the application is properly installed, because applications are not allowed to write in their installation folder):
QString folderPath = QDir::currentPath() + "/patientsFolder"; QDir().mkpath(folderPath);
Use https://doc.qt.io/qt-6/qstandardpaths.html to find correct location for application data.
"When I press on my button, nothing happens, it should be clearing the list and adding a new item" - verify why the signal/slot connection works and if it does whether the slot is called.
"I also tried setting a list in the MainWidget, but I have the same problems" - what list?
Moving windows on a mobile platform like Android isn't going to work.
-
Android screen redraws are really fucked up in C++,
I have the same problem items not being selected.
Example of bugreport: https://bugreports.qt.io/browse/QTBUG-128794If you want to save data with your application in Android you can use QSettings.
https://doc.qt.io/qt-6/qsettings.html
Use the first constructor, the one without filename./Martin
-
Qt Widgets has never been intended to be used on mobile devices such as Android or iOS.
Qt Quick is much more suitable for those devices. I seriously doubt this bug report will ever be addressed. -
I doubt this has anything to do with QList.
Then is it Android behaivour?
Use https://doc.qt.io/qt-6/qstandardpaths.html to find correct location for application data.
Thank you so much, I had not reached that far to test that part of my app, so I did not know if that would work out.
verify why the signal/slot connection works and if it does whether the slot is called.
The slot is being called, it is just the refreshing of the list that does not work.
what list?
A QListWidget, but I erased it when I saw it not working.
Moving windows on a mobile platform like Android isn't going to work.
What would you suggest instead of moving windows?
Thank you for your time.
-
Example of bugreport: https://bugreports.qt.io/browse/QTBUG-128794
I see, but you still have not got a reply, right?
Use the first constructor, the one without filename.
Is this one better than: https://doc.qt.io/qt-6/qstandardpaths.html?
Thank you so much for your time!
-
@ankou29666
Hi, I guess I discovered a little bit late that QtQuick was better for mobile development. I am still learning, I guess for the next mobile development I do I will start with QtQuick directly.
Thank you for your time! -
@AdrianLV said in Running application in Android reduced functionalities for QList:
What would you suggest instead of moving windows?
Why do you want to move windows on Android? By default an application consumes the whole space (except the top and bottom bars).
"A QListWidget, but I erased it when I saw it not working" - so, it is not about QList but QListWidget? Did you debug the slot to see what happens?
You could also provide a minimal compilable example showing this issue. -
@AdrianLV said in Running application in Android reduced functionalities for QList:
Example of bugreport: https://bugreports.qt.io/browse/QTBUG-128794
I see, but you still have not got a reply, right?
I got a reply from Axel Spoerl that there are problems, but if/when it will be fixed is anyones guess.
Did I understand that that the redraw problems persist in QtQuick?
Use the first constructor, the one without filename.
Is this one better than: https://doc.qt.io/qt-6/qstandardpaths.html?
Depends on what you want. If you want to save data for your app, like settings/INI files then QSettings are best.
If you want to share your data with other apps, make it visible as a file to the user then use the correct QStandardPath.Thank you so much for your time!
No worries :) -
Why do you want to move windows on Android?
I don't necessarily want it to be moving window, but I just wanted to open a second window in which I would be able to connect my device to my sensor.
You could also provide a minimal compilable example showing this issue.
Sorry, how is this done? Should I compress the build file and upload it here? Or is it compressing the files without the build?
Thank you for your time!
-
@AdrianLV said in Running application in Android reduced functionalities for QList:
but I just wanted to open a second window in which I would be able to connect my device to my sensor.
You should not do this on mobile platforms - this is against the style guidelines (mobile applications usually do not have more than one window).
"Sorry, how is this done? Should I compress the build file and upload it here?" - no, you simply provide a minimal application showing this issue, without any unnecessary code. This makes it easier to reproduce the issue and to debug it. You provided a lot of code, but most of it is not relevant for the issue.
-
but if/when it will be fixed is anyones guess.
That is a shame...
Did I understand that that the redraw problems persist in QtQuick?
I did not try my application with QtQuick, I was ready to try to do the transition, but I thought of a workaround that I don't like, but I guess for now it will be the solution(Not displaying a second window, but just connect directly to a pre saved UUID device).
Depends on what you wan
Wow, thank you so much!
-
You should not do this on mobile platforms
I see... Thank you for the advice
no, you simply provide a minimal application showing this issue, without any unnecessary code.
I created this small app, should be created as widget app with a ui. I compiled it with Clang arm64-68. Add a QListWidget Item and call it list to the window, add 2 buttons one called refill and other one clear and add slots on clicked
void MainWindow::on_refill_clicked() { for (int var = 0; var < 6; ++var) { new QListWidgetItem(QString::number(var), ui->list); } } void MainWindow::on_clear_clicked() { ui->list->clear(); }
In my device, when running it you can see how the list gets partially cleared and partially filled.
-
@AdrianLV This is a piece of code, not a minimal application.
But OK.
"you can see how the list gets partially cleared and partially filled" - you mean not all entries are removed if you clear the list and if you add 6 entries you see less than 6 of them in the UI? And this only happens on Android?
Does "ui->list->update();" after clearing the list or adding entries to it help? -
This is a piece of code, not a minimal application.
Sorry, how can I share the minimal application?
you mean not all entries are removed if you clear the list and if you add 6 entries you see less than 6 of them in the UI? And this only happens on Android?
All entries are removed on the backend, but not on the graphics(Only when you click 2 times the clear button you can see that they were removed). After adding the elements, you can see only after the second adding that there is something being added. And yes, in my computer it is working normally.
Does "ui->list->update();" after clearing the list or adding entries to it help?
Sadly, not...
-
@AdrianLV said in Running application in Android reduced functionalities for QList:
Sorry, how can I share the minimal application?
You can upload it to some file sharing service and post the link here.
To me it sounds like a bug. You can report it on Qt Bug Tracker adding a minimal application. Keep in mind that for mobile platforms Qt Company prefers QML/QtQuick over QtWidgets.
-
@jsulm said in Running application in Android reduced functionalities for QList:
@AdrianLV said in Running application in Android reduced functionalities for QList:
but I just wanted to open a second window in which I would be able to connect my device to my sensor.
You should not do this on mobile platforms - this is against the style guidelines (mobile applications usually do not have more than one window).
StackLayout in QML or QStackLayout or QStackWidget (among others) for QtWidgets could be considered as an alternative to a popup window.
-