Part I: Basic Qt – Ch01. Using the Reference Documentation 본문

Programming/C++/Qt

Part I: Basic Qt – Ch01. Using the Reference Documentation

halatha 2008. 7. 31. 11:57

Using the Reference Documentation

Qt's reference documentation is an essential tool for any Qt developer, since it covers every class and function in Qt. This book makes use of many Qt classes and functions, but it does not cover all of them, nor does it provide every detail of those that are mentioned. To get the most benefit from Qt, you should familiarize yourself with the Qt reference documentation as quickly as possible.

Qt 참고 문서는 어떤 Qt 개발자에게도 중요한 도구이다, 왜냐하면 그것은 Qt 있는 모든 클래스와 함수를 다루기 때문이다. 책은 많은 Qt 클래스들과 함수들을 이용하지만, 모든 것을 다루지는 않고, 언급된 것들의 모든 세부 사항을 제공하지도 않는다. Qt 가장 이용하기 위해, 당신은 당신 자신을 가능한 빨리 Qt 참고 문서와 친숙하게 해야 한다.

The documentation is available in HTML format in Qt's doc/html directory and can be read using any web browser. You can also use Qt Assistant, the Qt help browser, which has powerful searching and indexing features that make it quicker and easier to use than a web browser. To launch Qt Assistant, click Qt by Trolltech v4.x.y|Assistant in the Start menu on Windows, type assistant on the command line on Unix, or double-click Assistant in the Mac OS X Finder.

문서는 Qt doc/html 디렉토리에 HTML 형식으로 있고, 어떤 브라우저를 이용해서도 읽을 있다. 당신은 또한 Qt 어시스턴트, Qt 도움말 브라우저를 이용할 수도 있는데, 그것은 브라우저보다 사용이 빠르고 쉬운 매우 강한 탐색과 분류 기능을 갖는다. Qt 어시스턴트를 실행하기 위해, 윈도우즈의 시작 메뉴에서 Trolltech v4.x.y|Assistant 클릭해라, 유닉스에서는 명령행에서 assistant 입력하거나, OS X Finder에서 Assistant 더블 클릭해라.

The links in the "API Reference" section on the home page provide different ways of navigating Qt's classes. The "All Classes" page lists every class in Qt's API. The "Main Classes" page lists only the most commonly used Qt classes. As an exercise, you might want to look up the classes and functions that we have used in this chapter.

home 페이지에 있는 "API Reference" 부분의 링크들은Qt 클래스들을 탐색하는 다른 방법을 제공한다. "All Classes" 페이지는 Qt API 모든 클래스를 나열한다. "Main Classes" 페이지는 가장 최근에 사용되었던 단지 Qt 클래스들을 나열한다. 연습으로, 당신은 우리가 이번 장에서 사용했던 클래스들과 함수들을 찾아볼 수도 있다.

Figure 1.7. Qt's documentation in Qt Assistant on Mac OS X
그림 1.7. 윈도우즈 XP의 Qt 어시스턴트의 Qt 문서

사용자 삽입 이미지
Note that inherited functions are documented in the base class; for example, QPushButton has no show() function of its own, but it inherits one from its ancestor QWidget. Figure 1.8 shows how the classes we have seen so far relate to each other.

상속받는 함수들은 기본 클래스에 문서화되어 있다는 것을 주의하라; 예를 들어, QPushButton show() 함수를 자체적으로 갖지 않지만, 그것의 선조인 QWidget에서 상속을 받는다. 그림 1.8 어떻게 지금까지 클래스들이 서로 관계를 갖는지를 보여준다.

Figure 1.8. Inheritance tree for the Qt classes seen so far

사용자 삽입 이미지
The reference documentation for the current version of Qt and for some earlier versions is available online at http://doc.trolltech.com/. This site also has selected articles from Qt Quarterly, the Qt programmers' newsletter sent to all commercial licensees.

