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. How change background OUTSIDE application window in Android?

How change background OUTSIDE application window in Android?

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 3 Posters 2.1k Views 1 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.
  • G Offline
    G Offline
    Gourmet
    wrote on last edited by
    #1

    I create aplication for Android using QMainWindow. All works fine but if I run application on device with screen resolution greater than window has - outside this window clean white field appears. I did not find the way how change this color. Later I will make scaling window but now I need make this field black. Anybody knows how change color OUTSIDE application window?

    Or just better - how make it transparent? On my Android tablet I use Calculator++. It can appear as small window in upper left screen corner. Not as applet but as window exactly. Other descktop part remains visible and responsible for taps. Can I get similar behaviuor in application based on QMainWindow?

    jsulmJ 1 Reply Last reply
    0
    • G Gourmet

      I create aplication for Android using QMainWindow. All works fine but if I run application on device with screen resolution greater than window has - outside this window clean white field appears. I did not find the way how change this color. Later I will make scaling window but now I need make this field black. Anybody knows how change color OUTSIDE application window?

      Or just better - how make it transparent? On my Android tablet I use Calculator++. It can appear as small window in upper left screen corner. Not as applet but as window exactly. Other descktop part remains visible and responsible for taps. Can I get similar behaviuor in application based on QMainWindow?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Gourmet Why is your app not full-screen?

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

      1 Reply Last reply
      1
      • G Offline
        G Offline
        Gourmet
        wrote on last edited by
        #3

        Cause I do not need full screen. On large tablet it looks ugly.

        jsulmJ 1 Reply Last reply
        0
        • G Gourmet

          Cause I do not need full screen. On large tablet it looks ugly.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Gourmet Non-fullscreen apps are actually unusual on mobiles and tablets (cannot remember any). I don't know how to change the background, I guess it is handled by the OS.

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

          1 Reply Last reply
          0
          • G Offline
            G Offline
            Gourmet
            wrote on last edited by Gourmet
            #5

            I know some Android apps with "windows" smaller than screen size. They work fine and they confirm - this can be done. I'm sure not the OS but application defines how it is visible on Android screen.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              Gourmet
              wrote on last edited by
              #6

              Adding of android:theme="@android:style/Theme.Translucent" to <activity...> tag in AdroidManifest.xml makes entire screen black. Including background of application "window". This looks much better than entire white screen. I can fill "window" background by any needed picture. Outside it screen will remain black. But I expected get transparent background outside "window" - I wanna see other application activity there. How can I do that?

              By the way - this theme setting forces standrard controls on screen look "Androidish". For example progress bar appeared like default Android progress bar - grey strip on yellow background and without border. In QtDesigner I tuned it's look differently but all my settings were lost. Buttons look different too. I afraid if I will set skins for buttons - they will be lost with theme setting. How can I force controls look as I requested but use theme for just app background? In other words - How can I force controls skinning appear AFTER Android theme applied?

              1 Reply Last reply
              0
              • T Offline
                T Offline
                tataeress
                wrote on last edited by
                #7

                anyone cen help me with this same issue pls?

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tataeress
                  wrote on last edited by
                  #8

                  found it finally :D
                  u need to add add this
                  android:theme="@android:style/Theme.Translucent"
                  to <application...> section of AndroidManifest.xml.
                  then add this to your class:
                  this->setPalette(Qt::transparent);
                  source : https://bugreports.qt.io/browse/QTBUG-57394
                  thx @Gourmet a lot

                  1 Reply Last reply
                  1

                  • Login

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