QT) QMessageBox

QT/Basics 2015. 4. 15. 13:26

QT에서 MessageBox를 구현하려면 다음과 같은 방법을 사용하여야 한다.

#include <QMessageBox>

QMessageBox::warning(this, tr("Title"), tr("Message"), Buttons);

QMessageBox::question(this, tr("Title"), tr("Message"), Buttons);

QMessageBox::information(this, tr("Title"), tr("Message"), Buttons);

QMessageBox::critical(this, tr("Title"), tr("Message"), Buttons);

각각의 항목에 따른 아이콘들이 출력 되게 되어 있다. 

또한, Button은 다음과 같이 구성되어 있다.

QMessageBox::Ok   [OK 버튼]

QMessageBox::Cancel   [Cancel 버튼]   값 : 2

QMessageBox::Yes   [Yes 버튼]    값 : 3

QMessageBox::No   [No 버튼]    값 : 4

QMessageBox::Abort   [Abort 버튼]   값 : 5

QMessageBox::Retry   [Retry 버튼]   값 : 6

QMessageBox::Ignore   [Ignore 버튼]   값 : 7

QMessageBox::YesAll   [Yes to All 버튼]   값 : 8

QMessageBox::NoAll   [No to All 버튼]   값 : 9




Posted by 모래반지빵냐빵냐
,