1

Topic: SOLVED: Qt Creator, Qt6 cannot find headers from IDE

Hello everybody,

I have a strange phenomenon, that I would like to understand and get rid of...

There is a fresh installed Debian unstable with QET-Sources from github-branch "qt6-cmake".
From commandline everything compiles fine from cmake, qmake and make.

But sometimes it is much more comfortable to use an IDE to edit sourcefiles and start compilation by clicking a button.

So I installed Qt Creator 15.0.1 based on Qt 6.7.2 (GCC 14.2.0, x86_64) on top of it, imported the QET-codestyle-settings and clicked "compile".
And that's where the phenomenon comes to light: It won't compile, because some header-files cannot be found, see also attachment.

To remember: Everything compiles fine from commandline, so all headers are on the system:

$ dpkg -l | grep libkf6 | grep addons-dev
ii  libkf6coreaddons-dev:amd64  6.11.0-1  amd64  KDE Frameworks 6 addons to QtCore - development files
ii  libkf6widgetsaddons-dev     6.11.0-1  amd64  development files for kwidgetsaddons
$

So there is a setting in Qt-Creator that has to be adjusted to be able to compile from IDE, but I don't see it!

Is there someone who can help "cleaning my glasses"???

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

2

Re: SOLVED: Qt Creator, Qt6 cannot find headers from IDE

Hallo plc-user

not the same thing like you, Cmake don't found KF6 dev addons installed by apt, so

--- cmake/define_definitions.cmake
+++ cmake/define_definitions.cmake
@@ -65,7 +65,7 @@ message("GIT_COMMIT_SHA            :" ${GIT_COMMIT_SHA})
 if(BUILD_WITH_KF6 AND BUILD_KF6)
   message("KF6_GIT_TAG               :" ${KF6_GIT_TAG})
 else()
-  add_definitions(-DBUILD_WITHOUT_KF6)
+#  add_definitions(-DBUILD_WITHOUT_KF6)
 endif()
 message("QET_COMPONENTS            :" ${QET_COMPONENTS})
 message("Qt version                :" ${Qt6_VERSION})

laurent@debian:~/qet_qt6_cmake/build/Desktop-Debug$ cat CMakeCache.txt | grep KF6
//Build KF6 libraries, use system ones otherwise
BUILD_KF6:BOOL=OFF
//Build with KF6
BUILD_WITH_KF6:BOOL=ON
//The directory containing a CMake configuration file for KF6CoreAddons.
KF6CoreAddons_DIR:PATH=/usr/lib/x86_64-linux-gnu/cmake/KF6CoreAddons
//The directory containing a CMake configuration file for KF6WidgetsAddons.
KF6WidgetsAddons_DIR:PATH=/usr/lib/x86_64-linux-gnu/cmake/KF6WidgetsAddons
[13:28:38] laurent@debian:~/qet_qt6_cmake/build/Desktop-Debug$ 

mising pkg-config?

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

3

Re: SOLVED: Qt Creator, Qt6 cannot find headers from IDE

Salut Laurent !

Thanks for your hint, but: Was already installed.

$ dpkg -l | grep pkg-config
ii  pkg-config:amd64   1.8.1-4  amd64  manage compile and link flags for libraries (transitional package)
$

Package will be replaced in (near) future:

$ apt-cache search pkg-config
pkgconf-bin - Verwaltung der Compiler- und Linker-Schalter für Bibliotheken (Programm
pkg-config - Verwaltung der Compiler- und Linker-Schalter für Bibliotheken (Übergangspaket)
pkgconf - Verwaltung der Compiler- und Linker-Schalter für Bibliotheken
$

In the meantime I could manage to compile QET-Sources, with the help of Qt-Creator:
I adjusted the settings for make-command in build-settings.
It feels a bit strange, as there is a message with an exclamation-mark that says that the build will be overwritten and the text in edit-field for build-dir is marked red...
But it compiles and I could already solve some more of the "#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)" - things! nomicons/smile

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

4

Re: SOLVED: Qt Creator, Qt6 cannot find headers from IDE

I found a better solution for using KF6CoreAddons and KF6WidgetsAddons from distribution-packages!

In my local qelectrotech.pro I added these lines to global part, so that the include-files can be found:

INCLUDEPATH += /usr/include/KF6/KCoreAddons
INCLUDEPATH += /usr/include/KF6/KWidgetsAddons

The linker needs the information, where to find the libs, so I added these lines to the "unix"-section:

LIBS += /usr/lib/x86_64-linux-gnu/libKF6CoreAddons.so
LIBS += /usr/lib/x86_64-linux-gnu/libKF6WidgetsAddons.so

Now everything compiles and links fine without exclamation-marks or red texts in edit-lines in Qt-Creator!

This info might help someone install and use Qt-Creator on Linux to help develop QElectroTech!

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

5

Re: SOLVED: Qt Creator, Qt6 cannot find headers from IDE

Hello plc-user and Laurent, I think the KF6-addons mostly create problems with compiling (and maybe packaging?).

I just created a pull request to qt6-cmake with new minimal classes to replace KColorButton and KColorCombo from KWidgetsAddons. Compiles and runs fine here without the use of KWidgetsAddons, feel free to try it out.

If there is interest for it, I can look at replacing KAutoSaveFile from KCoreAddons (when time allows me) which I believe is the last class used from the KF6 addons.

6

Re: SOLVED: Qt Creator, Qt6 cannot find headers from IDE

In my opinion, it would be a great improvement if we could get rid of these two! It seems that QET is the only project that uses these two libraries and they keep causing problems when using Qt-Creator. When searching the web for these two libraries it always comes back to the same results in this forum...

I will try your solution later and report back

EDIT:
As far as I can see, the code for ColorButton and ColorComboBox works fine and I could eliminate KWidgetsAddons from includes and libs!

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

7

Re: SOLVED: Qt Creator, Qt6 cannot find headers from IDE

Very nice! I'll try to work on a replacement for KAutoSaveFile when time allows, hopefully it will make it easier to continue develop QET. I don't use Qt Creator myself, but it's probably an easier way to get into development of QET. So if it helps with Qt Creator I'll definitely try to do it!

I just can't understand why those classes, especially the color button / combo box, are not implemented in Qt itself.

8

Re: SOLVED: Qt Creator, Qt6 cannot find headers from IDE

@elevatormind:

elevatormind wrote:

I'll try to work on a replacement for KAutoSaveFile (...)

Just noticed this warning:

QMetaObject::connectSlotsByName: No matching signal for on_m_color_kpb_changed(QColor)

and when searching for the slot/signal it returns this file:

sources/editor/ui/dynamictextfieldeditor.cpp

with this function:

void DynamicTextFieldEditor::setupWidget()
{
    m_color_kpb = new ColorButton(this);
    m_color_kpb->setObjectName(QString::fromUtf8("m_color_kpb"));

    connect(m_color_kpb, &ColorButton::changed,
            this, &DynamicTextFieldEditor::on_m_color_kpb_changed);

    ui->m_main_grid_layout->addWidget(m_color_kpb, 6, 1, 1, 2);
}

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

9 (edited by plc-user 2025-03-28 21:31:46)

Re: SOLVED: Qt Creator, Qt6 cannot find headers from IDE

plc-user wrote:

Just noticed this warning:

QMetaObject::connectSlotsByName: No matching signal for on_m_color_kpb_changed(QColor)

Fixed this and one other broken signal in current qt6-make - branch!


EDIT:
This signal was already broken in master-branch: Fixed there, too!

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !