Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. scroll of the textBrowser

scroll of the textBrowser

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 4 Posters 1.6k 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi
    Make them same size ?

    ? 1 Reply Last reply
    0
    • ? A Former User

      I created a textBrowser dynamically, but the scroll graphically is different of the scroll that I create in ui:
      0_1554716904403_Cattura.textBrowserDynamicPNG.PNG 0_1554716917822_CatturaTextBrowser.PNG

      How I can do for do them equal

      K Offline
      K Offline
      kenchan
      wrote on last edited by kenchan
      #3

      @vale88
      make sure you are previewing it in the same style as you are actually using.
      if you don't know which style your app is using set it with the app->setStyle("fusion"); function.
      The "fusion" style is the one they recommend for cross platform consistency.

      ? 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        Make them same size ?

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #4

        @mrjj No, the same style, if you see, the style in the two photos is different

        1 Reply Last reply
        0
        • K kenchan

          @vale88
          make sure you are previewing it in the same style as you are actually using.
          if you don't know which style your app is using set it with the app->setStyle("fusion"); function.
          The "fusion" style is the one they recommend for cross platform consistency.

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #5

          @kenchan in the code how must I write?

          K 1 Reply Last reply
          0
          • ? A Former User

            @kenchan in the code how must I write?

            K Offline
            K Offline
            kenchan
            wrote on last edited by kenchan
            #6

            @vale88
            Usually after you have created the instance of the QApplication object, then call the setStyle("fusion"); of the app object.
            something like myapp->setStyle("fusion");
            see it in the docs here

            ? 1 Reply Last reply
            2
            • K kenchan

              @vale88
              Usually after you have created the instance of the QApplication object, then call the setStyle("fusion"); of the app object.
              something like myapp->setStyle("fusion");
              see it in the docs here

              ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #7

              @kenchan it doesn't work

              1 Reply Last reply
              0
              • Cobra91151C Offline
                Cobra91151C Offline
                Cobra91151
                wrote on last edited by Cobra91151
                #8

                @vale88

                Hi! If you just want to set the default style for scrollbar, then put this code in your stylesheet and add to qApp->setStyleSheet() or set it to the widget using setStyleSheet method:

                QScrollBar:horizontal {
                    background-color: none;
                }
                
                QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
                    background: none;
                }
                
                QScrollBar:vertical {
                    background-color: none;
                }
                
                QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
                    background: none;
                }
                

                Default scollbar

                This will be the default scrollbar.

                ? 1 Reply Last reply
                2
                • Cobra91151C Cobra91151

                  @vale88

                  Hi! If you just want to set the default style for scrollbar, then put this code in your stylesheet and add to qApp->setStyleSheet() or set it to the widget using setStyleSheet method:

                  QScrollBar:horizontal {
                      background-color: none;
                  }
                  
                  QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
                      background: none;
                  }
                  
                  QScrollBar:vertical {
                      background-color: none;
                  }
                  
                  QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
                      background: none;
                  }
                  

                  Default scollbar

                  This will be the default scrollbar.

                  ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #9

                  @Cobra91151 yes but this code how must I write it?Because I have a textBrowser

                  Cobra91151C 1 Reply Last reply
                  0
                  • ? A Former User

                    @Cobra91151 yes but this code how must I write it?Because I have a textBrowser

                    Cobra91151C Offline
                    Cobra91151C Offline
                    Cobra91151
                    wrote on last edited by
                    #10

                    @vale88

                    I just described above, there are two options:

                    1. Make it global for all scrollbars across your app using qApp->setStyleSheet()
                    2. Make it only for the textBrowser (textBrowser->setStyleSheet())

                    Choose what you want.

                    ? 2 Replies Last reply
                    2
                    • Cobra91151C Cobra91151

                      @vale88

                      I just described above, there are two options:

                      1. Make it global for all scrollbars across your app using qApp->setStyleSheet()
                      2. Make it only for the textBrowser (textBrowser->setStyleSheet())

                      Choose what you want.

                      ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #11

                      @Cobra91151 but all the code with ""?

                      1 Reply Last reply
                      0
                      • Cobra91151C Cobra91151

                        @vale88

                        I just described above, there are two options:

                        1. Make it global for all scrollbars across your app using qApp->setStyleSheet()
                        2. Make it only for the textBrowser (textBrowser->setStyleSheet())

                        Choose what you want.

                        ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #12

                        @Cobra91151 thanks a lot, it works

                        Cobra91151C 1 Reply Last reply
                        1
                        • ? A Former User

                          @Cobra91151 thanks a lot, it works

                          Cobra91151C Offline
                          Cobra91151C Offline
                          Cobra91151
                          wrote on last edited by
                          #13

                          @vale88

                          Ok. So, make it solved then.

                          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