Skip to content

Instantly share code, notes, and snippets.

@arndo
Created November 12, 2014 16:25
Show Gist options
  • Save arndo/c629eac09d7137e281ff to your computer and use it in GitHub Desktop.
Save arndo/c629eac09d7137e281ff to your computer and use it in GitHub Desktop.
CutyCapt.patch
diff -aur CutyCapt/CutyCapt.cpp CutyCapt.1/CutyCapt.cpp
--- CutyCapt/CutyCapt.cpp 2014-11-12 16:41:30.354714781 +0100
+++ CutyCapt.1/CutyCapt.cpp 2014-11-12 16:41:30.354714781 +0100
@@ -27,11 +27,7 @@
#include <QtWebKit>
#include <QtGui>
#include <QSvgGenerator>
-
-#if QT_VERSION < 0x050000
#include <QPrinter>
-#endif
-
#include <QTimer>
#include <QByteArray>
#include <QNetworkRequest>
diff -aur CutyCapt/CutyCapt.pro CutyCapt.1/CutyCapt.pro
--- CutyCapt/CutyCapt.pro 2014-11-12 16:31:34.476193204 +0100
+++ CutyCapt.1/CutyCapt.pro 2014-11-12 16:41:30.354714781 +0100
@@ -4,7 +4,7 @@
CONFIG += qt console
greaterThan(QT_MAJOR_VERSION, 4): {
- QT += webkitwidgets
+ QT += webkitwidgets printsupport
}
contains(CONFIG, static): {
@schinkelg
Copy link

Thank you for this, it works great!

@puravida
Copy link

puravida commented May 24, 2016

Awesome! Thanks! :)

While the code did compile, I still got the first warning: CutyCapt.cpp:244:66: warning: unused parameter 'errors' [-Wunused-parameter] CutyCapt::handleSslErrors(QNetworkReply* reply, QList<QSslError> errors) {

This patch doesn't seem to address that one. I found another thread that suggested to add:

`#include

include `

to CutyCapt.hpp but mine already had those lines and still gives the error. If you are notified of this comment, please let me know if you have any ideas on this one. Thanks!

@cyphunk
Copy link

cyphunk commented Feb 14, 2019

Can confirm this worked for me

@ymgh96
Copy link

ymgh96 commented Jun 27, 2021

wonderful! it work for me too. but let me explain details for beginner person like me to be more clear!
you should change two file: CutyCapt.pro and CutyCapt.cpp.
in CutyCapt.pro: change "QT += webkitwidgets" to "QT += webkitwidgets printsupport"
in CutyCapt.cpp: remove "#if QT_VERSION < 0x050000" and "#endif" from before and aftet of "#include "
and finally run "make" command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment