Should I use QGraphicsView for a PDF viewer?
-
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?
-
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?
@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? -
@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?@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.
-
@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.
@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 licenseThe 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.
-
@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 licenseThe 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.
@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.
-
@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.
@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 codeI'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.
-
@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 codeI'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.
@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.