MyAlbum   Pet
DirectX   openGL   Java   C/C++   STL   C#   Python   Window   ActiveX   SE & Refactoring   Game   Unicode   googleDesktop   Network   Database   Web   php   asp   asp.net   Library   QT   wxWidget   Something to read  
ToDo
zelon's WebAlbum
Google Tools
Google Naver map
ToRearrange
OpenOffice.org
Eclipse
Check W3 validator
QT Programming
e i R f
Anonymous

Contents

1 MessageBox
2 Wizard 에서 finish, cancel 체크
3 드래그 & 드랍
3.1 다른 프로그램에서 내 프로그램으로 드랍

1 MessageBox #

QMessageBox::information(this, "Caption", "Show Message ~ Hello", QMessageBox::Ok );

2 Wizard 에서 finish, cancel 체크 #


Wizard 클래스의 인스턴스의 result() 를 QDialog::Accepted와 비교하면 된다.

3 드래그 & 드랍 #


3.1 다른 프로그램에서 내 프로그램으로 드랍 #



  • UI 를 초기화할 때 setAcceptDrops(TRUE) 를 해준다.
  • void myWidget::dragEnterEvent(QDragEnterEvent * event) { event->accept(QUriDrag::canDecode(event));
  • QUriDrag 대신에 QTextDrag, QImageDrag 등도 쓴다.
  • void myWidget::dropEvent(QDropEvent * event)
    {
    	QString text;
    	QStringList files;
    	
    	if ( QTextDrag::decode(event, text) )
    	{
    		QMessageBox::information(this, text, text, QMessageBox::Ok );
    	}
    	else if ( QUriDrag::decodeLocalFiles(event, files) )
    	{
    		for ( int i=0; i<files.count(); ++i )
    		{
    			QMessageBox::information(this, files[i], text, QMessageBox::Ok );
    		}
    	}
    }