Bug 100552 - test-render-to-file.cpp
Summary: test-render-to-file.cpp
Status: RESOLVED INVALID
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium trivial
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-04 11:41 UTC by Miroslav Tzonkov
Modified: 2017-09-11 16:33 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch for test-render-to-file.cpp for MacOS compilation (335 bytes, patch)
2017-09-08 15:24 UTC, Gwenaël Cléon
Details | Splinter Review

Description Miroslav Tzonkov 2017-04-04 11:41:18 UTC
CXX      test-render-to-file.o
test-render-to-file.cpp:3:27: fatal error: QGuiApplication: No such file or directory
compilation terminated.
Makefile:1115: recipe for target 'test-render-to-file.o' failed
make[3]: *** [test-render-to-file.o] Error 1
make[3]: *** Waiting for unfinished jobs....
stress-threads-qt5.cpp: In member function ‘virtual void CrazyThread::run()’:

Qt is installed in /opt/Qt5.7.0/
all environment variables regarding it are set properly.
seems the same as Bug ID: 94937 which was rejected/stated invalid ;)


--- ../hbs/poppler/qt5/tests/test-render-to-file.cpp	2016-06-20 19:19:21.698190618 +0300
+++ ../hbs.working/poppler/qt5/tests/test-render-to-file.cpp	2016-06-20 15:44:11.796130011 +0300
@@ -1,7 +1,8 @@
 #include <QtCore/QDebug>
 #include <QtCore/QFile>
-#include <QGuiApplication>
-#include <QImage>
+//#include <QGuiApplication>
+#include <QtWidgets/QApplication>
+#include <QtGui/QImage>
 
 #include <poppler-qt5.h>
Comment 1 Albert Astals Cid 2017-04-04 22:28:03 UTC
This is still not the correct fix.
Comment 2 Gwenaël Cléon 2017-09-08 15:07:24 UTC
Hi,

I have bee dealing with this bug since a long time and was able to compile successfully on MacOS, replacing

+#include <QtWidgets/QApplication>

by 

+#include <QtGui/QApplication>


(In reply to Albert Astals Cid from comment #1)
> This is still not the correct fix.
Comment 3 Gwenaël Cléon 2017-09-08 15:10:18 UTC
Sorry, a mistake in my previous answer,

in file : qt5/tests/test-render-to-file.cpp :

#include <QtCore/QDebug>
#include <QtCore/QFile>
-#include <QGuiApplication>
-#include <QImage>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QImage>

(In reply to gwenael from comment #2)
> Hi,
> 
> I have bee dealing with this bug since a long time and was able to compile
> successfully on MacOS, replacing
> 
> +#include <QtWidgets/QApplication>
> 
> by 
> 
> +#include <QtGui/QApplication>
> 
> 
> (In reply to Albert Astals Cid from comment #1)
> > This is still not the correct fix.
Comment 4 Gwenaël Cléon 2017-09-08 15:24:54 UTC
Created attachment 134090 [details] [review]
Patch for test-render-to-file.cpp for MacOS compilation
Comment 5 Albert Astals Cid 2017-09-08 17:28:40 UTC
What part of no, that's not needed and the problem is somewhere else you don't understand?

The documentation for QImage *clearly* states that the header is 
#include <QImage>
http://doc.qt.io/qt-5/qimage.html
Comment 6 Gwenaël Cléon 2017-09-11 14:55:15 UTC
Could you please be a little bit less agressive !

For example in the header poppler-qt5.h we can see :

#include <QtCore/QDateTime>

and the Qt documentation *clearly* states that the header for QDateTime is
#include <QDateTime>

So can you please explain that to me, as I am just a fool and you understood everything ?
http://doc.qt.io/qt-5/search-results.html?q=QDateTime

(In reply to Albert Astals Cid from comment #5)
> What part of no, that's not needed and the problem is somewhere else you
> don't understand?
> 
> The documentation for QImage *clearly* states that the header is 
> #include <QImage>
> http://doc.qt.io/qt-5/qimage.html
Comment 7 Gwenaël Cléon 2017-09-11 15:01:44 UTC
A juste thought that this place was a place of exchange and discussions and not a place for "I have understood ! You don't, so shut up !".


(In reply to Albert Astals Cid from comment #5)
> What part of no, that's not needed and the problem is somewhere else you
> don't understand?
> 
> The documentation for QImage *clearly* states that the header is 
> #include <QImage>
> http://doc.qt.io/qt-5/qimage.html
Comment 8 Albert Astals Cid 2017-09-11 16:33:52 UTC
(In reply to Gwenaël Cléon from comment #6)
> Could you please be a little bit less agressive !
> 
> For example in the header poppler-qt5.h we can see :
> 
> #include <QtCore/QDateTime>
> 
> and the Qt documentation *clearly* states that the header for QDateTime is
> #include <QDateTime>

I can change it if it makes you happier.

> 
> So can you please explain that to me, as I am just a fool and you understood
> everything ?

Maybe?

> http://doc.qt.io/qt-5/search-results.html?q=QDateTime

Once upon a time Qt recommended to use the Module/Class include, then they realized it was a stupid idea because it mean if they changed Class from ModuleA to ModuleB things would stop compiling so stopped recommending the Module/Class include in favour to just Class include. But both are correct and work, if it doesn't work it means the build system is wrongly set and it needs to be fixed there, but people keep sending the wrong patch, and then they complain because i tell them the patch is wrong.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.