{"id":24926820,"url":"https://github.com/jaytwolab/useoldqt5inqt6","last_synced_at":"2026-04-27T21:31:52.947Z","repository":{"id":96137526,"uuid":"318716336","full_name":"JayTwoLab/UseOldQt5inQt6","owner":"JayTwoLab","description":"Use old Qt5 in Qt6 :kr: Qt6에서 구형 Qt5 사용하기","archived":false,"fork":false,"pushed_at":"2020-12-27T09:38:21.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T12:32:22.088Z","etag":null,"topics":["cpp","qt","qt5","qt6"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JayTwoLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-05T06:12:13.000Z","updated_at":"2021-03-03T15:34:14.000Z","dependencies_parsed_at":"2023-04-04T15:31:47.281Z","dependency_job_id":null,"html_url":"https://github.com/JayTwoLab/UseOldQt5inQt6","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JayTwoLab/UseOldQt5inQt6","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FUseOldQt5inQt6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FUseOldQt5inQt6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FUseOldQt5inQt6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FUseOldQt5inQt6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JayTwoLab","download_url":"https://codeload.github.com/JayTwoLab/UseOldQt5inQt6/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FUseOldQt5inQt6/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32356598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","qt","qt5","qt6"],"created_at":"2025-02-02T12:53:26.700Z","updated_at":"2026-04-27T21:31:52.940Z","avatar_url":"https://github.com/JayTwoLab.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UseOldQt5inQt6\n\n## Use Old Qt5 in Qt6 \n  \n:one: Set qmake(.pro) or cmake(CMakeList.txt).\n\n- For qmake(.pro)\n\n```qmake\nQT += core5compat\n```\n\n- For cmake(CMakeList.txt)\n\n```cmake\nPUBLIC_LIBRARIES\nQt::Core5Compat\n```\n\n:two: Check old Qt5 class.\n \n| Qt 5 Class       | Qt 6 Replacement   |\n| ---------------- | ------------------ |\n| QLinkedList      | std::list *        |\n| QRegExp          | QRegularExpression |\n| QStringRef       | QStringView        |\n| QXmlSimpleReader | QXmlStreamReader   |\n| QTextCodec       | QStringConverter   |\n| QTextEncoder     | QStringEncoder     |\n| QTextDecoder     | QStringDecoder     | \n\n- If you are planning a long-term upgrade, Upgrade old class to a new version of new class.\n\n## Code\n\n- UseOldQt5inQt6.pro\n\n```pro\n# UseOldQt5inQt6.pro\n\nmessage( 'Qt major version : ' $$QT_MAJOR_VERSION ) # test in Qt6.\n\n##################################\n# TODO: Append for old Qt5 code.\nQT += core5compat\n##################################\n\nQT -= gui\n\nCONFIG += c++11\nCONFIG += console\nCONFIG -= app_bundle\n\n# You can make your code fail to compile if it uses deprecated APIs.\n# In order to do so, uncomment the following line.\n#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0\n\nSOURCES += \\\n        main.cpp\n\n# Default rules for deployment.\nqnx: target.path = /tmp/$${TARGET}/bin\nelse: unix:!android: target.path = /opt/$${TARGET}/bin\n!isEmpty(target.path): INSTALLS += target\n```\n\n- main.cpp\n\n```cpp\n// main.cpp\n\n#include \u003cQtGlobal\u003e\n#include \u003cQString\u003e\n#include \u003cQDebug\u003e\n#include \u003cQCoreApplication\u003e\n#include \u003cQStringView\u003e //  Qt 5.10 or higher version\n\n//----------------------\n// #include \u003cQtCore5Compat\u003e // you may use this header.\n#include \u003cQtCore5Compat/QStringRef\u003e // QStringRef : Qt4.3 ~ Qt5\n//----------------------\n\nint main(int argc, char *argv[])\n{\n    QCoreApplication a(argc, argv);\n\n#if QT_VERSION_MAJOR == 6\n    // custom code for Qt 6 or higer version\n   qDebug() \u003c\u003c \"Qt version is six.\";\n#endif\n\n#if QT_VERSION_MAJOR == 5\n    // custom code for Qt 5\n   qDebug() \u003c\u003c \"Qt version is five.\";\n#endif\n\n#if QT_VERSION_MAJOR == 4\n   // ? Are you still in use?\n#endif\n\n    QString qstr(\"Hello, Qt5 in Qt6.\");\n\n    // Qt5 class ( QStringRef )\n    QStringRef sref( \u0026qstr );\n    qDebug() \u003c\u003c \"QStringRef\" \u003c\u003c sref;\n\n    // Qt6 class ( QStringView )\n    QStringView sv( qstr );\n    qDebug() \u003c\u003c \"QStringView\" \u003c\u003c sv;\n\n    return 0; // return a.exec();\n}\n```\n \n## :kr: Qt6에서 구형 Qt5 사용하기\n - (Korean Blog) https://j2doll.tistory.com/671\n\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaytwolab%2Fuseoldqt5inqt6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaytwolab%2Fuseoldqt5inqt6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaytwolab%2Fuseoldqt5inqt6/lists"}