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. Color of staus- and navigationbar on android

Color of staus- and navigationbar on android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 4 Posters 1.4k Views 2 Watching
  • 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.
  • L Offline
    L Offline
    Luffy97
    wrote on last edited by
    #1

    Hello everyone,

    I am new to this forum and recently started learning Qt. I am working on an app for andriod to learn the mechanics. Unfortunately, I couldn't find a way to change the color of the status- and navigationbar while the app is being used on the andriod device.

    I found out that before there was a way with
    "QtAndroid::runOnAndroidThread" but I think it was replaced by :

    "QAndroidApplication::runOnAndroidMainThread(const std::function<QVariant ()> &runnable, const QDeadlineTimer timeout = QDeadlineTimer::Forever)" .

    Unfortunately I have not found any examples for the use of this code on the internet (only the explanation here https://doc-snapshots.qt.io/qt6-dev/qnativeinterface-qandroidapplication.html#runOnAndroidMainThread) and I would be especially interested in the use to change the color of the status- and navigationbar. I have no idea where to put the code and how to change the color of the bars with it.

    I would appreciate any help on this.
    Have a nice weekend.

    L 1 Reply Last reply
    0
    • L Luffy97

      Hello everyone,

      I am new to this forum and recently started learning Qt. I am working on an app for andriod to learn the mechanics. Unfortunately, I couldn't find a way to change the color of the status- and navigationbar while the app is being used on the andriod device.

      I found out that before there was a way with
      "QtAndroid::runOnAndroidThread" but I think it was replaced by :

      "QAndroidApplication::runOnAndroidMainThread(const std::function<QVariant ()> &runnable, const QDeadlineTimer timeout = QDeadlineTimer::Forever)" .

      Unfortunately I have not found any examples for the use of this code on the internet (only the explanation here https://doc-snapshots.qt.io/qt6-dev/qnativeinterface-qandroidapplication.html#runOnAndroidMainThread) and I would be especially interested in the use to change the color of the status- and navigationbar. I have no idea where to put the code and how to change the color of the bars with it.

      I would appreciate any help on this.
      Have a nice weekend.

      L Offline
      L Offline
      Luffy97
      wrote on last edited by
      #2

      @Luffy97

      Has no one any ideas? If there is any other way to change those colors, I would also appreciate hearing about them.

      Best regards

      piervalliP L 2 Replies Last reply
      0
      • L Luffy97

        @Luffy97

        Has no one any ideas? If there is any other way to change those colors, I would also appreciate hearing about them.

        Best regards

        piervalliP Offline
        piervalliP Offline
        piervalli
        wrote on last edited by
        #3
        This post is deleted!
        Flaming MoeF 1 Reply Last reply
        0
        • L Luffy97

          @Luffy97

          Has no one any ideas? If there is any other way to change those colors, I would also appreciate hearing about them.

          Best regards

          L Offline
          L Offline
          lemons
          wrote on last edited by
          #4

          @Luffy97 check out this repository:
          https://github.com/jpnurmi/qtstatusbar/

          L 1 Reply Last reply
          0
          • piervalliP piervalli

            This post is deleted!

            Flaming MoeF Offline
            Flaming MoeF Offline
            Flaming Moe
            wrote on last edited by Flaming Moe
            #5

            As far as I see and as far as I know the Notification Example, it does not extend QtActivity.
            It uses a static java method which is also the key, why that example is rather simple and not a gate to solve all problems. Some things can´t be called from a static context. I experienced that with getWindow() on my journey to set the FLAG_SHOW_WHEN_LOCKED. I also tried a singelton pattern to access non-static methods from a static context, which also doesn´t work for my goal.

            Using non static methods requires to create an instance of that java class and when that class extends QtActivity I found things to become tricky by resulting in a problem "that it can´t be called from the worker thread, but has to be in the GUI thread" -> That is dangerous half-knowledge I´m posting which relates to my recent problems and googling activities the last days.

            Furthermore it might be important, if we´re talking about Qt6 or 5.
            As far as I understood it, QT6 isn´t fully featured yet and in it´s current most upto-date version 6.6 still missing "androidextras" - so probably some feature known from Qt5 are not available yet.
            https://doc.qt.io/qt-6/whatsnewqt6.html

            A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

            1 Reply Last reply
            0
            • L lemons

              @Luffy97 check out this repository:
              https://github.com/jpnurmi/qtstatusbar/

              L Offline
              L Offline
              Luffy97
              wrote on last edited by
              #6

              @lemons thanks for the info. I think I already saw this one. The problem is, qt6 only allowed me the cmake build with qt quick application.

              This example on github uses qmake. Is their any equivalent code for cmake builds?

              Flaming MoeF L 2 Replies Last reply
              0
              • L Luffy97

                @lemons thanks for the info. I think I already saw this one. The problem is, qt6 only allowed me the cmake build with qt quick application.

                This example on github uses qmake. Is their any equivalent code for cmake builds?

                Flaming MoeF Offline
                Flaming MoeF Offline
                Flaming Moe
                wrote on last edited by
                #7

                @Luffy97 Since I think a three days Qt6.6 is out. I don´t know on which version you´re running, before 6.6 I updated from 6.3 to 6.5 which at least gave me Bluetooth access on Android :)
                I used the Qt maintenance tool to do that.

                A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

                1 Reply Last reply
                0
                • L Luffy97

                  @lemons thanks for the info. I think I already saw this one. The problem is, qt6 only allowed me the cmake build with qt quick application.

                  This example on github uses qmake. Is their any equivalent code for cmake builds?

                  L Offline
                  L Offline
                  Luffy97
                  wrote on last edited by
                  #8

                  @Luffy97 I'm still using Qt6.5, but the problem is many solutions to general problems like my problem is mostly written in qmake, and since Qt6 started to focus on cmake, it is very difficult to find applicable code on the internet.

                  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