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. Styling / background color of QPrintPreviewWidget
QtWS25 Last Chance

Styling / background color of QPrintPreviewWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
qprintpreviewwistyle
8 Posts 3 Posters 930 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.
  • N Offline
    N Offline
    Nando
    wrote on 6 Mar 2020, 10:28 last edited by
    #1

    Hi,
    is there a way to customise the QPrintPreviewWidget background color. The area where the pages are painted on...?

    Greetings
    Nando

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 Mar 2020, 22:21 last edited by
      #2

      Hi,

      Out of curiosity, what are you trying to achieve ?

      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
      • N Offline
        N Offline
        Nando
        wrote on 12 Mar 2020, 15:32 last edited by
        #3

        I just want to adjust the background color to our style guide.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 12 Mar 2020, 21:55 last edited by
          #4

          You can try with a style sheet but I am not sure it's not a native widget like the QPrintDialog.

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

          N 1 Reply Last reply 16 Mar 2020, 20:18
          0
          • S SGaist
            12 Mar 2020, 21:55

            You can try with a style sheet but I am not sure it's not a native widget like the QPrintDialog.

            N Offline
            N Offline
            Nando
            wrote on 16 Mar 2020, 20:18 last edited by
            #5

            @SGaist Hi, i tried it with stylesheet, but it seems not to work. I just need to change the default background color of the QPrintPreviewWidget...

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 16 Mar 2020, 20:34 last edited by
              #6

              How did you do that ?

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

              N 1 Reply Last reply 17 Mar 2020, 10:05
              0
              • S SGaist
                16 Mar 2020, 20:34

                How did you do that ?

                N Offline
                N Offline
                Nando
                wrote on 17 Mar 2020, 10:05 last edited by
                #7

                @SGaist I tried like this:

                QPrintPreviewWidget {
                    background-color: #FEA0A0;
                }
                
                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  demko
                  wrote on 27 Jan 2021, 18:45 last edited by demko
                  #8

                  @Nando, @SGaist
                  QPrintPreviewWidget used QGraphicsView in source code so solution in qss is

                  QGraphicsView {
                      qproperty-backgroundBrush: "red";
                  }
                  
                  1 Reply Last reply
                  2

                  • Login

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