1 / 22

QT 알아보기

QT 알아보기. 하늘소 19 기 한승욱. I ndex. QT 란 ? MFC 와 QT 플랫폼이란 무엇인가 ? QT 의 특징 예 제. QT 란 ?. Application Framework Written in C ++ C++ 클래스로 캡슐화 상속을 이용 기능 확장 Signal / Slot 매커니즘 ( C++ 의 확장 ) 객체 ( Object ) 의 신호 (Signal) 를 다른 객체 (Object) 슬롯 (Slot) 에 연결. Cross-Platform GUI toolkits

fineen
Download Presentation

QT 알아보기

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. QT 알아보기 하늘소 19기 한승욱

  2. Index • QT란? • MFC와 QT • 플랫폼이란 무엇인가? • QT의 특징 • 예제

  3. QT란? • Application Framework • Written in C++ • C++ 클래스로 캡슐화 • 상속을 이용 기능 확장 • Signal / Slot 매커니즘( C++의 확장 ) • 객체( Object )의 신호(Signal)를 다른 객체(Object) 슬롯(Slot)에 연결 Cross-Platform GUI toolkits “Write Once, compile anywhere”

  4. Supported Platforms

  5. Application Framework 윈도우 API를 이용한 창 띄우기 예제 MFC를 이용한 창 띄우기 예제 #include <windows.h> LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);HINSTANCE g_hInst;LPCTSTR lpszClass=TEXT("First"); int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCEhPrevInstance    ,LPSTR lpszCmdParam,intnCmdShow){ HWND hWnd; MSG Message; WNDCLASS WndClass;g_hInst=hInstance;WndClass.cbClsExtra=0;WndClass.cbWndExtra=0;WndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);WndClass.hIcon=LoadIcon(NULL,IDI_APPLICATION);WndClass.hInstance=hInstance;WndClass.lpfnWndProc=WndProc;WndClass.lpszClassName=lpszClass;WndClass.lpszMenuName=NULL;WndClass.style=CS_HREDRAW | CS_VREDRAW;RegisterClass(&WndClass); hWnd=CreateWindow(lpszClass,lpszClass,WS_OVERLAPPEDWINDOW,  CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,  NULL,(HMENU)NULL,hInstance,NULL);ShowWindow(hWnd,nCmdShow); while (GetMessage(&Message,NULL,0,0)) {TranslateMessage(&Message);DispatchMessage(&Message); } return (int)Message.wParam;} LRESULT CALLBACK WndProc(HWND hWnd,UINTiMessage,WPARAMwParam,LPARAMlParam){ switch (iMessage) { case WM_DESTROY:PostQuitMessage(0);  return 0; } return(DefWindowProc(hWnd,iMessage,wParam,lParam));} class CAppFrame: public CWnd {public:        void PostNcDestroy() { delete this; }}; class CMyApp: public CWinApp {public:        BOOL InitInstance();}; CMyAppg_App; BOOL CMyApp::InitInstance(){m_pMainWnd=new CAppFrame;m_pMainWnd->CreateEx(0, AfxRegisterWndClass(0), _T("Hello World"), WS_OVERLAPPEDWINDOW,                100, 100, 500, 500, NULL, NULL);m_pMainWnd->ShowWindow(SW_SHOW);m_pMainWnd->UpdateWindow();        return TRUE;} ShowWindow Show me the money

  6. C로 된 API, C++로 된 MFC ? • OOP로서의 MFC의 한계 • MFC 1.0 - 1992년 4월 • 하위호환성 중시 • Class 구조의 난해함

  7. MFC 계층 구조

  8. MFC 대비 QT의 장점 • MFC보다 배우고 사용하기 쉽다. • MFC대비 계층 구조가 직관적이다. • MFC의 Message Queue 보다 QT의 Signal/Slot이 더 쉽다. • 다양한 플랫폼을 지원한다. • 다양한 IDE Tool에서 지원된다. • Visual Studio • QT Creator • Eclipse • 정리가 잘된 문서가 있다.

  9. QT 계층 구조 많지만 알기 쉽다.

  10. 다양한 OS에서의 QT

  11. QT의 GUI

  12. Widget

  13. Layout

  14. Signals and Slots connect(button, SIGNAL(clicked()), qApp, SLOT(quit()));

  15. Graphic Qpainter, Qimage, QGLWidget

  16. Item View & Text

  17. Web View

  18. Database • 드라이버 계층: ODBC, MySQL, PSQL, SQLite, ibase, Oracle, Sybase, DB2에 대한 지원을 제공합니다. • API 계층: 특정 데이터베이스에 대한 액세스를 제공합니다. • UI 계층: 데이터베이스의 데이터를 데이터 인지 위젯에 연결합니다. • Qt의 모델/뷰 프로그래밍 모델과 함께 동작합니다.

  19. QT 클래스 라이브러리 개요

  20. 주요 사이트 http://qt.nokia.com/products-kr/class-library/

  21. Example

  22. QnA

More Related