外文文献—QT4.0 白皮书

上传人:1777****777 文档编号:37911999 上传时间:2021-11-05 格式:DOC 页数:7 大小:47KB
返回 下载 相关 举报
外文文献—QT4.0 白皮书_第1页
第1页 / 共7页
外文文献—QT4.0 白皮书_第2页
第2页 / 共7页
外文文献—QT4.0 白皮书_第3页
第3页 / 共7页
点击查看更多>>
资源描述
附录I 英文资料翻译QT 4.0 Whitepapper1. Introduction Qt is the de facto standard C+ framework for high performance cross-platform Software development. In addition to an extensive C+ class library ,Qt includes tools to make writing applications fast and straightforward. Qts cross-platform capabilities and internationalization support ensure that Qt applications reach the widest possible market. The Qt C+ frame work has been at the heart of commercial applications since1995. Qt is used by companies and organizations as diverse as Adobe., Boeing., IBM., Motorola., NASA, Skype., and by numerous smaller companies and organizations. Qt 4 is designed to be easier to use than previous versions of Qt, while adding more powerful functionality. Qts classes are fully featured and provide consistent interfaces to assist learning, reduce developer workload, and increase programmer productivity. Qt is, and always has been, fully object-oriented. This whitepaper gives an overview of Qts tools and functionality. Each section begins with a non-technical introduction before providing a more detailed description of relevant features . Links to online resources are also given for each subject area.1.1. Executive Summary Qt includes a rich set of widgets(“controls”in Windows terminology)that provide standard GUI functionality. Qt introduces an innovative alternative for inter-object communication ,called “signals and slots”,that replaces the old and unsafe callback technique used in many legacy frameworks. Qt also provides a conventional event model for handling mouse clicks ,key presses, and other user input .Qts cross-platform GUI applications can support all the user interface functionality required by modern applications, such as menus, context menus ,drag and drop , and dockable toolbars. Qt also includes Qt Designer (page 20), a tool for graphically designing user interfaces. Qt Designer supports Qts powerful layout features (page 39) in addition to absolute positioning. Qt Designer can be used purely for GUI design, or to create entire applications with its support for integration with popular integrated development environments(IDEs). Qt has excellent supportfor2D and3Dgraphics. Qt is the de facto standard GUI framework for platform-independent OpenGL.programming.Qt4spainting system offers high quality rendering across all supported platforms. Qt makes it possible to create platform-independent database applications using standard databases. Qt includes native drivers for Oracle ,Microsoft SQL Server, Sybase .Adaptive Server, IBMDB2, PostgreSQL., MySQL., Borland Interbase, SQLite, and ODBC-compliant databases. Qt includes database-specific widgets, and any built-in or custom widget can be made data-aware. Qt programs have native look and feel on all supported platforms using Qts styles and themes support. From a single source tree, recompilation is all that is required toproduceapplicationsforWindows.98 to XP ,MacOS X. , Linux , Solaris ,HP-UX., and many other versions of Unix with X11.Qt applications can also be compiled to run on Qt opia. Qts qmake build tool produces makefiles or .dsp files appropriate to the target platform.Since Qts architecture takes advantage of the underlying platform, many customers use Qt for single-platform development on Windows, Mac OS X, and Unix because they prefer Qts approach. Qt includes support for important platform-specific features, such as ActiveX on Windows , and Motif on Unix . See the section on Qts Architecture for more information. Qt uses Unicode .throughout and has consider able support for internationalization. Qt includes Qt Linguist and other tools to support translators. Applications can easily use and mix text in Arabic, Chinese, English, Hebrew, Japanese, Russian, and other languages supported by Unicode. Qt includes a variety of domain-specific classes. For example, Qt has an XML module that includes SAX and DOM classes for reading and manipulating data stored in XML-based formats. Objects can be stored in memory using Qts STL-compatible collection classes, and handled using styles of iterators used in Java. And the C+ Standard Template Library(STL).Local and remote file handling using standard protocols are provided by Qts input/output and networking classes. Qt applications can have their functionality extended by plugins and dynamic libraries . Plugins provide additional codecs ,data base drivers ,image formats, styles, and widgets. Plugins and libraries can be sold as products in their own right. Qt is a mature C+ framework that is widely used around the world. In addition to Qts many commercial uses, the Open Source edition of Qt is the foundation of KDE ,the Linux desktop environment .Qt makes application development a pleasure ,with its cross platform build system, visual form design, and elegant API. 2. Widgets Qt provides a rich set of standard widgets that can be used to create graphical user interfaces for applications. Qts widgets are flexible and can easily be subclassed to suit specialized requirements. Widgets are visual elements that are combined to create user interfaces. Buttons, menus, scroll bars, message boxes, and application windows are all examples of widgets. Qts widgets are not arbitrarily divided between “controls”and “containers”; all widgets can be used both as controls and as containers. Custom widgets can easily be created by subclassing existing Qt widgets, or created from scratch if necessary. Standard widgets are provided by the QWidget class and its subclasses, and custom widgets can be created by subclassing them and reimplementing virtual functions. A widget may contain any number of child widgets. Child widgets are shown within the parent widgets area. A widget with no parent is a top-level widget (a “window”), and usually has its own entry in the desktop environments task bar. Qt imposes no arbitrary limitations on widgets. Any widget can be a top-level widget; any widget can be a child of any other widget. The position of child widgets within the parents area can be set automatically using layout managers, or manually if preferred. When a parent widget is disabled , hidden , or deleted, the same action is recursively applied to all its child widgets.3. Signals and Slots Signals and slots provide inter-object communication. They are easy to understand and use, and are fully supported by Qt Designer. GUI applications respond to user actions .For example, when a user clicks a menu item or a toolbar button, the application executes some code. More generally, we want objects of any kind to be able to communicate with each other. The programmer must relate events to the relevant code. Older toolkits use mechanisms that are not type-safe(i.e. ,they are crash-prone), are inflexible ,and are not object-oriented. Trolltech has invented a solution called “signals and slots.” The signals and slots mechanism is a powerful inter-object communication mechanism that can be used to completely replace the crude callbacks and message maps used by legacy toolkits. Signals and slots are flexible ,fully object-oriented, and implemented in C+. To associate some code with a button using the old callback mechanism, it is necessary to pass a function pointer to the button. When the button is clicked, the function is then called. Old toolkits do not ensure that arguments of the correct type are given to the function when it is called, making crashes more likely .Another problem with the callback approach is that it tightly binds the GUI element to the functionality, making it difficult to develop classes independently. Qts signals and slots mechanism is different. Qt widgets emit signals when events occur. 4. GUI Applications Building modern GUI applications with Qt is fast and simple, and can be achieved by hand coding or by using Qt Designer ,Qts visual design tool. Qt provides all the classes and functions necessary to create modern GUI applications .Qt can be used to create both “main window”style applications with a menu bar ,toolbars ,and status bar surrounding a central area ,and “dialog”style applications that use buttons and possibly tabs to present options and information. Qt supports both SDI(single document interface) and MDI(multiple document interface). Qt also supports drag and drop and the clipboard. 5. Qt Designer Qt Designer is a graphical user interface design tool for Qt applications. Applications can be written entirely as source code ,or using Qt Designer to speed up development. A component-based architecture makes it possible for developers to extend Qt Designer with custom widgets and extensions, and even integrate it into integrated development environments. Designing a form with Qt Designer is a simple process. Developers drag widgets from a toolbox onto a form, and use standard editing tools to select, cut, paste, and resize them. Each widgets properties can then be changed using the property editor. The precise positions and sizes of the widgets do not matter. Developers select widgets and apply layouts to them. For example, some button widgets could be selected and laid out side by side by choosing the “lay out horizontally” option. This approach makes design very fast, and the finished forms will scale properly to fit whatever window size the end-user prefers. See Layouts on page 39 for information about Qts automatic layouts. Qt Designer eliminates the time-consuming “compile ,link ,and run”cycle for user interface design. This makes it easy to correct or change designs. Qt Designers preview options let developers see their forms in other styles ;for example ,a Macintosh developer can preview a form in the Windows style. Commercial licensees on Windows can enjoy Qt Designers user interface design facilities from with in Microsoft Visual Studio .On Mac OS X , developers can use Qt Designer from with in Apples Xcode environment. QT4.0 白皮书1. 简介Qt是一种标准的C+框架,进行高性能跨平台的软件开发。除了拥有广泛的C+类库,Qt还包括许多能够加快、简化编写应用程序的工具。Qt的跨平台能力以及国际化支持确保了Qt的应用程序影响到最广泛的市场。Qt的C+框架自1995年以来就一直是商务应用程序的核心。许多公司和组织都在使用Qt,如Adobe ,波音, IBM公司,摩托罗拉,美国航天局,Skype公司,同时也有许多规模较小的公司和组织在使用。Qt在增加了更加强大的功能之后,所设计出来的Qt4使用起来比之前的Qt版本更为方便。Qt的类功能齐全,提供一致的接口来辅助学习,减少开发人员的工作量,提高程序员的工作效率。Qt现在是,并且一直都是,完全面向对象的。此白皮书对Qt的各种工具以及功能进行了概述。每一节在详细说明相关功能之前,都会先进行简单的(非技术的)介绍。每个章节的内容都提供了网上链接。1.1 执行摘要Qt包括一套丰富的小部件(在Windows术语中称之为“控制键”),它们具有标准的GUI功能。Qt为对象间的通讯提供了一项新的选择,被称之为“信号与槽”,它取代了用在许多传统框架上的陈旧危险的回调技术。Qt还提供了传统的事件模型,用来处理鼠标点击,按键和其他的用户输入。Qt的跨平台GUI应用程序可以支持现代应用程序所要求的任何用户界面功能,如菜单,上下文菜单,拖放,以及可调整的工具栏。Qt还包括Qt设计器和图形设计用户界面的工具。Qt设计器除了拥有绝对的定位功能,还支持强大的布局功能。Qt设计器可以单纯只用于GUI设计,或者凭借其对于流行的集成开发环境的支持进行整个应用程序的创建。Qt对二维和三维图形都完全支持。Qt是目前标准的图形用户界面框架,支持与平台无关的OpenGL 编程。Qt4的绘画体系能够在所有支持的平台上提供高品质的作品。通过使用标准数据库,Qt创建了与平台无关的数据库应用程序。Qt包括许多本机的驱动程序,用于Oracle ,微软 SQL 服务器,Sybase数据库自适应服务器,IBM的DB2 ,Postgre的SQL的,MySQL,Borland公司 Interbase,SQLite和ODBC兼容的数据库。Qt还包括许多数据库专用的部件,任何内置或自定义部件都能够做成与数据相关联的。在所有使用Qt风格和主题支持的平台上,Qt的应用程序都具有本机的外观和感觉。从单一的源代码来看,重新编译是生产适用于Windows 98应用到XP ,Mac OS X,Linux ,Solaris,HP - UX,和许多其他版本的附有X11的UNIX 的程序全部需要的。Qt的应用程序也可以编写成在Qtopia上运行。Qt的qmake生成工具生成的makefile或.dsp文件适用于目标平台。由于Qt的架构采用了底层平台,许多客户在Windows,Mac OS X和Unix开发时都使用了Qt的单一平台,因为他们更喜欢Qt的做法。Qt支持特定平台的重要功能,如Windows上的ActiveX ,和UNIX母题。Qt至始至终都在使用Unicode,相当支持国际化。Qt包括Qt语言学家和其他工具来帮助译者进行翻译工作。应用程序可以很容易使用和混合各种Unicode支持的语言文字,如阿拉伯文,中文,英文,希伯来文,日文,俄文等。Qt包括多种多样的特定域。例如,Qt有一个XML模块,这一模块包括SAX和DOM类,用来阅读和处理以XML格式存储的数据。对象可以存储于使用了Qt的STL兼容的集合类的内存中,并采用在Java中使用的的迭代器风格和C+标准模板库进行处理。使用标准协议的本地和远程文件处理是由Qt的输入/输出和网络类提供的。Qt的应用程序可以通过插件和动态库来扩展其功能。插件提供额外的编解码器,数据库驱动程序,图像格式,样式和部件。插件和库可以像商品一样自行出售。Qt是一个成熟的C+框架,它广泛应用于世界各地。Qt除了具有许多商业用途外,Qt的开源版本是KDE的基础Linux桌面环境。具有跨平台构建系统,视觉造型设计以及优雅API的Qt使开发应用程序成为一种乐趣。2. 小工具Qt提供了丰富的标准部件,这些部件可以为应用程序创建图形用户界面。Qt的窗口部件十分灵活,很容易创建子类,以满足特殊的要求。Widget是为了创建用户界面而结合的视觉元素。按钮,菜单,滚动条,消息框和应用程序窗口都是小部件的例子。Qt的部件并不是任意被划分为“控制键”和“容器”的,所有部件都可以以控制键和容器两种形式存在使用。自定义部件很容易由现有的Qt部件生成子类,或者如有需要,也可以从头开始创建。标准部件是由QWidget的类及其子类提供的,自定义部件可以通过创建它们的子类重新构建虚函数。一个部件可能包含任何数量的子部件。子部件都显示在父窗口部件的区域。一个没有父部件的部件是一个顶级窗口部件(一个“窗口”),通常在桌面环境的任务栏里有它自己的条目。Qt规定不能任意限制部件。任何部件都可以是一个顶级部件,任何部件可以是其它任何部件的子部件。在父区域的子部件的位置可以使用布局管理器自动设置,或者首选手动的话也可以。当一个父部件被禁用,隐藏或者删除时,同样的动作也会应用到其所有子部件中。3. 信号和槽信号和槽提供对象间的通信。他们很容易理解和使用,并且完全由Qt设计支持。GUI应用程序响应客户的各种操作。例如,当一个用户点击一个菜单项目或工具栏按钮时,应用程序执行一些代码。更普遍的是,我们希望任何对象都能够互相通信。程序员必须将事件与有关代码联系起来。陈旧的工具包使用的机制,类型危险(即,他们是事故多发型的),缺乏弹性,而且不是面向对象的。奇趣科技提出了被称之为“信号和槽”的解决方案。信号和槽机制是一个功能强大的对象间的通信机制,可以用来完全替代使用了传统工具包的最初的回调和消息映射。信号和槽非常灵活,完全面向对象,并在C+中进行操作。要将一些代码与一个使用旧的回调机制按钮联系起来,必须将一个函数指针传递给这个按钮。当按钮被点击时,该函数被调用。旧工具包不能确保所当某个函数被调用时,正确类型的参数都加到了该函数上,这时崩溃的可能性更大。回调做法的另一个问题是,它的GUI元素与功能性紧密结合在一起,因此使得独立开发类相当困难。Qt的信号和槽机制是不同的。当时间发生时,Qt的窗口部件会发出信号。例如,当一个按钮被点击时,此按钮就会发出一个“clicked”信号。程序员可以选择通过建立一个函数(一个“槽”)和调用正确的函数关系来将信号与槽联系起来。Qt的信号与槽机制不需要各种类的辅助来了解对方,这使得开发高度可用的类更为容易。由于信号和槽十分安全,类型错误报告为警告,并且不会导致崩溃的发生。4. GUI应用程序配置有Qt的Buildingmodern的GUI应用程序使用起来快速简便,可以通过手动编码或使用Qt 设计器,Qt可视化设计工具来实现。Qt提供所有必要的类和函数来创建现代GUI应用程序。Qt可用于创建两个“主窗口”样式的应用程序,附带有菜单栏,工具栏和围绕中心区得状态栏,使用按钮和可能对当前的选项和信息进行描述的标签的“对话框”风格的应用程序。Qt支持SDI(单文档接口)和MDI(多文档界面)。Qt还支持拖放和剪贴板。5. Qt设计器Qt设计器是一个服务于图形用户界面的设计工具。应用程序完全可以被写作源代码,或者使用Qt设计器来加速其启动。一个基于组件的架构使开发人员能够用自定义小部件和各种扩展来扩展Qt设计,甚至将其整合为综合开发环境。用Qt设计器设计一个窗体是一个简单的过程。开发人员从工具箱中将部件拖至窗体中,然后使用标准的编辑工具来选择,剪切,黏贴,调整它们的大小。每个部件的属性都可以使用属性编辑器进行调整。部件的精确位置以及大小并不重要。开发人员将开发布局应用到这些部件上。例如,可以选择一些按钮控件,通过选择“横向布局”选项将其并排布局。这种方法加快了设计的速度,并且完成的窗体将根据终端客户的喜好调整为任何大小。Qt设计为用户界面的设计消除了耗时的“编译,链接和运行”。这使得纠正或更正设计十分容易进行。Qt设计器的预览选项让开发商看到他们窗体的其他风格,例如,一个Macintosh开发人员可以在Windows中预览一个窗体。
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸设计 > 任务书类


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!