这是indexloc提供的服务,不要输入任何密码
Skip to content

Ensure QDebug is included for all qDebug uses #1912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

musicinmybrain
Copy link
Contributor

Ensure each file that uses qDebug (not commented out) has a direct include of the QDebug header.

When cherry-picked to v0.7.0, this fixed Fedora’s Pencil2D package failing to build with Qt 6.9 where the implicit/indirect includes have changed from 6.8:

src/soundplayer.cpp: In lambda function:
src/soundplayer.cpp:123:15: error: invalid use of incomplete type ‘class QDebug’
  123 |         qDebug() << "MediaPlayer Error: " << err;
In file included from /usr/include/qt6/QtCore/qglobal.h:45,
                 from /usr/include/qt6/QtCore/qnamespace.h:12,
                 from /usr/include/qt6/QtCore/qobjectdefs.h:12,
                 from /usr/include/qt6/QtCore/qobject.h:10,
                 from /usr/include/qt6/QtCore/QObject:1,
                 from src/corelib-pch.h:7:
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~
src/soundplayer.cpp: In lambda function:
src/soundplayer.cpp:128:15: error: invalid use of incomplete type ‘class QDebug’
  128 |         qDebug() << "MediaPlayer durationChanged :" << duration;
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~

Technically, the QDebug header is the appropriate include for the QDebug class, but we should #include <QtLogging> for the qDebug macro. I didn’t make that change here since there is currently no direct use of the QtLogging header in Pencil2D, but it wouldn’t be a bad follow-up idea.

Ensure each file that uses qDebug (not commented out) has a direct
include of the QDebug header.
@MrStevns MrStevns merged commit 18d877a into pencil2d:master Apr 16, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Merged in Pull Request Priority Apr 16, 2025
@MrStevns
Copy link
Member

Thanks for fixing that 👍

MrStevns pushed a commit to MrStevns/pencil that referenced this pull request Jun 4, 2025
Ensure each file that uses qDebug (not commented out) has a direct
include of the QDebug header.
@chchwy chchwy mentioned this pull request Jun 19, 2025
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants