Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Change color to BusyIndicator
QtWS25 Last Chance

Change color to BusyIndicator

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
15 Posts 8 Posters 5.4k 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.
  • D Offline
    D Offline
    davidesalvetti
    wrote on last edited by
    #4

    After some other tests it looks like this problem is only given when the QtQuickControls is 2.0 or more.
    For QtQuickControls 1.4 it does not give any problem but I have to use a different code:

    import QtQuick 2.6
    import QtQuick.Controls 1.4
    Rectangle {
            width: 50
            height: 50
            visible: true
    
            BusyIndicator {
               id: busyIndication
               anchors.centerIn: parent
    
               // 'running' defaults to 'true'
            }
    }
    

    Because the property contentItem is not found using QtQuick.Controls 1.4
    But the porblem of this code is that I can't change the color of the busyIndicator.

    1 Reply Last reply
    0
    • oria66O Offline
      oria66O Offline
      oria66
      wrote on last edited by
      #5

      This post is pretty old. However, there is another way, easier, to change the color of the BusyIndicator. If you combine a Busy Indicator with ColorOverlay, you will have the desired result.

      Good luck.

      The truth is out there

      1 Reply Last reply
      0
      • H Offline
        H Offline
        haftado3
        wrote on last edited by haftado3
        #6

        i have an easier and better solution for this :

        import QtQuick 2.12
        import QtQuick.Controls 2.12
        import QtQuick.Controls.Universal 2.12
        BusyIndicator {
            id: busyIndicator
            //x: 290
            //y: 330
            implicitWidth: 75
            implicitHeight: 75
            visible: running
            running: true
            anchors.horizontalCenter: parent.horizontalCenter
            Universal.accent: Universal.Orange //here you can set color
        }
        
        oria66O 1 Reply Last reply
        0
        • H haftado3

          i have an easier and better solution for this :

          import QtQuick 2.12
          import QtQuick.Controls 2.12
          import QtQuick.Controls.Universal 2.12
          BusyIndicator {
              id: busyIndicator
              //x: 290
              //y: 330
              implicitWidth: 75
              implicitHeight: 75
              visible: running
              running: true
              anchors.horizontalCenter: parent.horizontalCenter
              Universal.accent: Universal.Orange //here you can set color
          }
          
          oria66O Offline
          oria66O Offline
          oria66
          wrote on last edited by
          #7

          @haftado3 Hi. That solution is easier, but with limited colors. What about the black, for example?

          The truth is out there

          Gojir4G H 2 Replies Last reply
          0
          • oria66O oria66

            @haftado3 Hi. That solution is easier, but with limited colors. What about the black, for example?

            Gojir4G Offline
            Gojir4G Offline
            Gojir4
            wrote on last edited by Gojir4
            #8

            @oria66 Universal.Orange is just predefined color but you can use any color. But I guess it will no longer work if you change style to Material for example.

            From Qt Doc: Note: Even though the accent can be any color, it is recommended to use one of the pre-defined Universal colors that have been designed to work well with the rest of the Universal style palette.

            oria66O 1 Reply Last reply
            0
            • Gojir4G Gojir4

              @oria66 Universal.Orange is just predefined color but you can use any color. But I guess it will no longer work if you change style to Material for example.

              From Qt Doc: Note: Even though the accent can be any color, it is recommended to use one of the pre-defined Universal colors that have been designed to work well with the rest of the Universal style palette.

              oria66O Offline
              oria66O Offline
              oria66
              wrote on last edited by
              #9

              @Gojir4. Thanks for the anotation!

              The truth is out there

              1 Reply Last reply
              0
              • H Offline
                H Offline
                haftado3
                wrote on last edited by
                #10

                @oria66 you can set any :

                Universal.accent: "yellow"
                
                1 Reply Last reply
                0
                • oria66O oria66

                  @haftado3 Hi. That solution is easier, but with limited colors. What about the black, for example?

                  H Offline
                  H Offline
                  haftado3
                  wrote on last edited by
                  #11

                  @oria66 if you want to change to black style :

                  Universal.theme = Universal.Dark
                  

                  or if you only want black color :

                  Universal.accent:"black"
                  
                  1 Reply Last reply
                  0
                  • DiracsbracketD Offline
                    DiracsbracketD Offline
                    Diracsbracket
                    wrote on last edited by
                    #12

                    Hi.
                    With fullscreen EGLFS applications without a desktop environment the Universal themes don't seem to work.

                    What works to change the color of the BusyIndicator though is to change its palette.dark property to the color you want.

                    BusyIndicator {
                        ...
                       palette.dark: "blue"
                       ...
                    }
                    
                    1 Reply Last reply
                    3
                    • T Offline
                      T Offline
                      Talya
                      wrote on last edited by
                      #13

                      Hi,
                      I know I'm opening an old question but it is not working for me:
                      BusyIndicator {
                      x: stageRec.width/2 -width + 30
                      y: 300
                      running: backend.checkupReadyState?false : true
                      Universal.accent: Universal.Orange
                      }
                      this is my code and my color isn't changing. anyone know why?

                      J.HilkJ 1 Reply Last reply
                      0
                      • T Talya

                        Hi,
                        I know I'm opening an old question but it is not working for me:
                        BusyIndicator {
                        x: stageRec.width/2 -width + 30
                        y: 300
                        running: backend.checkupReadyState?false : true
                        Universal.accent: Universal.Orange
                        }
                        this is my code and my color isn't changing. anyone know why?

                        J.HilkJ Offline
                        J.HilkJ Offline
                        J.Hilk
                        Moderators
                        wrote on last edited by
                        #14

                        @Talya HI and welcome,

                        take look at the documentation, the section about customizing the busy indicator:

                        https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-busyindicator


                        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                        Q: What's that?
                        A: It's blue light.
                        Q: What does it do?
                        A: It turns blue.

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          Talya
                          wrote on last edited by
                          #15

                          Thank you very!

                          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