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. Should I use QGraphicsView for a PDF viewer?
Forum Updated to NodeBB v4.3 + New Features

Should I use QGraphicsView for a PDF viewer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 5 Posters 560 Views 4 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.
  • U Offline
    U Offline
    user931357
    wrote on last edited by
    #1

    Hello. I am porting a PDF viewer library to Qt Widgets. I draw pages on the screen from paintEvent. While adding a shadow to pages, I learned that the Graphics View Framework could do that for me. It has more nice features which may be useful. I am worried that maybe QGraphicsView would be overkill for my application. Should I switch to it or should I continue development like I do and implement shadows manually? Later I will have to add text selection, highlight, and search features. The viewer has to work fast even with documents that have over 1000 pages.

    So, should I use QGraphicsView for this task? If yes, what could be the drawbacks and tradeoffs?

    JonBJ 1 Reply Last reply
    0
    • U user931357

      Hello. I am porting a PDF viewer library to Qt Widgets. I draw pages on the screen from paintEvent. While adding a shadow to pages, I learned that the Graphics View Framework could do that for me. It has more nice features which may be useful. I am worried that maybe QGraphicsView would be overkill for my application. Should I switch to it or should I continue development like I do and implement shadows manually? Later I will have to add text selection, highlight, and search features. The viewer has to work fast even with documents that have over 1000 pages.

      So, should I use QGraphicsView for this task? If yes, what could be the drawbacks and tradeoffs?

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @user931357
      Just checking: are you interested in/aware of existing widget support for viewing PDF in Qt widget, or are you only interested in porting your own?

      U 1 Reply Last reply
      1
      • JonBJ JonB

        @user931357
        Just checking: are you interested in/aware of existing widget support for viewing PDF in Qt widget, or are you only interested in porting your own?

        U Offline
        U Offline
        user931357
        wrote on last edited by
        #3

        @JonB yes, I am aware of QtPDF. Thank you. However, I need features that are missing in the library and I have to keep some of my changes closed source. I have found a WinForms PDF viewer library (PdfiumViewer) which is under Apache v2.0 license. I am porting it to QtWidgets and I will also release it under Apache v2.0 license. However, this license allows me to keep some of my modifications closed source.

        jeremy_kJ 1 Reply Last reply
        1
        • U user931357

          @JonB yes, I am aware of QtPDF. Thank you. However, I need features that are missing in the library and I have to keep some of my changes closed source. I have found a WinForms PDF viewer library (PdfiumViewer) which is under Apache v2.0 license. I am porting it to QtWidgets and I will also release it under Apache v2.0 license. However, this license allows me to keep some of my modifications closed source.

          jeremy_kJ Offline
          jeremy_kJ Offline
          jeremy_k
          wrote on last edited by
          #4

          @user931357 said in Should I use QGraphicsView for a PDF viewer?:

          I am porting it to QtWidgets and I will also release it under Apache v2.0 license. However, this license allows me to keep some of my modifications closed source.

          The last time I checked, QtWidgets wasn't licensed under Apache v2.0. The closest match is LGPL 3.0.

          https://www.qt.io/faq/tag/introduction

          Starting from Qt 5.7, Qt is licensed under
          • Commercial license
          • LGPL3 open source license
          • GPL2 or GPLv3 open source license

          The general Qt toolkit, consisting of Qt Essential code libraries, the Qt add-on APIs, and the Qt Creator IDE are available dual-licensed for commercial and GPL licenses. Most of the Qt APIs are available also under LGPLv3 license but not all of the Qt Add-on modules.

          Asking a question about code? http://eel.is/iso-c++/testcase/

          U 1 Reply Last reply
          0
          • jeremy_kJ jeremy_k

            @user931357 said in Should I use QGraphicsView for a PDF viewer?:

            I am porting it to QtWidgets and I will also release it under Apache v2.0 license. However, this license allows me to keep some of my modifications closed source.

            The last time I checked, QtWidgets wasn't licensed under Apache v2.0. The closest match is LGPL 3.0.

            https://www.qt.io/faq/tag/introduction

            Starting from Qt 5.7, Qt is licensed under
            • Commercial license
            • LGPL3 open source license
            • GPL2 or GPLv3 open source license

            The general Qt toolkit, consisting of Qt Essential code libraries, the Qt add-on APIs, and the Qt Creator IDE are available dual-licensed for commercial and GPL licenses. Most of the Qt APIs are available also under LGPLv3 license but not all of the Qt Add-on modules.

            U Offline
            U Offline
            user931357
            wrote on last edited by
            #5

            @jeremy_k maybe I didn't explain well. I meant that the C#/WinForms PDF viewer library that I want to use is licensed under Apache v2.0. Since I like the license but I don't want to work with C# and WinForms I am porting the library so that instead of using C# and WinForms I could use Qt Widgets and C++. So, I will make a port but will not change its license.

            I am not going to make any changes to Qt Widgets and it will be linked to that PDF viewer library dynamically. So, the source code will not be mixed.

            My entire point in using the Apache 2.0 licensed library is to avoid changing LGPL 3.0 code.

            Pl45m4P 1 Reply Last reply
            0
            • U user931357

              @jeremy_k maybe I didn't explain well. I meant that the C#/WinForms PDF viewer library that I want to use is licensed under Apache v2.0. Since I like the license but I don't want to work with C# and WinForms I am porting the library so that instead of using C# and WinForms I could use Qt Widgets and C++. So, I will make a port but will not change its license.

              I am not going to make any changes to Qt Widgets and it will be linked to that PDF viewer library dynamically. So, the source code will not be mixed.

              My entire point in using the Apache 2.0 licensed library is to avoid changing LGPL 3.0 code.

              Pl45m4P Offline
              Pl45m4P Offline
              Pl45m4
              wrote on last edited by
              #6

              @user931357 said in Should I use QGraphicsView for a PDF viewer?:

              I am not going to make any changes to Qt Widgets and it will be linked to that PDF viewer library dynamically. So, the source code will not be mixed.
              My entire point in using the Apache 2.0 licensed library is to avoid changing LGPL 3.0 code

              I'm not a lawyer, but AFAIK you cant release your whole app under Apache if it uses (L)GPL parts, even if you didn't modified the source.


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              SGaistS 1 Reply Last reply
              0
              • Pl45m4P Pl45m4

                @user931357 said in Should I use QGraphicsView for a PDF viewer?:

                I am not going to make any changes to Qt Widgets and it will be linked to that PDF viewer library dynamically. So, the source code will not be mixed.
                My entire point in using the Apache 2.0 licensed library is to avoid changing LGPL 3.0 code

                I'm not a lawyer, but AFAIK you cant release your whole app under Apache if it uses (L)GPL parts, even if you didn't modified the source.

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Pl45m4 here it's the other way around, QtPDF is LGPL and uses pdfium which is Apache 2.0 so if @user931357 modifies Qt itself, he is required to publish the changes he did. However, if the changes are done to pdfium directly and only pdfium, then I think he is fine keeping them private.

                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

                • Login

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