Title: Cross Platform Development Focusing on Trolltech QT
1Cross Platform DevelopmentFocusing on Trolltech
QT
2Overview
- Why do Cross Platform Development?
- Advantages and Disadvantages
- Design Issues
- Tools
- QT Overview
- QT Features
- Signals and Slots
- Class Library
- Designer
Cross Platform DevelopmentFocusing on Trolltech
QT
By Gabriel Johnson
Cross Platform Development
3Overview
- Why do Cross Platform Development?
- Advantages and Disadvantages
- Design Issues
- Tools
- QT Overview
- QT Features
- Signals and Slots
- Class Library
- Designer
Cross Platform Development
4Why 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
5Overview
- Why do Cross Platform Development?
- Advantages and Disadvantages
- Design Issues
- Tools
- QT Overview
- QT Features
- Signals and Slots
- Class Library
- Designer
Cross Platform Development
6Advantages
- New Target Market
- Support Existing Customers
- Choice
- Code Quality
- Financial Reasons
- Its Cool and Gives Warm Fuzzies
Cross Platform Development
7Disadvantages
- Cost of Training
- Cost of Purchasing
- Testing Time
- Managing Multiple Releases
- Dependent on Tools
Cross Platform Development
8Overview
- 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
9Design 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
10Overview
- 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
11Design Issues
- Individual Compilers
- Follow language Standards
- Avoid Compiler Macros or Functions
- Individual Platforms
- Platform Specific Libraries are Necessary
Cross Platform Development
12Example
- MyCreateDialogBox()
-
- if (this is a Windows machine)
-
- call the Windows library CreateDialog()
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
13Design Issues
- Individual Compilers
- Follow language Standards
- Avoid Compiler Macros or Functions
- Individual Platforms
- Platform Specific Libraries are Necessary
- Platform Idiosyncrasies
Cross Platform Development
14Overview
- 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
15Tools
- WxWidgets
- Java
- Python
- MONO
- QT
Cross Platform Development
16Overview
- 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
17QT Overview
- Qt is a complete C application development
framework, including - A comprehensive C class library
- RAD GUI development tool
- Internationalization tool
Cross Platform Development
18QT 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, FreeBSD, HP-UX, IRIX, NetBSD,
OpenBSD, Solaris, Tru64 UNIX
Cross Platform Development
19Overview
- 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
20QT Features
- 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
21Overview
- 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
22Signals 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
23Signals and Slots
Cross Platform Development
24Signals and Slots
- class Foo public QObject
-
- Q_OBJECT
- public
- Foo()
- int value() const
-
- return val
-
- public slots
- void setValue( int )
- signals
- void valueChanged( int )
- private int val
-
Cross Platform Development
25Signals and Slots
- void FoosetValue( int v )
-
- if ( v ! val )
-
- val v
- emit valueChanged(v)
-
-
Cross Platform Development
26Signals and Slots
- Foo a, b
- connect(a,SIGNAL(valueChanged(int)),
- b, SLOT(setValue(int)))
- b.setValue( 11 )
- a.setValue( 79 )
- b.value()
Cross Platform Development
27Overview
- 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
28Class 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
29Class 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
- OpenGL
- ActiveX
- Netscape Plugins
Cross Platform Development
30Overview
- 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