General and Desktop
2018.03.29 13:14

Qt Version확인 방법

조회 수 6036 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
Qt 기반의 어플리케이션을 개발 할 때 버전에 따라 구현을 다르게 해야 할 경우가 있을 수 있다.
qglobal.h에는 전처리 과정에서 버전을 확인할 수 있는 매크로가 정의 되어 있는데 이 매크로를 이용하면 Qt 버전을 얻을 수 있다.
 
QT_VERSION 매크로는 0xMMNNPP (MM = major, NN = minor, PP = patch) 형식의 16진수 숫자 값을 얻을 수 있다.
QT_VERSION 을 16진수로 출력하면
qDebug("Qt Verstion Hex: %x ", QT_VERSION);
 
아래 처럼 출력된다.
Qt Verstion Hex: 50a00
 
특정 버전과 비교해야할 필요가 있는 경우 QT_VERSION_CHECK 매크로를 사용하면 쉽다. 
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QtWidgets>
#else
#include <QtGui>
#endif
 
문자열 형태로 얻는 것도 가능한데, QT_VERSION_STR이라는 정의가 qconfig.h에 있다.
qDebug("Qt Verstion Str: %s ", QT_VERSION_STR);
 
문자열로 정의된 것을 출력

Qt Verstion Str: 5.10.0

 

TAG •

  1. No Image notice

    Qt프로그래밍(QtQuick) Beginner를 위한 글 읽는 순서

    Date2019.01.05 CategoryQML and Qt Quick By운영자 Views110094
    read more
  2. QtWayland와 ivi-compositor

    Date2018.12.27 CategoryMobile and Embedded Bymakersweb Views5060
    Read More
  3. Qml과 C++로 구현하는 GUI어플리케이션

    Date2018.12.25 CategoryQML and Qt Quick Bymakersweb Views17079
    Read More
  4. No Image

    싱글터치 스크린 및 임베디드 리눅스 기반에서 Qt 터치입력

    Date2018.12.24 CategoryMobile and Embedded Bymakersweb Views3688
    Read More
  5. ShaderEffect QML Type 을 이용한 그래픽효과

    Date2018.12.09 CategoryQML and Qt Quick Bymakersweb Views4667
    Read More
  6. No Image

    Qml에서 커튼효과 구현 예제 - Shader Effects

    Date2018.12.05 CategoryQML and Qt Quick By운영자 Views3732
    Read More
  7. 안드로이드 Qt 프로그래밍

    Date2018.11.30 CategoryMobile and Embedded Bymakersweb Views11796
    Read More
  8. 리눅스에서 Qt4.8기반 어플리케이션의 한글입력

    Date2018.11.29 CategoryInstallation and Deployment Bymakersweb Views5005
    Read More
  9. QML에서 동적으로 텍스트 다국어 처리

    Date2018.11.04 CategoryQML and Qt Quick Bymakersweb Views6681
    Read More
  10. Qt Installer Framework - 패키징, 설치프로그램 제작

    Date2018.10.14 CategoryInstallation and Deployment Bymakersweb Views14998
    Read More
  11. Qt 응용프로그램 배포(windows)

    Date2018.10.10 CategoryGeneral and Desktop Bymakersweb Views14744
    Read More
  12. No Image

    소스코드에서 환경변수 가져오기와 설정하기

    Date2018.10.08 CategoryGeneral and Desktop Bymakersweb Views4347
    Read More
  13. 표를 만들고 PDF문서로 출력하기

    Date2018.09.30 CategoryGeneral and Desktop Bymakersweb Views3630
    Read More
  14. Qml에서 키보드 입력 이벤트 핸들링

    Date2018.08.09 CategoryQML and Qt Quick Bymakersweb Views6477
    Read More
  15. Qml 어플리케이션 정적 빌드

    Date2018.07.27 CategoryInstallation and Deployment Bymakersweb Views4373
    Read More
  16. No Image

    Qt Bluetooth 관련 기능 확인 사항

    Date2018.07.10 CategoryInstallation and Deployment Bymakersweb Views3139
    Read More
  17. No Image

    Qml 및 C++개발시 유용한 팁

    Date2018.04.06 CategoryQML and Qt Quick Bymakersweb Views9039
    Read More
  18. No Image

    Qt Version확인 방법

    Date2018.03.29 CategoryGeneral and Desktop Bymakersweb Views6036
    Read More
  19. 초보자를 위한 첫번째 프로젝트 - QML로 만드는 Hello World

    Date2018.03.16 CategoryGeneral and Desktop Bymakersweb Views18778
    Read More
  20. Windows에서 라즈베리파이3 Qt 어플리케이션 개발 및 원격 실행

    Date2018.02.23 CategoryInstallation and Deployment Bymakersweb Views8000
    Read More
  21. Windows에서 라즈베리파이3용 Qt5.10.0 크로스컴파일

    Date2018.02.23 CategoryMobile and Embedded Bymakersweb Views16164
    Read More
Board Pagination Prev 1 ... 5 6 7 8 9 Next
/ 9