Qt 현재 버전과 이전 버전들을 위한 참고 문서는 http://doc.trolltech.com에서 있다. 사이트는 또한 Qt에서 분기별로 선택된 기사들, 모든 사용 라이센스를 갖는 사람들에게 보내지는 Qt 프로그래머들의 뉴스레터를 가지고 있다.

Widget Styles

The screenshots we have seen so far have been taken on Linux, but Qt applications look native on every supported platform. Qt achieves this by emulating the platform's look and feel, rather than wrapping a particular platform or toolkit's widget set.

이제까지 봤던 스크린샷은 윈도우즈 XP에서 만들어진 것이지만, Qt 어플리케이션은 모든 지원되는 플랫폼에서 만들어진 코드처럼 보일 있다. Qt, 툴킷의 위젯 집합이나 특정 플랫폼에 쒸우는 것보다는, 플랫폼의 룩앤필을 에뮬레이션하여 이것을 가능하게 만들었다.

Figure 1.9. Styles available everywhere

사용자 삽입 이미지
age

사용자 삽입 이미지
age –style motif

사용자 삽입 이미지
age –style plastique

사용자 삽입 이미지
age –style cde

With Qt/X11 and Qtopia Core, the default style is Plastique, which uses gradients and anti-aliasing to provide a modern look and feel. Qt application users can override the default style by using the -style command-line option. For example, to launch the Age application using the Motif style on X11, simply type

Qt/X11 Qtopia Core, 기본 스타일이 Plastique이다, 그것은 현대적인 룩앤필을 제공하기 위해 그레디언트와 안티 앨리어싱을 사용한다. Qt 어플리케이션 사용자들은 –style 명령행 선택 사항을 이용해서 기본 스타일을 오버라이드할 있다. 예를 들어, Age 어플리케이션을 X11 Motif 스타일로 시작하기 위해서는, 단지 명령행에서 다음과 같이 입력하라

./age -style motif

 

on the command line.

Figure 1.10. Platform-specific styles

사용자 삽입 이미지

Unlike the other styles, the Windows XP and Mac styles are only available on their native platforms, since they rely on the platforms' theme engines.

다른 스타일들과 달리, 윈도우즈 Xp 스타일은 단지 원래 플랫폼에서만 가능하다, 왜냐하면 그것들은 플랫폼의 테마 엔진에 의존하기 때문이다.

This chapter has introduced the key concepts of signalslot connections and layouts. It has also begun to reveal Qt's consistent and fully object-oriented approach to the construction and use of widgets. If you browse through Qt's documentation, you will find a uniformity of approach that makes it straightforward to learn how to use new widgets, and you will also find that Qt's carefully chosen names for functions, parameters, enums, and so on, make programming in Qt surprisingly pleasant and easy.

장에서는 시그널 슬롯 연결과 레이아웃의 기본 개념을 설명했다. 그것은 위젯을 만들고 이용하기 위해 Qt 일관성 있고 완전하게 객체 지향적인 접근 방법을 드러내기 시작한다. 당신이 Qt 문서들을 살펴보면, 어떻게 새로운 위젯을 만드는지 배우기 위해 명확하게 만드는 일관성있는 접근 방법을 알게 것이고, Qt함수, 인자, enum등에 대한 주의깊은 명명법이 Qt에서 프로그래밍을 놀랍도록 즐겁고 쉽게 만드는 것을 알게 것이다.

The following chapters of Part I build on the fundamentals covered here, showing how to create complete GUI applications with menus, toolbars, document windows, a status bar, and dialogs, along with the underlying functionality to read, process, and write files.

1부의 이어지는 장들에서는 여기서 다뤄진 기본들 위에서, 파일을 읽고 다루고, 쓰기 위한 내재된 기능과 함께, 메뉴, 툴바, 다큐먼트 윈도우, 스테이터스 바와 다이알로그를 가지고 어떻게 완벽한 GUI 어플리케이션을 만드는지 보여줄 것이다.

Comments