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. how to change background color of qpdfview
Forum Updated to NodeBB v4.3 + New Features

how to change background color of qpdfview

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 525 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.
  • JoeCFDJ Offline
    JoeCFDJ Offline
    JoeCFD
    wrote on last edited by
    #1

    I am testing the following example
    https://doc.qt.io/qt-5/qtpdf-pdfviewer-example.html

    tried to change the background color of qpdfview with stylesheet. No change. Any one had the same issue?

    It is weird that class QPdfView is not documented here
    https://doc.qt.io/qt-5.15/classes.html
    Any reason?

    Qt 5.15.3 and Ubuntu 22.04

    C 1 Reply Last reply
    0
    • JoeCFDJ JoeCFD

      I am testing the following example
      https://doc.qt.io/qt-5/qtpdf-pdfviewer-example.html

      tried to change the background color of qpdfview with stylesheet. No change. Any one had the same issue?

      It is weird that class QPdfView is not documented here
      https://doc.qt.io/qt-5.15/classes.html
      Any reason?

      Qt 5.15.3 and Ubuntu 22.04

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @JoeCFD The background of the page content or the background outside the page? The former is controlled by the PDF file itself.

      You can adjust the other by adjusting the QPdfWidget::viewport() palette Palette::Dark: see How to set QPdfView's viewport background color?

      JoeCFDJ 1 Reply Last reply
      2
      • C ChrisW67

        @JoeCFD The background of the page content or the background outside the page? The former is controlled by the PDF file itself.

        You can adjust the other by adjusting the QPdfWidget::viewport() palette Palette::Dark: see How to set QPdfView's viewport background color?

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by
        #3

        @ChrisW67 Made it. Thanks a lot.

        1 Reply Last reply
        0
        • JoeCFDJ JoeCFD has marked this topic as solved on

        • Login

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