Compiling with QT5

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Agent Orange

Compiling with QT5

Unread post by Agent Orange » 2017-04-04, 20:30

Can Pale Moon can be / has it ever successfully been compiled with QT support?

I noticed that autoconf had an --enable-default-toolkit=cairo-qt option, and so I couldn't help myself. :lol:

On my system, it required the addition of --with-qtdir=/usr/lib/qt5 as well as a symlink from /usr/lib/qt5/include to ../../include/qt5; but once those were in place, the next problem was this compile error:

Code: Select all

19:14.26 nsQtNetworkLinkService.o
19:15.76 In file included from ../../../dist/include/nsISupportsUtils.h:14:0,
19:15.76                  from ../../../dist/include/nsISupports.h:123,
19:15.76                  from ../../../dist/include/nsINetworkLinkService.h:10,
19:15.76                  from /tmp/Pale-Moon-27.2.1_Release/netwerk/system/qt/nsQtNetworkLinkService.h:8,
19:15.76                  from /tmp/Pale-Moon-27.2.1_Release/netwerk/system/qt/nsQtNetworkLinkService.cpp:6:
19:15.76 /tmp/Pale-Moon-27.2.1_Release/netwerk/system/qt/nsQtNetworkLinkService.cpp: In member function ‘virtual MozExternalRefCountType nsQtNetworkLinkService::AddRef()’:
19:15.76 ../../../dist/include/nsISupportsImpl.h:90:3: error: static assertion failed: Reference-counted class nsQtNetworkLinkService should not have a public destructor. Try to make this class's destructor non-public. If that is really not possible, you can whitelist this class by providing a HasDangerousPublicDestructor specialization for it.
19:15.76    static_assert(!MOZ_IS_DESTRUCTIBLE(X) || \
19:15.76    ^
19:15.76 ../../../dist/include/nsISupportsImpl.h:563:3: note: in expansion of macro ‘MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING’
19:15.76    MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                                  \
19:15.76    ^
19:15.76 ../../../dist/include/nsISupportsImpl.h:1029:3: note: in expansion of macro ‘NS_IMPL_ADDREF’
19:15.76    NS_IMPL_ADDREF(aClass)                                                      \
19:15.76    ^
19:15.76 /tmp/Pale-Moon-27.2.1_Release/netwerk/system/qt/nsQtNetworkLinkService.cpp:14:1: note: in expansion of macro ‘NS_IMPL_ISUPPORTS’
19:15.76  NS_IMPL_ISUPPORTS(nsQtNetworkLinkService,
19:15.76  ^
19:15.93 In the directory  /tmp/pmbuild/netwerk/system/qt
19:15.93 The following command failed to execute properly:
19:15.93 c++ -o nsQtNetworkLinkService.o -c -I../../../dist/stl_wrappers -I../../../dist/system_wrappers -include /tmp/Pale-Moon-27.2.1_Release/config/gcc_hidden.h -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DMOZ_GLUE_IN_PROGRAM -DAB_CD=en-US -DNO_NSPR_10_SUPPORT -I/tmp/Pale-Moon-27.2.1_Release/netwerk/system/qt -I. -I/tmp/Pale-Moon-27.2.1_Release/netwerk/base -I../../../dist/include -I/usr/include/nspr -I/usr/include/nss -I/usr/include/pixman-1 -fPIC -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MP -MF .deps/nsQtNetworkLinkService.o.pp -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wcast-align -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -pipe -DNDEBUG -DTRIMMED -g -O2 -pipe -march=nehalem -mmmx -msse -msse2 -msse3 -mssse3 -mcrc32 -mcx16 -msahf -mpopcnt -msse4.2 -msse4.1 -mfxsr --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=nehalem -msse2 -mfpmath=sse -fomit-frame-pointer -DQT_SHARED -I/usr/lib/qt5/include -I/usr/lib/qt5/include/QtGui -I/usr/lib/qt5/include/QtCore -I/usr/lib/qt5/include/QtNetwork -I/usr/lib/qt5/include/QtXml -I/usr/lib/qt5/include/QtDeclarative -I/usr/lib/qt5/include/QtGui/5.6.2/QtGui -I/usr/lib/qt5/include/QtPrintSupport -I/usr/include/qt5/QtPositioning -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5 /tmp/Pale-Moon-27.2.1_Release/netwerk/system/qt/nsQtNetworkLinkService.cpp
19:15.93 gmake[5]: *** [/tmp/Pale-Moon-27.2.1_Release/config/rules.mk:938: nsQtNetworkLinkService.o] Error 1
19:15.93 gmake[4]: *** [/tmp/Pale-Moon-27.2.1_Release/config/recurse.mk:74: netwerk/system/qt/target] Error 2
19:15.93 gmake[3]: *** [/tmp/Pale-Moon-27.2.1_Release/config/recurse.mk:37: compile] Error 2
19:15.93 gmake[2]: *** [/tmp/Pale-Moon-27.2.1_Release/config/rules.mk:541: default] Error 2
19:15.93 gmake[1]: *** [/tmp/Pale-Moon-27.2.1_Release/client.mk:398: realbuild] Error 2
19:15.93 gmake: *** [client.mk:171: build] Error 2
19:15.97 32 compiler warnings present.
Might be a nice nod to our KDE friends if this worked. I don't use it myself, but I do know that native support beats that oxygen-gtk thing, if your system theme is QT-based.

The reason I bring this up mainly, though, is that if there are no plans to support QT, then that cruft could possibly be removed from the source?

New Tobin Paradigm

Re: Compiling with QT5

Unread post by New Tobin Paradigm » 2017-04-04, 20:52

That would be a no.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35636
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Compiling with QT5

Unread post by Moonchild » 2017-04-04, 22:57

To build with QT support, you will (obviously) have to work through a number of code-structural issues like this refcounted class having a public DTOR (which is dangerous because you could have an external call destroy the class while in use -- that's a code-security hazard (UAF etc.)
This code has not been tested or used for a long time; don't expect it to work out of the box.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked