Page 1 of 2

Building on Gentoo with recent Qt

Posted: Thu Jun 04, 2015 7:59 pm
by massimo
I used to build the git source fine on gentoo with dev-qt/qtcore-4.8.6-r1 installed.
Since dev-qt/qtcore-4.8.7 I get the error

Code: Select all

qmake -r
Reading /home.crypt/massimo/opt/qcad/src/src.pro
 Reading /home.crypt/massimo/opt/qcad/src/3rdparty/3rdparty.pro
Project ERROR: Script bindings not available for Qt version 4.8.7. You can add them to src/3rdparty/qt-labs-qtscriptgenerator-4.8.7 or use another version of Qt.
Currently available Qt on Gentoo:

Code: Select all

[U] dev-qt/qtcore
     Available versions:  
     (4)    4.8.5-r2 4.8.6-r2 (~)4.8.7
     (5)    (~)5.4.1^t
Do I need to mask the 4.8.6 globally for building QCad? What version do I need? I can have some Qt4 and Qt5 slotted side by side, but not 2 of the Qt4. The old guide still says 4.8.4, isn't that outdated? Can I build a QCad with a local Qt in $HOME?

Re: Building on Gentoo with recent Qt

Posted: Thu Jun 04, 2015 8:37 pm
by massimo
It seems this 3rdparty had some binary parts. In qt-labs-qtscriptgenerator-4.8.6 are .o files are "ELF 64-bit LSB relocatable, x86-64".
So I was just lucky in the past that I was able to build that on my platform with that 4.8.6..., now with 4.8.7 it's not possible and would not be possible on other architectures.

What is this 3rdparty? Can I disable parts, just to get a working basic QCad build?

Re: Building on Gentoo with recent Qt

Posted: Fri Jun 05, 2015 7:47 am
by andrew
massimo wrote:It seems this 3rdparty had some binary parts.
No. There should not be any object files in a clean git checkout.
What is this 3rdparty? Can I disable parts, just to get a working basic QCad build?
No, the script bindings are fundamental to QCAD.

You can likely use the bindings for Qt 4.8.6, just copy or rename qcad/src/3rdparty/qt-labs-qtscriptgenerator-4.8.6 appropriately. Don't forget to rename the file qt-labs-qtscriptgenerator-4.8.6.pro as well.

Re: Building on Gentoo with recent Qt

Posted: Fri Jun 05, 2015 12:27 pm
by massimo
andrew wrote:You can likely use the bindings for Qt 4.8.6, just copy or rename qcad/src/3rdparty/qt-labs-qtscriptgenerator-4.8.6 appropriately. Don't forget to rename the file qt-labs-qtscriptgenerator-4.8.6.pro as well.
Thanks. I tried that before but I forgot to rename the file. Compilation worked now.
However the binary fails with:

Code: Select all

Fatal:    Cannot mix incompatible Qt library (version 0x40806) with this library (version 0x40807)

Re: Building on Gentoo with recent Qt

Posted: Fri Jun 05, 2015 3:16 pm
by andrew
Looks like you have object or library files from an older Qt version still around. A full clean / make should help.

Re: Building on Gentoo with recent Qt

Posted: Fri Jun 05, 2015 3:48 pm
by massimo
I forgot to say, this was a complete fresh clone from git.

Re: Building on Gentoo with recent Qt

Posted: Fri Jun 05, 2015 5:16 pm
by andrew
There's definitely a Qt version mixup. This has nothing to do with sources but with already compiled libraries.

Re: Building on Gentoo with recent Qt

Posted: Tue Feb 04, 2025 9:10 am
by massimo
Again same question with todays recent libraries such as:

Code: Select all

dev-qt/qtbase-6.8.1
dev-build/ninja-1.12.1
sys-devel/gcc-13.3.1_p20240614
x11-libs/libX11-1.8.10-r1
x11-libs/libXrender-0.9.12
https://www.qcad.org/en/component/conte ... om-sources only describes building with Qt5 on Linux and Qt6 on Windows, but not with Qt6 on Linux. So I tried like this:

Code: Select all

$ cmake -DBUILD_QT6=ON -DCMAKE_BUILD_TYPE=Release -G Ninja .
$ ninja
$ release/qcad-bin
QCAD version  3.32.0.1
09:09:22: Debug:    loading plugins...
09:09:22: Debug:    loading static plugins...
Warning:  No script handler found...
What is missing, and what do I need to do with the required qcadjsapi/ and qtjsapi/ ?

Re: Building on Gentoo with recent Qt

Posted: Sat Apr 12, 2025 6:45 pm
by massimo
Could you please provide a section how to build on Linux with Qt6?
As most distributions have dropped Qt5 and switched to Qt6, this is the way to go with system dependencies.

Code: Select all

$ git clone [email protected]:qcad/qcad.git qcad
Cloning into 'qcad'...

$ cd qcad/

