QT 에서 ui를 사용하는? 불러오는? 방법은 크게 두가지가 있는데
하나는 ui 파일을 "런타임"에 읽어와서 사용하는 것이고
다른 하나는 qic 를 통해 cpp/h 로 변환해서 사용하는 것이다.
[링크 : https://doc.qt.io/qt-6/ko/designer-using-a-ui-file.html]
QT Ui Loader 를 이용하여 런타임중에 불러와서 쓰는 것과
| Header: #include <QUiLoader> CMake: find_package(Qt6 REQUIRED COMPONENTS UiTools) target_link_libraries(mytarget PRIVATE Qt6::UiTools) qmake: QT += uitools |
[링크 : https://doc.qt.io/qt-6/quiloader.html]
qt designer로 디자인하고
[링크 : https://doc.qt.io/qt-6/ko/qtdesigner-manual.html]
qic를 통해 소스로 변환하는 것이 있다.
[링크 : https://doc.qt.io/qt-6/ko/uic.html]
어쩌면 python을 위해 동적 로드가 추가된거 아닐까 생각도?
[링크 : https://doc.qt.io/qt-6/ko/designer-using-a-ui-file-python.html]
프로젝트 파일에 widgets가 들어가면 자동으로 변경되는것 처럼 이야기 하는데
6.x 면 기본으로 들어가게 되어있지만 그렇다고 자동으로 ui 파일 기반으로 변경하진 않는다.
| QT += core gui multimedia uitools greaterThan(QT_MAJOR_VERSION, 4): QT += widgets |
[링크 : https://www.qtcentre.org/threads/36215-qmake-not-invoking-uic]
[링크 : https://doc.qt.io/archives/qt-5.15/qtwidgets-index.html]
[링크 : https://stackoverflow.com/questions/38549747/qmake-doesnt-invoke-uic]
| QMAKE_UIC_FLAGS += -a |
[링크 : https://doc.qt.io/archives/qt-5.15/qmake-variable-reference.html#qmake-uic-flags]
[링크 : https://forum.qt.io/topic/129602/how-to-pass-option-to-uic-in-qmake-project-file/2]
| In specific cases, such as the example below where the include directive uses a relative path, qt_add_ui can be used to generate the ui_calculatorform.h file instead of relying on AUTOUIC. When to prefer qt_add_ui over AUTOUIC |
[링크 : https://doc.qt.io/qt-6/designer-using-a-ui-file.html]
[링크 : https://cmake.org/cmake/help/latest/manual/cmake-qt.7.html#autouic]
[링크 : https://doc.qt.io/qt-6/qt-add-ui.html]
| include 지시어가 상대 경로를 사용하는 아래 예제와 같은 특정 경우에는 AUTOUIC에 의존하는 대신 qt_add_ui를 사용하여 ui_calculatorform.h 파일을 생성할 수 있습니다. AUTOUIC보다 qt_add_ui를 선호하는 경우 |
[링크 : https://doc.qt.io/qt-6/ko/designer-using-a-ui-file.html]
[링크 : https://doc.qt.io/qt-6/uic.html]
'Programming > qt' 카테고리의 다른 글
| qt widget fullscreen (0) | 2026.03.31 |
|---|---|
| qt media 재생하기 (0) | 2026.03.31 |
| qt concurrent / qt thread (0) | 2026.03.30 |
| Qtimer를 이용한 반복/1회성 이벤트 생성 (0) | 2026.03.30 |
| qt6 시그널 (0) | 2026.03.30 |





