Web lists-archives.com

Re: KF5 Conversion problems




On Sat, Mar 10, 2018 at 10:58:14PM +0700, Robin Atwood wrote:
> On Saturday 10 March 2018, Christoph Feck wrote:
> > On 10.03.2018 15:51, Robin Atwood wrote:
> > > This is my first KDE4->KF5 conversion so brace for a lot of n00b
> > > questions! To start I am getting compile failures because the wrong
> > > include files are
> > 
> > > getting picked up:
> > [...]
> > 
> > > /usr/include/kdialog.h:35:25: fatal error: QtGui/QDialog: No such file or
> > > directory
> > > 
> > >  #include <QtGui/QDialog>
> > 
> > QDialog is in QWidgets, see
> > https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5 But I suggest to remove
> > the path from include statements.
> > 
> > If it still cannot find Qt includes, you also need find_package(Qt ...)
> > calls in cmake, and the corresponding Qt5::Widgets dependency in
> > target_link_libraries().
> 
> Yes, but the problem is the /usr/include/kdialog.h when it should be finding 
> /usr/include/KF5/KDELibs4Support/kdialog.h. I have find_package(Qt5 Widgets... 
> already.

Sounds like 2 problems I think.

First you need to fix the kdialog.h include in your software (or help
us identify where it is broken in the KF5 build system).  Is your build
system already looking for KF5::KDELibs4Support, and marking your build
target as depending on that library?

Even with this incorrect kdialog, you would think it would still find
the right QDialog though.  That's why it sounds like there's 2 problems.
I think the issue here is that there is no longer a QtGui/QDialog.  The
right path would be in QtWidgets/QDialog with Qt5.  It's better (and now
recommended) just to use a '#include <QDialog>' (and in general,
#include <QClassname>).

Regards,
 - Michael Pyne