$ cmake -DBUILD_QT6=ON -DCMAKE_BUILD_TYPE=Release -G Ninja .
-- The CXX compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /usr/lib64/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib64/libxkbcommon.so (found suitable version "1.8.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Found Cups: /usr/lib64/libcups.so (found version "2.4.11")
-- Configuring done (3.0s)
-- Generating done (0.2s)
-- Build files have been written to: /home/mb/src/other/qcad

$ ninja
[52/508] Building CXX object src/3rdparty/opennurbs/opennurbs/CMakeFiles/opennurbs.dir/__/opennurbs_archive.cpp.o
/home/mb/src/other/qcad/src/3rdparty/opennurbs/opennurbs_archive.cpp: In member function ‘virtual bool ON_BinaryFile::AtEnd() const’:
/home/mb/src/other/qcad/src/3rdparty/opennurbs/opennurbs_archive.cpp:12503:14: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12503 |         fread( &buffer, 1, 1, m_fp );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
[164/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/REntity.cpp.o
/home/mb/src/other/qcad/src/core/REntity.cpp: In member function ‘virtual bool REntity::setProperty(RPropertyTypeId, const QVariant&, RTransaction*)’:
/home/mb/src/other/qcad/src/core/REntity.cpp:345:23: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  345 |         if (value.type() == QVariant::Int || value.type() == QVariant::LongLong) {
      |             ~~~~~~~~~~^~
In file included from /usr/include/qt6/QtCore/QVariant:1,
                 from /home/mb/src/other/qcad/src/core/RPropertyAttributes.h:28,
                 from /home/mb/src/other/qcad/src/core/RObject.h:27,
                 from /home/mb/src/other/qcad/src/core/RTransaction.h:30,
                 from /home/mb/src/other/qcad/src/core/RTransactionStack.h:28,
                 from /home/mb/src/other/qcad/src/core/RDocument.h:30,
                 from /home/mb/src/other/qcad/src/core/REntity.cpp:20:
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/REntity.cpp:345:56: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  345 |         if (value.type() == QVariant::Int || value.type() == QVariant::LongLong) {
      |                                              ~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/REntity.cpp:347:30: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  347 |         } else if (value.type() == QVariant::String) {
      |                    ~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/REntity.cpp:355:23: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  355 |         if (value.type() == QVariant::Int || value.type() == QVariant::LongLong) {
      |             ~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/REntity.cpp:355:56: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  355 |         if (value.type() == QVariant::Int || value.type() == QVariant::LongLong) {
      |                                              ~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/REntity.cpp:368:23: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  368 |         if (value.type()==QVariant::Int || value.type()==QVariant::Double) {
      |             ~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/REntity.cpp:368:54: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  368 |         if (value.type()==QVariant::Int || value.type()==QVariant::Double) {
      |                                            ~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
[169/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RDxfServices.cpp.o
/home/mb/src/other/qcad/src/core/RDxfServices.cpp: In member function ‘QString RDxfServices::collectVersion2Info(const QString&)’:
/home/mb/src/other/qcad/src/core/RDxfServices.cpp:340:52: warning: ‘QMultiMap<Key, T>::iterator QMultiMap<Key, T>::insertMulti(const Key&, const T&) [with Key = int; T = QString]’ is deprecated: Use insert() instead [-Wdeprecated-declarations]
  340 |                             ellipseData.insertMulti(iCode, values[k]);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qdebug.h:33,
                 from /usr/include/qt6/QtCore/qvariant.h:12,
                 from /usr/include/qt6/QtCore/qlocale.h:7,
                 from /usr/include/qt6/QtCore/qcalendar.h:10,
                 from /usr/include/qt6/QtCore/qdatetime.h:8,
                 from /usr/include/qt6/QtCore/qfileinfo.h:12,
                 from /usr/include/qt6/QtCore/QFileInfo:1,
                 from /home/mb/src/other/qcad/src/core/RDxfServices.cpp:19:
/usr/include/qt6/QtCore/qmap.h:1482:14: note: declared here
 1482 |     iterator insertMulti(const Key &key, const T &value)
      |              ^~~~~~~~~~~
/home/mb/src/other/qcad/src/core/RDxfServices.cpp:404:36: warning: ‘QMultiMap<Key, T>::iterator QMultiMap<Key, T>::insertMulti(const Key&, const T&) [with Key = int; T = QString]’ is deprecated: Use insert() instead [-Wdeprecated-declarations]
  404 |             ellipseData.insertMulti(iCode, value);
      |             ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/qt6/QtCore/qmap.h:1482:14: note: declared here
 1482 |     iterator insertMulti(const Key &key, const T &value)
      |              ^~~~~~~~~~~
[184/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RLayer.cpp.o
/home/mb/src/other/qcad/src/core/RLayer.cpp: In member function ‘virtual bool RLayer::setProperty(RPropertyTypeId, const QVariant&, RTransaction*)’:
/home/mb/src/other/qcad/src/core/RLayer.cpp:154:23: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  154 |         if (value.type() == QVariant::Int || value.type() == QVariant::LongLong) {
      |             ~~~~~~~~~~^~
In file included from /usr/include/qt6/QtCore/QVariant:1,
                 from /home/mb/src/other/qcad/src/core/RPropertyAttributes.h:28,
                 from /home/mb/src/other/qcad/src/core/RObject.h:27,
                 from /home/mb/src/other/qcad/src/core/RLayer.h:27,
                 from /home/mb/src/other/qcad/src/core/RLayer.cpp:19:
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RLayer.cpp:154:56: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  154 |         if (value.type() == QVariant::Int || value.type() == QVariant::LongLong) {
      |                                              ~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RLayer.cpp:166:23: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  166 |         if (value.type()==QVariant::Int || value.type()==QVariant::Double) {
      |             ~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RLayer.cpp:166:54: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  166 |         if (value.type()==QVariant::Int || value.type()==QVariant::Double) {
      |                                            ~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
[188/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RGuiAction.cpp.o
/home/mb/src/other/qcad/src/core/RGuiAction.cpp: In member function ‘void RGuiAction::addShortcut(const QKeySequence&)’:
/home/mb/src/other/qcad/src/core/RGuiAction.cpp:374:33: warning: ‘constexpr QKeyCombination::operator int() const’ is deprecated: Use QKeyCombination instead of int [-Wdeprecated-declarations]
  374 |         key += QChar(shortcut[i]);
      |                                 ^
In file included from /usr/include/qt6/QtCore/qbytearray.h:9,
                 from /usr/include/qt6/QtCore/qstringview.h:10,
                 from /usr/include/qt6/QtCore/qchar.h:660,
                 from /usr/include/qt6/QtCore/qstring.h:14,
                 from /usr/include/qt6/QtCore/qdir.h:8,
                 from /usr/include/qt6/QtCore/QDir:1,
                 from /home/mb/src/other/qcad/src/core/RGuiAction.cpp:19:
/usr/include/qt6/QtCore/qnamespace.h:1912:26: note: declared here
 1912 |     constexpr Q_IMPLICIT operator int() const noexcept
      |                          ^~~~~~~~
[192/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RLocalPeer.cpp.o
/home/mb/src/other/qcad/src/core/RLocalPeer.cpp: In constructor ‘RLocalPeer::RLocalPeer(QObject*, const QString&)’:
/home/mb/src/other/qcad/src/core/RLocalPeer.cpp:55:30: warning: ‘quint16 qChecksum(const char*, qsizetype, Qt::ChecksumType)’ is deprecated: Use the QByteArrayView overload. [-Wdeprecated-declarations]
   55 |     quint16 idNum = qChecksum(idc.constData(), idc.size());
      |                     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qbytearray.h:15,
                 from /usr/include/qt6/QtCore/qstringview.h:10,
                 from /usr/include/qt6/QtCore/qchar.h:660,
                 from /usr/include/qt6/QtCore/qstring.h:14,
                 from /usr/include/qt6/QtCore/qcoreapplication.h:8,
                 from /usr/include/qt6/QtCore/QCoreApplication:1,
                 from /home/mb/src/other/qcad/src/core/RLocalPeer.cpp:19:
/usr/include/qt6/QtCore/qbytearrayview.h:404:16: note: declared here
  404 | inline quint16 qChecksum(const char *s, qsizetype len,
      |                ^~~~~~~~~
[194/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RMouseEvent.cpp.o
/home/mb/src/other/qcad/src/core/RMouseEvent.cpp: In constructor ‘RMouseEvent::RMouseEvent(QEvent::Type, const RVector&, Qt::MouseButton, Qt::MouseButtons, Qt::KeyboardModifiers, RGraphicsScene&, RGraphicsView&)’:
/home/mb/src/other/qcad/src/core/RMouseEvent.cpp:32:31: warning: ‘QMouseEvent::QMouseEvent(QEvent::Type, const QPointF&, Qt::MouseButton, Qt::MouseButtons, Qt::KeyboardModifiers, const QPointingDevice*)’ is deprecated: Use another constructor [-Wdeprecated-declarations]
   32 |     RInputEvent(position, s, v) {
      |                               ^
In file included from /usr/include/qt6/QtGui/QMouseEvent:1,
                 from /home/mb/src/other/qcad/src/core/RMouseEvent.h:25,
                 from /home/mb/src/other/qcad/src/core/RMouseEvent.cpp:21:
/usr/include/qt6/QtGui/qevent.h:202:5: note: declared here
  202 |     QMouseEvent(Type type, const QPointF &localPos, Qt::MouseButton button,
      |     ^~~~~~~~~~~
/home/mb/src/other/qcad/src/core/RMouseEvent.cpp: In constructor ‘RMouseEvent::RMouseEvent(const QMouseEvent&, RGraphicsScene&, RGraphicsView&, qreal)’:
/home/mb/src/other/qcad/src/core/RMouseEvent.cpp:39:44: warning: ‘QPointF QMouseEvent::localPos() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   39 |     RInputEvent(RVector(mouseEvent.localPos().x(), mouseEvent.localPos().y()), s, v, devicePixelRatio) {
      |                         ~~~~~~~~~~~~~~~~~~~^~
/usr/include/qt6/QtGui/qevent.h:236:13: note: declared here
  236 |     QPointF localPos() const { return position(); }
      |             ^~~~~~~~
/home/mb/src/other/qcad/src/core/RMouseEvent.cpp:39:71: warning: ‘QPointF QMouseEvent::localPos() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   39 |     RInputEvent(RVector(mouseEvent.localPos().x(), mouseEvent.localPos().y()), s, v, devicePixelRatio) {
      |                                                    ~~~~~~~~~~~~~~~~~~~^~
/usr/include/qt6/QtGui/qevent.h:236:13: note: declared here
  236 |     QPointF localPos() const { return position(); }
      |             ^~~~~~~~
[200/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RLinetypePattern.cpp.o
/home/mb/src/other/qcad/src/core/RLinetypePattern.cpp: In member function ‘bool RLinetypePattern::setPatternString(const QString&)’:
/home/mb/src/other/qcad/src/core/RLinetypePattern.cpp:465:25: warning: ignoring return value of ‘qsizetype QString::indexOf(const QRegularExpression&, qsizetype, QRegularExpressionMatch*) const’, declared with attribute ‘nodiscard’ [-Wunused-result]
  465 |             part.indexOf(rx, 0, &match);
      |             ~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qobject.h:11,
                 from /usr/include/qt6/QtCore/qiodevice.h:10,
                 from /usr/include/qt6/QtCore/qfiledevice.h:7,
                 from /usr/include/qt6/QtCore/qfile.h:8,
                 from /usr/include/qt6/QtCore/QFile:1,
                 from /home/mb/src/other/qcad/src/core/RLinetypePattern.cpp:19:
/usr/include/qt6/QtCore/qstring.h:327:29: note: declared here
  327 |     [[nodiscard]] qsizetype indexOf(const QRegularExpression &re, qsizetype from = 0,
      |                             ^~~~~~~
/home/mb/src/other/qcad/src/core/RLinetypePattern.cpp: In static member function ‘static QList<std::pair<QString, RLinetypePattern*> > RLinetypePattern::loadAllFrom(bool, const QString&)’:
/home/mb/src/other/qcad/src/core/RLinetypePattern.cpp:878:25: warning: ignoring return value of ‘qsizetype QString::indexOf(const QRegularExpression&, qsizetype, QRegularExpressionMatch*) const’, declared with attribute ‘nodiscard’ [-Wunused-result]
  878 |             line.indexOf(rx, 0, &match);
      |             ~~~~~~~~~~~~^~~~~~~~~~~~~~~
/usr/include/qt6/QtCore/qstring.h:327:29: note: declared here
  327 |     [[nodiscard]] qsizetype indexOf(const QRegularExpression &re, qsizetype from = 0,
      |                             ^~~~~~~
[202/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RPattern.cpp.o
/home/mb/src/other/qcad/src/core/RPattern.cpp: In static member function ‘static QList<std::pair<QString, RPattern*> > RPattern::loadAllFrom(const QString&)’:
/home/mb/src/other/qcad/src/core/RPattern.cpp:70:25: warning: ignoring return value of ‘qsizetype QString::indexOf(const QRegularExpression&, qsizetype, QRegularExpressionMatch*) const’, declared with attribute ‘nodiscard’ [-Wunused-result]
   70 |             line.indexOf(rx, 0, &match);
      |             ~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qdebug.h:16,
                 from /usr/include/qt6/QtCore/QDebug:1,
                 from /home/mb/src/other/qcad/src/core/RPattern.cpp:19:
/usr/include/qt6/QtCore/qstring.h:327:29: note: declared here
  327 |     [[nodiscard]] qsizetype indexOf(const QRegularExpression &re, qsizetype from = 0,
      |                             ^~~~~~~
[215/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RPropertyChange.cpp.o
/home/mb/src/other/qcad/src/core/RPropertyChange.cpp: In constructor ‘RPropertyChange::RPropertyChange(RPropertyTypeId, QVariant, QVariant)’:
/home/mb/src/other/qcad/src/core/RPropertyChange.cpp:26:22: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   26 |     if (oldValue.type()==QVariant::UserType &&
      |         ~~~~~~~~~~~~~^~
In file included from /usr/include/qt6/QtCore/QVariant:1,
                 from /home/mb/src/other/qcad/src/core/RPropertyChange.h:25,
                 from /home/mb/src/other/qcad/src/core/RPropertyChange.cpp:20:
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RPropertyChange.cpp:86:22: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   86 |     if (oldValue.type()==QVariant::UserType &&
      |         ~~~~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RPropertyChange.cpp:147:26: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  147 |         if (oldValue.type()!=newValue.type() && oldValue.isValid() && newValue.isValid()) {
      |             ~~~~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RPropertyChange.cpp:147:43: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  147 |         if (oldValue.type()!=newValue.type() && oldValue.isValid() && newValue.isValid()) {
      |                              ~~~~~~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
[225/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RS.cpp.o
/home/mb/src/other/qcad/src/core/RS.cpp: In static member function ‘static bool RS::compare(const QVariant&, const QVariant&, bool)’:
/home/mb/src/other/qcad/src/core/RS.cpp:69:20: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   69 |     switch (v1.type()) {
      |             ~~~~~~~^~
In file included from /usr/include/qt6/QtCore/qlocale.h:7,
                 from /usr/include/qt6/QtGui/qguiapplication.h:11,
                 from /usr/include/qt6/QtGui/QGuiApplication:1,
                 from /home/mb/src/other/qcad/src/core/RS.cpp:30:
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:72:24: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   72 |             if (v2.type()==QVariant::Double) {
      |                 ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:75:29: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   75 |             else if (v2.type()==QVariant::Int) {
      |                      ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:80:24: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   80 |             if (v2.type()==QVariant::Double) {
      |                 ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:83:29: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   83 |             else if (v2.type()==QVariant::Int) {
      |                      ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:91:24: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   91 |             if (v2.type()==QVariant::Int) {
      |                 ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:94:29: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   94 |             else if (v2.type()==QVariant::Double) {
      |                      ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:99:24: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   99 |             if (v2.type()==QVariant::Int) {
      |                 ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:102:29: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  102 |             else if (v2.type()==QVariant::Double) {
      |                      ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:109:20: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  109 |         if (v2.type()==QVariant::Bool) {
      |             ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:115:20: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  115 |         if (v2.type()==QVariant::UInt) {
      |             ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:121:20: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  121 |         if (v2.type()==QVariant::LongLong) {
      |             ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:127:20: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  127 |         if (v2.type()==QVariant::ULongLong) {
      |             ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/home/mb/src/other/qcad/src/core/RS.cpp:133:20: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  133 |         if (v2.type()==QVariant::String) {
      |             ~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
[230/508] Building CXX object src/core/CMakeFiles/qcadcore.dir/RSettings.cpp.o
/home/mb/src/other/qcad/src/core/RSettings.cpp: In static member function ‘static RColor RSettings::getColorValue(const QString&, const RColor&)’:
/home/mb/src/other/qcad/src/core/RSettings.cpp:1658:28: warning: ‘bool QVariant::canConvert(int) const’ is deprecated [-Wdeprecated-declarations]
 1658 |     else if (ret.canConvert(QMetaType::QString)) {
      |              ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qlocale.h:7,
                 from /usr/include/qt6/QtGui/qguiapplication.h:11,
                 from /usr/include/qt6/QtWidgets/qapplication.h:13,
                 from /usr/include/qt6/QtWidgets/QApplication:1,
                 from /home/mb/src/other/qcad/src/core/RSettings.cpp:19:
/usr/include/qt6/QtCore/qvariant.h:354:10: note: declared here
  354 |     bool canConvert(int targetTypeId) const
      |          ^~~~~~~~~~
/home/mb/src/other/qcad/src/core/RSettings.cpp:1665:28: warning: ‘bool QVariant::canConvert(int) const’ is deprecated [-Wdeprecated-declarations]
 1665 |     else if (ret.canConvert(QMetaType::QColor)) {
      |              ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/qt6/QtCore/qvariant.h:354:10: note: declared here
  354 |     bool canConvert(int targetTypeId) const
      |          ^~~~~~~~~~
/home/mb/src/other/qcad/src/core/RSettings.cpp: In static member function ‘static double RSettings::getDoubleValue(const QString&, double)’:
/home/mb/src/other/qcad/src/core/RSettings.cpp:1684:17: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
 1684 |     if (ret.type()==QVariant::List
      |         ~~~~~~~~^~
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
[352/508] Building CXX object src/entity/CMakeFiles/qcadentity.dir/RDimensionEntity.cpp.o
/home/mb/src/other/qcad/src/entity/RDimensionEntity.cpp: In member function ‘virtual bool RDimensionEntity::setProperty(RPropertyTypeId, const QVariant&, RTransaction*)’:
/home/mb/src/other/qcad/src/entity/RDimensionEntity.cpp:255:31: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
  255 |                 if (value.type()==QVariant::String) {
      |                     ~~~~~~~~~~^~
In file included from /usr/include/qt6/QtCore/QVariant:1,
                 from /home/mb/src/other/qcad/src/entity/../../src/core/RS.h:29,
                 from /home/mb/src/other/qcad/src/entity/../../src/core/math/RVector.h:29,
                 from /home/mb/src/other/qcad/src/entity/../../src/core/math/RBox.h:28,
                 from /home/mb/src/other/qcad/src/entity/../../src/core/REntity.h:27,
                 from /home/mb/src/other/qcad/src/entity/../../src/core/RBlockReferenceEntity.h:25,
                 from /home/mb/src/other/qcad/src/entity/RDimensionEntity.cpp:19:
/usr/include/qt6/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
[429/508] Building CXX object src/gui/CMakeFiles/qcadgui.dir/RCharacterWidget.cpp.o
/home/mb/src/other/qcad/src/gui/RCharacterWidget.cpp: In member function ‘virtual void RCharacterWidget::mouseMoveEvent(QMouseEvent*)’:
/home/mb/src/other/qcad/src/gui/RCharacterWidget.cpp:76:59: warning: ‘QPoint QMouseEvent::globalPos() const’ is deprecated: Use globalPosition() [-Wdeprecated-declarations]
   76 |     QPoint widgetPosition = mapFromGlobal(event->globalPos());
      |                                           ~~~~~~~~~~~~~~~~^~
In file included from /usr/include/qt6/QtGui/QMouseEvent:1,
                 from /home/mb/src/other/qcad/src/gui/RCharacterWidget.cpp:20:
/usr/include/qt6/QtGui/qevent.h:225:19: note: declared here
  225 |     inline QPoint globalPos() const { return globalPosition().toPoint(); }
      |                   ^~~~~~~~~
/home/mb/src/other/qcad/src/gui/RCharacterWidget.cpp:85:40: warning: ‘QPoint QMouseEvent::globalPos() const’ is deprecated: Use globalPosition() [-Wdeprecated-declarations]
   85 |     QToolTip::showText(event->globalPos(), text, this);
      |                        ~~~~~~~~~~~~~~~~^~
/usr/include/qt6/QtGui/qevent.h:225:19: note: declared here
  225 |     inline QPoint globalPos() const { return globalPosition().toPoint(); }
      |                   ^~~~~~~~~
/home/mb/src/other/qcad/src/gui/RCharacterWidget.cpp: In member function ‘virtual void RCharacterWidget::mousePressEvent(QMouseEvent*)’:
/home/mb/src/other/qcad/src/gui/RCharacterWidget.cpp:90:28: warning: ‘int QMouseEvent::y() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   90 |         lastKey = (event->y() / squareSize) * columns + event->x() / squareSize;
      |                    ~~~~~~~~^~
/usr/include/qt6/QtGui/qevent.h:229:16: note: declared here
  229 |     inline int y() const { return qRound(position().y()); }
      |                ^
/home/mb/src/other/qcad/src/gui/RCharacterWidget.cpp:90:65: warning: ‘int QMouseEvent::x() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   90 |         lastKey = (event->y() / squareSize) * columns + event->x() / squareSize;
      |                                                         ~~~~~~~~^~
/usr/include/qt6/QtGui/qevent.h:227:16: note: declared here
  227 |     inline int x() const { return qRound(position().x()); }
      |                ^
[460/508] Building CXX object src/gui/CMakeFiles/qcadgui.dir/RListWidget.cpp.o
/home/mb/src/other/qcad/src/gui/RListWidget.cpp: In member function ‘virtual void RListWidget::mousePressEvent(QMouseEvent*)’:
/home/mb/src/other/qcad/src/gui/RListWidget.cpp:57:13: warning: ‘int QMouseEvent::x() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   57 |     if (e->x()-iconOffset < iconSize().width()) {
      |         ~~~~^~
In file included from /usr/include/qt6/QtGui/QContextMenuEvent:1,
                 from /home/mb/src/other/qcad/src/gui/RListWidget.cpp:22:
/usr/include/qt6/QtGui/qevent.h:227:16: note: declared here
  227 |     inline int x() const { return qRound(position().x()); }
      |                ^
/home/mb/src/other/qcad/src/gui/RListWidget.cpp: In member function ‘virtual void RListWidget::mouseReleaseEvent(QMouseEvent*)’:
/home/mb/src/other/qcad/src/gui/RListWidget.cpp:66:13: warning: ‘int QMouseEvent::x() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   66 |     if (e->x()-iconOffset < iconSize().width()) {
      |         ~~~~^~
/usr/include/qt6/QtGui/qevent.h:227:16: note: declared here
  227 |     inline int x() const { return qRound(position().x()); }
      |                ^
/home/mb/src/other/qcad/src/gui/RListWidget.cpp:69:34: warning: ‘int QMouseEvent::x() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   69 |             emit iconClicked(e->x()-iconOffset, item);
      |                              ~~~~^~
/usr/include/qt6/QtGui/qevent.h:227:16: note: declared here
  227 |     inline int x() const { return qRound(position().x()); }
      |                ^
/home/mb/src/other/qcad/src/gui/RListWidget.cpp: In member function ‘virtual void RListWidget::mouseMoveEvent(QMouseEvent*)’:
/home/mb/src/other/qcad/src/gui/RListWidget.cpp:78:13: warning: ‘int QMouseEvent::x() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   78 |     if (e->x()-iconOffset < iconSize().width()) {
      |         ~~~~^~
/usr/include/qt6/QtGui/qevent.h:227:16: note: declared here
  227 |     inline int x() const { return qRound(position().x()); }
      |                ^
[466/508] Building CXX object src/gui/CMakeFiles/qcadgui.dir/RGraphicsSceneQt.cpp.o
/home/mb/src/other/qcad/src/gui/RGraphicsSceneQt.cpp: In member function ‘virtual double RGraphicsSceneQt::getLineTypePatternScale(const RLinetypePattern&) const’:
/home/mb/src/other/qcad/src/gui/RGraphicsSceneQt.cpp:926:68: warning: ‘bool QVariant::canConvert(int) const’ is deprecated [-Wdeprecated-declarations]
  926 |             if (!scaleVariant.isValid() || !scaleVariant.canConvert(QVariant::String)) {
      |                                             ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/QVariant:1,
                 from /home/mb/src/other/qcad/src/gui/../../src/core/RS.h:29,
                 from /home/mb/src/other/qcad/src/gui/../../src/core/math/RMath.h:25,
                 from /home/mb/src/other/qcad/src/gui/../../src/core/math/RShape.h:28,
                 from /home/mb/src/other/qcad/src/gui/../../src/core/math/RArc.h:25,
                 from /home/mb/src/other/qcad/src/gui/RGraphicsSceneQt.cpp:26:
/usr/include/qt6/QtCore/qvariant.h:354:10: note: declared here
  354 |     bool canConvert(int targetTypeId) const
      |          ^~~~~~~~~~
[504/508] Building CXX object src/run/CMakeFiles/qcad.dir/main.cpp.o
/home/mb/src/other/qcad/src/run/main.cpp: In function ‘int main(int, char**)’:
/home/mb/src/other/qcad/src/run/main.cpp:184:44: warning: ‘Qt::AA_EnableHighDpiScaling’ is deprecated: High-DPI scaling is always enabled. This attribute no longer has any effect. [-Wdeprecated-declarations]
  184 |         QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qbytearray.h:9,
                 from /usr/include/qt6/QtCore/qstringview.h:10,
                 from /usr/include/qt6/QtCore/qchar.h:660,
                 from /usr/include/qt6/QtCore/qstring.h:14,
                 from /usr/include/qt6/QtCore/qcoreapplication.h:8,
                 from /usr/include/qt6/QtWidgets/qapplication.h:8,
                 from /usr/include/qt6/QtWidgets/QApplication:1,
                 from /home/mb/src/other/qcad/src/run/main.cpp:21:
/usr/include/qt6/QtCore/qnamespace.h:451:9: note: declared here
  451 |         AA_EnableHighDpiScaling Q_DECL_ENUMERATOR_DEPRECATED_X(
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/home/mb/src/other/qcad/src/run/main.cpp:187:44: warning: ‘Qt::AA_EnableHighDpiScaling’ is deprecated: High-DPI scaling is always enabled. This attribute no longer has any effect. [-Wdeprecated-declarations]
  187 |         QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, false);
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/qt6/QtCore/qnamespace.h:451:9: note: declared here
  451 |         AA_EnableHighDpiScaling Q_DECL_ENUMERATOR_DEPRECATED_X(
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/home/mb/src/other/qcad/src/run/main.cpp:211:40: warning: ‘Qt::AA_UseHighDpiPixmaps’ is deprecated: High-DPI pixmaps are always enabled. This attribute no longer has any effect. [-Wdeprecated-declarations]
  211 |     QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
      |                                        ^~~~~~~~~~~~~~~~~~~~
/usr/include/qt6/QtCore/qnamespace.h:440:9: note: declared here
  440 |         AA_UseHighDpiPixmaps Q_DECL_ENUMERATOR_DEPRECATED_X(
      |         ^~~~~~~~~~~~~~~~~~~~
[506/508] Building CXX object src/io/dxf/CMakeFiles/qcaddxf.dir/RDxfImporter.cpp.o
/home/mb/src/other/qcad/src/io/dxf/RDxfImporter.cpp: In member function ‘virtual void RDxfImporter::addImage(const DL_ImageData&)’:
/home/mb/src/other/qcad/src/io/dxf/RDxfImporter.cpp:1404:23: warning: ‘QMultiMap<Key, T>::iterator QMultiMap<Key, T>::insertMulti(const Key&, const T&) [with Key = int; T = int]’ is deprecated: Use insert() instead [-Wdeprecated-declarations]
 1404 |     images.insertMulti(handle, entity->getId());
      |     ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qdebug.h:33,
                 from /usr/include/qt6/QtCore/qvariant.h:12,
                 from /usr/include/qt6/QtCore/qlocale.h:7,
                 from /usr/include/qt6/QtCore/qcalendar.h:10,
                 from /usr/include/qt6/QtCore/qdatetime.h:8,
                 from /usr/include/qt6/QtCore/qfileinfo.h:12,
                 from /usr/include/qt6/QtCore/QFileInfo:1,
                 from /home/mb/src/other/qcad/src/io/dxf/RDxfImporter.cpp:20:
/usr/include/qt6/QtCore/qmap.h:1482:14: note: declared here
 1482 |     iterator insertMulti(const Key &key, const T &value)
      |              ^~~~~~~~~~~
[508/508] Linking CXX shared library plugins/libqcaddxf.so

$ release/qcad-bin
QCAD version  3.32.2
enable high dpi scaling
21:18:40: Debug:    loading plugins...
21:18:40: Debug:    loading static plugins...
Warning:  No script handler found...
Warning:  QThreadStorage: Thread 0x5630f65cf310 exited after QThreadStorage 1 destroyed

Re: Building on Gentoo with recent Qt

Posted: Sun Apr 13, 2025 2:54 am
by CVH
massimo wrote:
Sat Apr 12, 2025 6:45 pm
As most distributions have dropped Qt5 and switched to Qt6, this is the way to go with system dependencies.
What is there against installing a recent trial version and removing the Pro Addons?
Currently that includes Qt5 and if that is dropped by Linux distributions doesn't matter at all.

Regards,
CVH

Re: Building on Gentoo with recent Qt

Posted: Sun Apr 13, 2025 6:28 am
by massimo
Sure, that works.
Then it's just an academic question about how to do a custom build.

Re: Building on Gentoo with recent Qt

Posted: Tue May 13, 2025 7:28 pm
by nagmat84
I get the exact same error. Compilation with QT6 works fine, but then qcad exists with

Code: Select all

 ./qcad-bin
QCAD version  3.32.2
20:23:17: Debug:    loading plugins...
20:23:17: Debug:    loading static plugins...
Warning:  No script handler found...
Warning:  QThreadStorage: Thread 0x563f502945e0 exited after QThreadStorage 9 destroyed
Warning:  QThreadStorage: Thread 0x563f502945e0 exited after QThreadStorage 8 destroyed
Warning:  QThreadStorage: Thread 0x563f502945e0 exited after QThreadStorage 6 destroyed
Warning:  QThreadStorage: Thread 0x563f502945e0 exited after QThreadStorage 1 destroyed
However in this response to "Compiling Qcad with QT6 under Linux" the user Matfie implies that it should work.

Re: Building on Gentoo with recent Qt

Posted: Thu May 15, 2025 12:48 pm
by nagmat84
I was able to make some progress, but I am not yet finally there. The important thing is that with Qt6, the projects QtJsApi/ and QCadJsApi are mandatory. Those projects are mentioned in Compiling QCAD from Sources, Sec. "Checking out the QCAD Sources", but there is no further explanation what to do about them. :roll:

QCad needs a JS interpreter as the actual program logic and even the start-up code is written in Typescript. Without a JS interpreter QCad simply does nothing, but terminates again, which yields the messages we all have seen. Qt5 has its own JS interpreter, Qt6 has not and hence the additional projects are needed. If you have a close look at main.cpp, there is no single code line which calls "exec" on the RSingleApplication object which inherits QApplication. Instead the code relies on the RScriptHandler which executes autostart.js. Without autostart.js being executed nothing happens. :roll:

Preliminary remarks before building:
  • The CMakeLists.txt unfortunately use some hard-coded paths, hence unless you want to spend a lot of time on patching CMakeLists.txt, the following assumptions must be followed:
    • The projects must reside in the directories qcad, qtjsapi, qcadjsapi within the same parent directory.
    • You must use an in-tree build, not an out-of-tree build as otherwise the linking step files
  • There is a bug in qcadjsapi:generator/cpp/rarc_wrapper.cpp:288: RArc::createTangential only needs 4 not 5 arguments, so remove the 5th argument (simply delete line 288).
Creating a debug build:

Code: Select all

# Clone all projects, see preliminary remarks
git clone https://github.com/qcad/qcad.git qcad
git clone [email protected]:qcad/qtjsapi.git qtjsapi
git clone [email protected]:qcad/qcadjsapi.git qcadjsapi

# Configure qcad for an in-tree build, see preliminary remarks
cd qcad
cmake -DBUILD_QT6=ON -DCMAKE_BUILD_TYPE=Debug -G Ninja .
cd ..

# Configure qtjsapi for an in-tree build, this requires that qcad is located in ../qcad
cd qtjsapi
cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja .
cd ..

# Configure qcadjsapi for an in-tree build, this requires that qcad is located in ../qcad
cd qcadjsapi
cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja .
cd ..

# Patch the bug in qcadjsapi, see preliminary remarks what needs to be patched

# Build qcad
cd qcad
ninja
cd ..

# Build qtjsapi
cd qtjsapi
ninja
cd ..

# Build qcadjsapi
cd qcadjsapi
ninja
cd ..

# If you made a debug build (as I did), rename libqcadjsapi.so
# The build script for QCadJsApi doesn't do it and without renaming QCad doesn't load it
cd qcad/plugins
mv libqcadjsapi.so libqcadjsapi_debug.so
cd ../..
If you run QCad "./qcad/debug/qcad-bin" now, you will see a lot of more messages and even the splash screen appears shortly. However, there is still a bug which I wasn't able to figure out:

Code: Select all

$ ./qcad/debug/qcad-bin

QCAD version  3.32.2
qcad/src/core/RPluginLoader.cpp:138, static void RPluginLoader::loadPlugins(bool):
Debug:    loading plugins...
qcadjsapi/RJSApiPlugin.cpp:10, virtual bool RJSApiPlugin::init():
Debug:    RJSApiPlugin::init
qcad/src/core/RPluginLoader.cpp:200, static void RPluginLoader::loadPlugins(bool):
Debug:    loading static plugins...
qcadjsapi/RScriptHandlerJs.cpp:605, virtual void RScriptHandlerJs::init(bool):
Debug:    RScriptHandlerJs::init
qtjsapi/generator/cpp/qnamespace_wrapper.cpp:578, static void Qt_Wrapper::init(RJSApi&):
Debug:    Evaluating file:  ":generator/js/Qt.js"
qtjsapi/generator/cpp/qcoreapplication_wrapper.cpp:1606, static void QCoreApplication_Wrapper::init(RJSApi&):

... repeated dozens of times for each evaluated JS file ...

Debug:    Evaluating file:  ":generator/js/RStemmer.js"
qcadjsapi/RScriptHandlerJs.cpp:1180, virtual void RScriptHandlerJs::init(bool):
Debug:    auto load files: QList()
qcad/src/run/main.cpp:423, int main(int, char**):
Warning:  using custom script handler from plugin
Warning:  Unimplemented code.

... repeated multiple times ...

Warning:  Unimplemented code.
Warning:  "QFormBuilder was unable to create a custom widget of the class 'RTextEdit'; defaulting to base class 'QTextBrowser'."
Warning:  "QFormBuilder was unable to create a custom widget of the class 'RCommandLine'; defaulting to base class 'QLineEdit'."
qcadjsapi/RScriptHandlerJs.cpp:1253, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  Uncaught exception in: "scripts/autostart.js"
qcadjsapi/RScriptHandlerJs.cpp:1254, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  Exception: "TypeError: Cannot call method 'connect' of undefined"
qcadjsapi/RScriptHandlerJs.cpp:1256, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  ":271:-1:file:scripts/Widgets/CommandLine/CommandLine.js"
qcadjsapi/RScriptHandlerJs.cpp:1256, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  ":119:-1:file:AddOn.js"
qcadjsapi/RScriptHandlerJs.cpp:1256, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  ":55:-1:file:AddOn.js"
qcadjsapi/RScriptHandlerJs.cpp:1256, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  "initAddOns:301:-1:file:scripts/autostart.js"
qcadjsapi/RScriptHandlerJs.cpp:1256, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  "main:598:-1:file:scripts/autostart.js"
qcadjsapi/RScriptHandlerJs.cpp:1256, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  "%entry:746:-1:file:scripts/autostart.js"
qcadjsapi/RScriptHandlerJs.cpp:543, virtual RScriptHandlerJs::~RScriptHandlerJs():
Debug:    RScriptHandlerJs::~RScriptHandlerJs
qcadjsapi/RScriptHandlerJs.cpp:552, virtual RScriptHandlerJs::~RScriptHandlerJs():
Debug:    collect garbage...
qcadjsapi/RScriptHandlerJs.cpp:555, virtual RScriptHandlerJs::~RScriptHandlerJs():
Debug:    collect garbage: DONE
qcad/src/core/RDebug.cpp:157, static void RDebug::printCounters(const QString&):
Debug:    "" counter:  "RAction" :  121
qcad/src/core/RDebug.cpp:157, static void RDebug::printCounters(const QString&):
Debug:    "" counter:  "RGraphicsView" :  1
qcadjsapi/RScriptHandlerJs.cpp:564, virtual RScriptHandlerJs::~RScriptHandlerJs():
Debug:    "deleting wrappers (E0): " 0
qcadjsapi/RScriptHandlerJs.cpp:579, virtual RScriptHandlerJs::~RScriptHandlerJs():
Debug:    deleting wrappers: DONE
qcadjsapi/RScriptHandlerJs.cpp:581, virtual RScriptHandlerJs::~RScriptHandlerJs():
Debug:    collect garbage...
qcadjsapi/RScriptHandlerJs.cpp:587, virtual RScriptHandlerJs::~RScriptHandlerJs():
Debug:    collect garbage: DONE
qtjsapi/RJSApi.cpp:177, virtual RJSApi::~RJSApi():
Debug:    collect garbage...
qtjsapi/RJSApi.cpp:179, virtual RJSApi::~RJSApi():
Debug:    collect garbage: DONE
qtjsapi/RJSApi.cpp:182, virtual RJSApi::~RJSApi():
Debug:    "deleting wrappers (E0): " 919
qtjsapi/RJSApi.cpp:199, virtual RJSApi::~RJSApi():
Debug:    deleting wrappers: DONE
qtjsapi/RJSApi.cpp:201, virtual RJSApi::~RJSApi():
Debug:    collect garbage...
qtjsapi/RJSApi.cpp:205, virtual RJSApi::~RJSApi():
Debug:    collect garbage: DONE
qcadjsapi/RScriptHandlerJs.cpp:591, virtual RScriptHandlerJs::~RScriptHandlerJs():
Debug:    delete engine: 93888073617680 ...
qcadjsapi/RScriptHandlerJs.cpp:594, virtual RScriptHandlerJs::~RScriptHandlerJs():
Debug:    delete engine: 0  DONE
Warning:  QThreadStorage: entry 10 destroyed before end of thread 0x5564050a9310
Warning:  QThreadStorage: entry 9 destroyed before end of thread 0x5564050a9310
Warning:  QThreadStorage: entry 8 destroyed before end of thread 0x5564050a9310
Warning:  QThreadStorage: entry 2 destroyed before end of thread 0x5564050a9310
Warning:  QThreadStorage: entry 1 destroyed before end of thread 0x5564050a9310
The important part is

Code: Select all

qcadjsapi/RScriptHandlerJs.cpp:1253, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  Uncaught exception in: "scripts/autostart.js"
qcadjsapi/RScriptHandlerJs.cpp:1254, virtual void RScriptHandlerJs::doScript(const QString&, const QStringList&):
Warning:  Exception: "TypeError: Cannot call method 'connect' of undefined"
The script file fails and unfortunately there is no easy way for me to debug this as QCad itself interprets "autostart.js". So GDB is of now help here, because it is not inside the C++ code. The error message also does not indicated which line of autostart.js is the broken one.

Re: Building on Gentoo with recent Qt

Posted: Thu May 15, 2025 1:11 pm
by CVH
Not going into details of building QCAD from sources because I use a standard installation and simply won't get involved. :wink:
nagmat84 wrote:
Thu May 15, 2025 12:48 pm
RArc::createTangential only needs 4 not 5 arguments
That is a very recent update, see Commit b0c6b26 intended to have a variable radius depending on the endpoint.
Probably to enhance ArcTangential.js but it is not really used (next commit).

I think that you need to use the latest stable release for building.


In 2023 I posted an enhancement of ArcTangential.js that reverted to auto with an invalid radius.
It was never adopted.
Recently something similar popped up for drawing polylines.
I see this as how Andrew is going to support a variable radius for tangentially connected Arcs.

Regards,
CVH

Re: Building on Gentoo with recent Qt

Posted: Thu May 15, 2025 1:46 pm
by nagmat84
Right. The errors only exist in the HEAD of the master branches. If one clones the latest tagged version, everythings works on Gentoo with Qt6 :D Here are all commands for a Release build:

Code: Select all

git clone --depth 1 --branch v3.32.2.0 [email protected]:qcad/qcad.git
git clone --depth 1 --branch v3.32.2.0 [email protected]:qcad/qtjsapi.git
git clone --depth 1 --branch v3.32.2.0 [email protected]:qcad/qcadjsapi.git

cd qcad
cmake -DBUILD_QT6=ON -DCMAKE_BUILD_TYPE=Release -G Ninja .
cd ..

cd qtjsapi
cmake -DCMAKE_BUILD_TYPE=Release -G Ninja .
cd ..

cd qcadjsapi
cmake -DCMAKE_BUILD_TYPE=Release -G Ninja .
cd ..

cd qcad
ninja
cd ..

cd qtjsapi
ninja
cd ..

cd qcadjsapi
ninja
cd ..
Just fo be saved, the important remarks again:
  1. The project directories must be "qcad", "qtjsapi" and "qcadjsapi" and reside in the same parent directory.
  2. Only an in-tree build is supported.
Then run QCad with

Code: Select all

./qcad/release/qcad-bin
Next step is to write an ebuild.