Cross Platform Development Focusing on Trolltech QT By
Cross Platform Development Focusing on Trolltech QT By: Gabriel Johnson
Overview • Why do Cross Platform Development? • Cross Advantages and Disadvantages Platform Development • Focusing Design Issues on Trolltech QT • Tools • By: QT Gabriel Overview. Johnson • QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
Overview • • • Why do Cross Platform Development? Advantages and Disadvantages Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
Why Cross Platform? • The computing world is becoming increasingly diverse • With the right tools it can be painless • Open up product to new markets • Open up product to new users Cross Platform Development
Overview • • • Why do Cross Platform Development? Advantages and Disadvantages Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
Advantages • • • New Target Market Support Existing Customers Choice Code Quality Financial Reasons It’s Cool and Gives Warm Fuzzies Cross Platform Development
Disadvantages • • • Cost of Training Cost of Purchasing Testing Time Managing Multiple Releases Dependent on Tools Cross Platform Development
Overview • • Why do Cross Platform Development? Advantages and Disadvantages Design Considerations Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
Design Considerations • • • Language Use Standards-Based Persistent Storage Make Business Logic Abstract Closer to the User Means Less Portability Use XML for Standardized, Interoperable Communications between Subsystems • Avoid Hiding The Power of a Specific Platform in the Name of Portability Cross Platform Development
Overview • • Why do Cross Platform Development? Advantages and Disadvantages Design Considerations Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
Design Issues • Individual Compilers – Follow language Standards – Avoid Compiler Macros or Functions • Individual Platforms – Platform Specific Libraries are Necessary Cross Platform Development
Example My. Create. Dialog. Box() { if (this is a Windows machine) { call the Windows library Create. Dialog() function; } else if (this is a Mac) { call the Mac library's dialog creation function; } else if (this is a UNIX box) { call the X Window System's dialog creation function; } } Cross Platform Development
Design Issues • Individual Compilers – Follow language Standards – Avoid Compiler Macros or Functions • Individual Platforms – Platform Specific Libraries are Necessary • Platform Idiosyncrasies Cross Platform Development
Overview • • Why do Cross Platform Development? Advantages and Disadvantages Design Considerations Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
Tools • • • Wx. Widgets Java Python MONO QT Cross Platform Development
Overview • • Why do Cross Platform Development? Advantages and Disadvantages Design Considerations Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
QT Overview • Qt is a complete C++ application development framework, including – A comprehensive C++ class library – RAD GUI development tool – Internationalization tool Cross Platform Development
QT Overview • QT is Cross Platform – The Qt API and tools are consistent across all supported platforms – Consequence for users and customers – OS Choices Include • • Windows® 95 through Server 2003 Mac OS® X Linux and embedded Linux AIX, BSD/OS, Free. BSD, HP-UX, IRIX, Net. BSD, Open. BSD, Solaris, Tru 64 UNIX Cross Platform Development
Overview • • Why do Cross Platform Development? Advantages and Disadvantages Design Considerations Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
QT Features Application Qt/X 11 lib Qt/Windows lib Qt/Mac lib Unix or Linux MS Windows Mac. OS • Qt provides a platform-independent encapsulation of the local window system and operating system • The Qt API is identical on every platform, applications are compiled to native executables • Result: Write once, compile everywhere Cross Platform Development
Overview • • Why do Cross Platform Development? Advantages and Disadvantages Design Considerations Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
Signals and Slots • Unique inter-object communication mechanism, provides – Type-safe callback between objects – Facilitates loose coupling / encapsulation • Sender and receiver does not ”know about” each other – 1 -to-many, many-to-1 communication between objects • Fully Object-oriented Cross Platform Development
Signals and Slots Cross Platform Development
Signals and Slots class Foo : public QObject { Q_OBJECT public: Foo(); int value() const { return val; } public slots: void set. Value( int ); signals: void value. Changed( int ); private: int val; }; Cross Platform Development
Signals and Slots void Foo: : set. Value( int v ) { if ( v != val ) { val = v; emit value. Changed(v); } } Cross Platform Development
Signals and Slots Foo a, b; connect(&a, SIGNAL(value. Changed(int)), &b, SLOT(set. Value(int))); b. set. Value( 11 ); a. set. Value( 79 ); b. value(); Cross Platform Development
Overview • • Why do Cross Platform Development? Advantages and Disadvantages Design Considerations Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
Class Library • GUI Toolkit Classes – Full API to easily create the GUI – Complete set of GUI controls – Native look & feel • OS encapsulation Classes – – – – File & directory handling Date & time Registry / preferences Networking Process handling Threading Dynamic library loading Cross Platform Development
Class Library • SQL Database Classes – Database operations – Database-independent API – DB-aware widgets • Utility Classes – – String and regular expressions Text and binary I/O Collections XML I/O • Integration and Migration Classes – Open. GL – Active. X – Netscape Plugins Cross Platform Development
Overview • • Why do Cross Platform Development? Advantages and Disadvantages Design Considerations Design Issues Tools QT Overview QT Features – Signals and Slots – Class Library – Designer Cross Platform Development
- Slides: 30