Visitar URL original
Build & generator cleanup: drop Qt5 wrapper fallbacks, switch CI to Qt 6.10, normalize macOS includes, add qmake toggles, and regenerate wrappers in CI by hjmjohnson · Pull Request #313 · MeVisLab/pythonqt · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(generator): normalize macOS framework includes to bare Qt headers
Follow-up of 19738be ("feat(generator): discover Qt include/framework
paths dynamically; add PYTHONQT_FRAMEWORK", 2025-09-18).

On macOS, headers parsed from framework paths like:
  .../QtCore.framework/Headers/qbytearray.h
  .../QtCore.framework/Versions/A/Headers/qbytearray.h
were emitted as relative framework paths.

Update `AbstractMetaBuilder::getRelativeInclude()` to detect both layouts
and emit only the basename (e.g., `<qbytearray.h>`).
  • Loading branch information
jcfr committed Sep 28, 2025
commit dfeadb60e15939fd4219f0c78b570554d4609d86
17 changes: 17 additions & 0 deletions generator/abstractmetabuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include <QtCore/QTextStream>
#include <QtCore/QVariant>
#include <QtCore/QDir>
#include <QtCore/QRegularExpression>

static QString strip_template_args(const QString &name)
{
Expand Down Expand Up @@ -416,6 +417,22 @@ AbstractMetaClass* AbstractMetaBuilder::getGlobalNamespace(const TypeEntry* type

Include AbstractMetaBuilder::getRelativeInclude(const QString& path)
{
#ifdef Q_OS_MACOS
// If the parsed header lives inside a macOS framework bundle, emit just the
// bare header name (e.g., "qbytearray.h") so generators will produce <...>.
//
// Match both:
// .../QtCore.framework/Headers/...
// .../QtCore.framework/Versions/<X>/Headers/...
static const QRegularExpression fwHeadersRe(
QStringLiteral(R"(\.framework/(Versions/[^/]+/)?Headers/)")
);
if (fwHeadersRe.match(path).hasMatch()) {
const QString base = QFileInfo(path).fileName(); // e.g., "qbytearray.h"
return Include(Include::IncludePath, base); // choose <> style
}
#endif

QString bestRelativePath;
int bestNumDirectories = 0;
// find the shortest relative path relative to all given include directories
Expand Down
Loading