Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Running application in Android reduced functionalities for QList
QtWS25 Last Chance

Running application in Android reduced functionalities for QList

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
24 Posts 6 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J jsulm
    16 Sept 2024, 05:25

    @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.

    A Offline
    A Offline
    AdrianLV
    wrote on 19 Sept 2024, 09:07 last edited by
    #7

    @jsulm

    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.

    J 1 Reply Last reply 19 Sept 2024, 09:21
    0
    • M MartinGU
      16 Sept 2024, 19:46

      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-128794

      If 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

      A Offline
      A Offline
      AdrianLV
      wrote on 19 Sept 2024, 09:11 last edited by
      #8

      @MartinGU

      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!

      M 1 Reply Last reply 19 Sept 2024, 10:51
      0
      • A ankou29666
        16 Sept 2024, 20:00

        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.

        A Offline
        A Offline
        AdrianLV
        wrote on 19 Sept 2024, 09:13 last edited by
        #9

        @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!

        1 Reply Last reply
        0
        • A AdrianLV
          19 Sept 2024, 09:07

          @jsulm

          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.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 19 Sept 2024, 09:21 last edited by
          #10

          @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.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply 19 Sept 2024, 11:32
          0
          • A AdrianLV
            19 Sept 2024, 09:11

            @MartinGU

            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!

            M Offline
            M Offline
            MartinGU
            wrote on 19 Sept 2024, 10:51 last edited by
            #11

            @AdrianLV said in Running application in Android reduced functionalities for QList:

            @MartinGU

            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 :)

            A 1 Reply Last reply 19 Sept 2024, 11:49
            0
            • J jsulm
              19 Sept 2024, 09:21

              @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.

              A Offline
              A Offline
              AdrianLV
              wrote on 19 Sept 2024, 11:32 last edited by
              #12

              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!

              J 1 Reply Last reply 19 Sept 2024, 11:48
              0
              • A AdrianLV
                19 Sept 2024, 11:32

                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!

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 19 Sept 2024, 11:48 last edited by
                #13

                @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.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                A A 2 Replies Last reply 19 Sept 2024, 11:57
                0
                • M MartinGU
                  19 Sept 2024, 10:51

                  @AdrianLV said in Running application in Android reduced functionalities for QList:

                  @MartinGU

                  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 :)

                  A Offline
                  A Offline
                  AdrianLV
                  wrote on 19 Sept 2024, 11:49 last edited by
                  #14

                  @MartinGU

                  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!

                  1 Reply Last reply
                  0
                  • J jsulm
                    19 Sept 2024, 11:48

                    @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.

                    A Offline
                    A Offline
                    AdrianLV
                    wrote on 19 Sept 2024, 11:57 last edited by
                    #15

                    @jsulm

                    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.

                    J 1 Reply Last reply 19 Sept 2024, 12:08
                    0
                    • A AdrianLV
                      19 Sept 2024, 11:57

                      @jsulm

                      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.

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 19 Sept 2024, 12:08 last edited by
                      #16

                      @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?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      A 1 Reply Last reply 19 Sept 2024, 12:39
                      0
                      • J jsulm
                        19 Sept 2024, 12:08

                        @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?

                        A Offline
                        A Offline
                        AdrianLV
                        wrote on 19 Sept 2024, 12:39 last edited by
                        #17

                        @jsulm

                        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...

                        J 1 Reply Last reply 19 Sept 2024, 13:02
                        0
                        • A AdrianLV
                          19 Sept 2024, 12:39

                          @jsulm

                          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...

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 19 Sept 2024, 13:02 last edited by
                          #18

                          @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.

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          D 1 Reply Last reply 24 Sept 2024, 15:07
                          0
                          • J jsulm
                            19 Sept 2024, 11:48

                            @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.

                            A Offline
                            A Offline
                            ankou29666
                            wrote on 19 Sept 2024, 17:37 last edited by
                            #19

                            @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.

                            1 Reply Last reply
                            0
                            • J jsulm
                              19 Sept 2024, 13:02

                              @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.

                              D Offline
                              D Offline
                              drwho 0
                              wrote on 24 Sept 2024, 15:07 last edited by
                              #20

                              @jsulm said in Running application in Android reduced functionalities for QList:

                              Keep in mind that for mobile platforms Qt Company prefers QML/QtQuick over QtWidgets.

                              Did Qt communicate this somewhere?

                              J 1 Reply Last reply 25 Sept 2024, 06:05
                              0
                              • D drwho 0
                                24 Sept 2024, 15:07

                                @jsulm said in Running application in Android reduced functionalities for QList:

                                Keep in mind that for mobile platforms Qt Company prefers QML/QtQuick over QtWidgets.

                                Did Qt communicate this somewhere?

                                J Offline
                                J Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on 25 Sept 2024, 06:05 last edited by
                                #21

                                @drwho-0 https://doc.qt.io/qt-5/topics-ui.html#widget-based-user-interfaces

                                https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  MartinGU
                                  wrote on 27 Sept 2024, 07:10 last edited by
                                  #22

                                  I installed Qt 6.6.3 and and tried my C++ widget application (QList and QLineEdit).
                                  The bugs in 6.7.2 was NOT there. So instead of rewriting in QML I continue with 6.6.3 for Android projects.

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    MartinGU
                                    wrote on 8 Oct 2024, 09:13 last edited by
                                    #23

                                    Not solved in 6.8 :(

                                    1 Reply Last reply
                                    0
                                    • A Offline
                                      A Offline
                                      ankou29666
                                      wrote on 8 Oct 2024, 10:12 last edited by
                                      #24

                                      As I already said, QtWidgets has never been intended to work with mobile devices. So knowing the history of Qt, knowing why QtQuick has been created ... I wouldn't expect this bug to be addressed.

                                      1 Reply Last reply
                                      0

                                      • Login

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Groups
                                      • Search
                                      • Get Qt Extensions
                                      • Unsolved