Logo
3 min read
← All Insights

Migration · Qt5 → Qt6

Migrating from Qt5 to Qt6 — what really happens

Qt6 has been available since 2020. Qt5 is reaching end-of-life. The migration sounds simple — "just API changes". In practice it is an architecture project.

Qt Group calls it a "simple migration path". Every team that has migrated says something else. Not because Qt6 is bad — but because Qt5 projects have accumulated 5-10 years of technical debt, and the migration exposes it mercilessly.

We have accompanied several migrations. The patterns repeat: an underestimated build-system rebuild, ignored deprecation warnings, missing tests. The actual API migration is rarely the problem.

What has really changed

Breaking changes that matter in practice:

  • QList is now QVector — memory behaviour changes fundamentally
  • QRegExpQRegularExpression — completely new API, no drop-in replacement
  • QTextCodec removed — UTF-8 is the default, legacy encodings need their own solution
  • QML: import syntax changed, new property declarations with required
  • Direct OpenGL → RHI abstraction layer — GPU code has to be migrated
  • CMake instead of qmake — the build system has to be rebuilt completely
// Qt5: QRegExp
QRegExp rx("(\\d+)-(\\d+)");
if (rx.indexIn(input) != -1) {
    QString first = rx.cap(1);
}

// Qt6: QRegularExpression
QRegularExpression re("(\\d+)-(\\d+)");
auto match = re.match(input);
if (match.hasMatch()) {
    QString first = match.captured(1);
}
// Qt5 qmake
QT += core gui widgets
TARGET = myapp
SOURCES += main.cpp mainwindow.cpp

// Qt6 CMake
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
target_link_libraries(myapp PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets)
Qt Group says "simple migration". Every team that has migrated says something else. Not because Qt6 is bad — but because the migration exposes the technical debt of the last 5 years.

The hidden effort

  • Build-system migration (qmake → CMake): 20-40% of the total effort. Every target, every library, every custom build rule has to be translated. For projects with complex qmake logic this is a sub-project of its own.
  • Deprecated API cleanup: Qt5 had deprecated APIs that were removed in Qt6. If the compiler warnings were ignored for years, everything breaks at once now.
  • Third-party dependencies: Many Qt5 plugins and libraries have no Qt6 version. Find a replacement or port it yourself — both cost.
  • Testing: Every test has to run again after the migration. Rule of thumb: ~15% will fail, often in unexpected places.
  • QML migration: Import paths, property syntax, compiler integration. For large QML codebases a sub-project of its own.

Migration in practice — step by step

Phase 1: Preparation (2-4 weeks)

Update to Qt 5.15 LTS. Enable and fix all deprecation warnings. Introduce CMake alongside qmake so the build system is ready before the API migration starts. This phase is the one most often skipped — and it takes its revenge in phase 2.

Phase 2: Core migration (4-8 weeks)

Carry out the API changes: container types, regex, namespace adjustments. This is where the quality of the preparation shows. Projects with a clean layered architecture are done in 4 weeks. Monoliths need 8 or more.

Phase 3: UI migration (2-6 weeks)

Adjust QML import paths, RHI migration where OpenGL was used, widget adjustments. The RHI migration is the largest single item — anyone with custom OpenGL code has to rewrite it completely for Qt's Rendering Hardware Interface.

Phase 4: Testing and stabilisation (2-4 weeks)

Full test run, performance comparison Qt5 vs Qt6, regression fixes. Plan a buffer — the last 10% of the bugs take 30% of the time.

Cost and time frame

Real ranges from real projects — not marketing estimates:

  • Small project (<50k LOC): 4-8 weeks, EUR 15,000-30,000
  • Medium project (50-200k LOC): 8-16 weeks, EUR 30,000-70,000
  • Large project (>200k LOC): 16-32 weeks, EUR 70,000-150,000

The range within each category depends on the quality of the existing architecture. Well-structured code migrates at the lower end. Monolithic code at the upper end.

Example from practice

A medical-device manufacturer (IEC 62304 context): 180,000 lines of C++/Qt5, qmake build system, custom OpenGL renderer for 3D visualisation. Estimated migration time: 3 months. Actual migration time: 7 months. Main reason: the OpenGL → RHI migration and the build-system rebuild each took 50% more effort than estimated. Validation in the regulated environment came on top.

Trade-offs

  • Staying on Qt5: Risk: EOL security patches stop, no new features, shrinking community support. For regulated industries, missing security support becomes a compliance problem.
  • Migrating: Risk: cost, schedule overrun, regressions. But: afterwards the project stands on an actively maintained base with 10+ years of support.
  • Rewriting: Risk: significantly higher cost, but a clean architecture. Realistic only for projects whose architecture is so poor that migration costs more than a rebuild.

Recommendation: Migrate if <200k LOC and the architecture is acceptable. At >200k LOC with poor architecture, consider a partial rewrite — rebuild the modules with the largest technical debt, migrate the rest.

Further reading

Software architecture with the Qt framework

Qt's architecture layers and why the first two weeks decide everything.

AI costs in industry (German)

Concrete numbers for budget planning from real projects.

From the book: Chapter 7 — 70/30 as an architecture principle (PDF)

Sample chapter from "Forget Prompts. The 70/30 AI System" — free, no e-mail required.

Your AlpiType team
Landsberg am Lech · alpitype.de

Related articles

KI nutzen, ohne Daten in die Cloud zu schicken

On-premise KI: Wie Systeme vollständig lokal betrieben werden.

Sind Ihre Daten überhaupt für KI nutzbar?

Datenqualität prüfen, bevor Sie in KI investieren.

Was KI in einem realen Industrieprojekt kostet

Konkrete Zahlen, Phasen und ROI aus realen Projekten.

Not sure if this applies to your case?

We can check your setup in 2 weeks and tell you if AI is feasible.

Request feasibility audit →

Talk to an engineer

No sales team. You talk directly with one of our software architects about your specific problem. 30 minutes. Response within 24 hours.

Email: info@alpitype.com

LinkedIn: AlpiType

Anton Lytvynenko

Anton Lytvynenko

CEO, AlpiType

Our Story →