Migration & Deprecation Policy#
GTlab regularly evolves its API to improve usability, performance, and design. As part of this evolution, functions and types are phased out in a controlled way so module developers and library users can migrate smoothly.
This guide covers:
GTlab’s deprecation lifecycle,
Migration to GTlab 2.1,
Compiler and tooling support for migration.
Deprecation Lifecycle#
GTlab adheres to a two-step deprecation process:
An API is first marked as deprecated and remains available for a couple of releases, where it emits warnings.
In the removal release (for example 2.1 or 3.0), the API is removed.
This gives module developers multiple release cycles to update their code before breaking changes occur.
Deprecation Warnings#
When GTlab deprecates an API, users see warnings like:
warning: This deprecated function will be removed in GTlab version 2.1: Use newFunction instead
If your compiler or build settings suppress warnings by default, enable warnings so deprecation messages are visible early (see Compiler & Tooling Tips).
Migration to 2.1#
The main changes in GTlab 2.1 are:
GTlab 2.1 uses Qt6,
module CMake projects should follow the updated GTlab integration pattern,
selected deprecated APIs are removed.
This section is organized as follows:
Start with the migration release in 2.0.x.
Apply required API migrations.
Update Qt and CMake integration.
Validate your project before upgrading.
Quick Start#
Build with a GTlab 2.0.x migration release (starting at 2.0.12).
Resolve all deprecation warnings and replace deprecated APIs.
Migrate module CMake projects to the 2.0.12+/2.1 approach.
Upgrade to GTlab 2.1 only after the migration is complete.
Migration Release: 2.0.12#
Library versions in the 2.0.x series, starting with 2.0.12, are migration releases to prepare projects for GTlab 2.1.
During these releases:
Deprecated APIs remain available for compilation.
Using a deprecated API emits a compiler warning.
Warnings include a replacement suggestion and the planned removal version.
The build does not fail on deprecated API usage by default.
Required Code Changes#
Start with API migration. For every deprecated API listed below:
Identify all usages in your codebase.
Replace usages with the recommended alternatives.
Rebuild your project and verify warnings are gone.
Deprecated APIs Removed in 2.1#
The tables below list deprecated APIs relevant for migration to GTlab 2.1.
The value in Since is the first released git tag in this repository that already contains the deprecation marker.
Dataprocessor-Library Deprecations#
API |
Since |
Replacement / Notes |
|---|---|---|
|
2.0.5 |
Use |
Global |
2.0.0 |
Use |
Global |
2.0.0 |
Use |
Core-Library Deprecations#
API |
Since |
Replacement / Notes |
|---|---|---|
|
2.0.6 |
Use |
|
2.0.11 |
Use |
|
2.0.0 |
Use |
|
2.0.0 |
Use |
|
2.0.0 |
Use |
Gui-Library Deprecations#
API |
Since |
Replacement / Notes |
|---|---|---|
|
2.0.0 |
addSingleAction(actionText, actionMethod)
.setIcon(...)
.setShortcut(...)
...
|
|
2.0.0 |
addActionGroup(groupname)
<< makeSingleAction(...)
<< makeSingleAction(...);
|
|
2.0.0 |
addConfigAction(actionText, actionMethod)
.setIcon(...)
.setVerificationMethod(...)
|
|
2.0.0 |
Set action properties using dedicated setters ( |
|
2.0.0 |
Use |
|
2.0.0 |
Use |
|
2.0.0 |
Use |
Some colors in |
2.0.0 |
See |
Icons with size prefix in |
2.0.0 |
Use the icon name without size prefix, e.g. |
Outdated stylesheets in |
2.0.0 |
See |
|
2.0.0 |
Replace with |
|
2.0.0 |
Replace with |
Qt6 Migration#
Replace direct
find_package(Qt5 ...)/find_package(Qt6 ...)withrequire_qt(COMPONENTS ...).require_qtselects the Qt major version GTlab was compiled with.For GTlab 2.1, this means Qt 6.
Link Qt libraries with version-agnostic targets such as
Qt${QT_VERSION_MAJOR}::Core.See CMake migration example for a complete CMake example.
Regex API note: Prefer gt::rex::* over the deprecated gt::re::*
regular-expression helpers; gt::rex is Qt6-compatible.
gt::re::* will be removed in GTlab 2.2.
CMake Project Migration for Modules#
In GTlab 2.0, module projects often copied GTlab.cmake from the GTlab
source tree and included it manually.
Starting with the 2.0.12 migration release, GTlab.cmake is provided by the
installed GTlab package and loaded automatically after:
find_package(GTlab REQUIRED)
Required changes
Do not copy
GTlab.cmakeinto your module project.Do not include a local
GTlab.cmakefile.Use helper macros/functions exposed by
find_package(GTlab REQUIRED).
GTlab.cmake helpers
Name |
Purpose |
|---|---|
|
Applies GTlab build defaults (C++ standard, output/install dirs, debug postfix, automoc). |
|
Creates and installs a GTlab module target and sets |
|
Replaces direct |
|
Deprecated helper; use |
Minimal migration example
The old example below reflects common 2.0 module setup patterns. The new example shows the 2.0.12+/2.1-compatible approach.
Old pattern (2.0):
# avoid in 2.0.12+ and 2.1
include(path/to/copied/GTlab.cmake)
gtlab_standard_setup()
enable_gtlab_devtools()
find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
New pattern (2.0.12+ / 2.1):
# search for devtools (optional)
find_package(GTlabDevtools QUIET)
find_package(GTlab REQUIRED)
gtlab_standard_setup()
# use the Qt version that GTlab was built with
require_qt(COMPONENTS Core Widgets)
add_gtlab_module(MyModule
MODULE_ID "My Module"
SOURCES
src/mymodule.cpp
src/mymodule.h
)
# Qt version agnostic linking
target_link_libraries(MyModule
PRIVATE
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets
)
Upgrade Checklist#
Before upgrading to GTlab 2.1:
Remove all calls to deprecated functions.
Replace all deprecated types with modern counterparts.
Compiler & Tooling Tips#
Enforcing Deprecation Warnings#
Some compilers or build setups suppress warnings by default. To ensure warnings are visible:
GCC / Clang / AppleClang Enable warnings with:
-Wall -Wextra -Wdeprecated-declarations
MSVC Ensure warning level is not too low (e.g.
/W4), and enable:/w14996
If your build treats warnings as errors (-Werror or similar), enabling this
during migration can catch issues early.
Strict Mode#
During migration releases, you may want to treat deprecation warnings as errors. Add this to your CMake target:
target_compile_definitions(my_target PRIVATE GT_STRICT_DEPRECATIONS=1)
This makes deprecated API usage a compile-time error, even during migration releases.