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. Does QString has any limitation in Android environment for Qt 5.15.2?
Forum Update on Monday, May 27th 2025

Does QString has any limitation in Android environment for Qt 5.15.2?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
qt5.15.2androidqstringbugqtcore
13 Posts 4 Posters 812 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.
  • S Offline
    S Offline
    sierdzio
    Moderators
    wrote on 7 Aug 2024, 12:08 last edited by
    #4

    Hm yes the number is very interesting indeed, looks like it is no coincidence.

    ... but I still think the string itself is fine and only in printing it is misrepresented. Otherwise it would be a very, very serious issue in Qt and I imagine it would have been detected earlier.

    (Z(:^

    1 Reply Last reply
    2
    • S sierdzio
      7 Aug 2024, 11:40

      Please check if temp.size() returns the same value on desktop and Android. Perhaps the string is only truncated during printing but internally the whole data is still there.

      Also a general remark: since this is an ASCI string you can save a lot of memory by using QLatin1String here instead of QString.

      S Offline
      S Offline
      SevenM
      wrote on 8 Aug 2024, 04:57 last edited by
      #5

      @sierdzio Yes, you are right! The size of temp is correct on both the platforms. Only in case of window the string is printed completely. Perhaps the limitation of qDebug in Android environment.
      However, my quest to identify the source of crash remains! I am using Qstring to save a large Sqlite query and only in the case on Android, I am getting this crash during execSql.
      Anyways, thanks for your inputs!

      Best Regards,
      M

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 8 Aug 2024, 19:56 last edited by
        #6

        Hi,

        What do you mean by large SQLite query ? How large ? What makes it so large ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        S 1 Reply Last reply 9 Aug 2024, 05:27
        0
        • S SGaist
          8 Aug 2024, 19:56

          Hi,

          What do you mean by large SQLite query ? How large ? What makes it so large ?

          S Offline
          S Offline
          SevenM
          wrote on 9 Aug 2024, 05:27 last edited by SevenM 8 Sept 2024, 05:29
          #7

          @SGaist It is an insert query with 1612 characters. Works perfectly well in windows but fail when cross-compile in Android and perform the same action.
          If I replace the query with something smaller, it works in Android. That's why I suspected QString can be an issue here.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sierdzio
            Moderators
            wrote on 9 Aug 2024, 07:33 last edited by
            #8

            Try running it with debugger attached, should show you where the issue occurs.

            (Z(:^

            S 1 Reply Last reply 9 Aug 2024, 09:01
            0
            • S sierdzio
              9 Aug 2024, 07:33

              Try running it with debugger attached, should show you where the issue occurs.

              S Offline
              S Offline
              SevenM
              wrote on 9 Aug 2024, 09:01 last edited by
              #9

              @sierdzio I just did that. Interesting, I see this at the point of crash:
              f2b8e7d6-abdb-4f76-97bd-adede0927bf7-image.png

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 9 Aug 2024, 09:04 last edited by
                #10

                Just to help narrow things, are you building the whole query string or are you binding values ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                S 1 Reply Last reply 9 Aug 2024, 09:12
                0
                • S SGaist
                  9 Aug 2024, 09:04

                  Just to help narrow things, are you building the whole query string or are you binding values ?

                  S Offline
                  S Offline
                  SevenM
                  wrote on 9 Aug 2024, 09:12 last edited by
                  #11

                  @SGaist I am building the whole query string, there are no binding values.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SevenM
                    wrote on 9 Aug 2024, 11:00 last edited by SevenM 8 Sept 2024, 11:00
                    #12

                    I think I identified the problem. The codebase doesn't solely rely on Sqlite plugin of Qt but also on external sqlite Library for certain operations while still using Qt connections to execute the query. Due to this shift in Qt version, maybe the Qt plugin and external lib were incompatible.
                    Qt 5.12.9 uses sqlite 3.32.1 in the sources while Qt 5.15.9 uses sqlite 3.33.0.
                    I simply changed to external lib to 3.33.0 (same as what Qt uses) and the query was handled correctly.

                    Anyways, Thank you so much for your help!

                    1 Reply Last reply
                    1
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 9 Aug 2024, 16:55 last edited by
                      #13

                      That was a nasty one. Glad you found out and thanks for sharing !

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • S SevenM has marked this topic as solved on 21 Aug 2024, 10:12

                      13/13

                      9 Aug 2024, 16:55

                      • Login

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