본문 바로가기
C++ 200제/코딩 IT 정보

Qt4 -> Qt5 업그레이드 차이 6가지 (우분투 리눅스 기준) pro에서 배포

by vicddory 2018. 9. 18.

Qt4 -> Qt5 업그레이드 차이 6가지 (우분투 리눅스 기준) pro에서 배포



Qt4와 Qt5의 차이를 일부 정리한 포스트입니다. 아래 사항을 수정하면 대부분 정상적으로 빌드될 것입니다.


1. xxxx.pro


Qt4 :


QT += core gui network webkit


Qt5 :


QT += core gui network webkitwidgets

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets


2. QApplication 선언


Qt4 : #include <QtGui/QApplication>

Qt5 : #include <QApplication>


3. Local 데스크탑 트리


Qt4 : QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);

Qt5 : QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);


Qt4 Qt5 변경할 때 차이점, 6가지 (리눅스 기준)[Qt4 Qt5 차이, 업그레이드할 때 필요한 6가지]


4. QTableWidget 행렬 고정 메소드 변경


Qt4 :


1
ui->tblwgt->verticalHeader()->setResizeMode(QHeaderView::Fixed);
cs


Qt5 : 


1
2
3
ui->tblwgt->verticalHeader()->setDefaultSectionSize(100);
 
ui->tblwgt->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
cs


5. 추가 주의점


QHttp → QNetworkAccessManager

QString.toAscii() → QString.toUtf8()


6. Qt5 애플리케이션 배포


Qt5 응용 프로그램 배포할 땐 exe가 있는 폴더 하단을 아래와 같이 꾸밈


platforms 폴더

 ├ qminimal.dll

 └ qwindows.dll


Qt4 -> Qt5 업그레이드 차이 6가지 (우분투 리눅스 기준) pro에서 배포

댓글