2010 Summer Project Week Breakout: Getting Started with Qt
Back to Project Week Agenda
Session Leader: Adam Weinrich, Nokia
Contents
Agenda
Nokia, in collaboration with [ICS http://www.ics.com/products/qt/] will provide an overview of the Qt software ecosystem. This brief tour is intended to give the NA-MIC community a taste of some of the important technologies that are likely to have a strong impact on the medical image computing software development community in coming years.
Attendees of various skill levels are encouraged to attend. Reading material from the Nokia Qt web site ahead of time will help you prepare and get the most out of the presentation. Downloading and installing the SDK and trying tutorials is encouraged.
- Introduction to Qt - Nokia (File:2010-NAMICQt1.pdf)
- Programming Walkthrough and demo - ICS
Organizational Background
PLEASE NOTE THAT THIS PAGE IS WAS USED TO BRAINSTORM AN AGENDA FOR THIS SESSION.
Steve, Tina (or anyone else from NA-MIC to rate the following agenda items on a scale of 1-10 in terms of suitability for this session, with 10 being most suitable)
- 5 Nokia's angle
- 6 Qt Products and How They All Fit Together
- 9 GUI Toolkits and Cross-Platform Libraries
- 10 Getting Started with Qt ("Hello World")
- 8 Parent/Child Relationship
- 10 Linking User Interaction to Application Functionality (signal/slots)
- 6 Different Qt Libraries,
- 7 Various Widgets,
- 8 Model/View Classes
- 5 Dialogs
- 7 Geometry Management
- 3 file I/O
- 4 Networking
- 6 Graphics
- 3 Printing
- 3 Database
- 3 Multithreading
- 3 Multimedia
- 8 Painting - Basic Drawing
- 7 Main Window and Actions
- 7 Multi-window docking & open/close animation
- 7 Cursor control
- 3 Printing,
- 8 Scrolled Areas
- 8 Predefined Dialogs
- 8 Custom Dialogs
- 7 Geometry Management
- 8 Qt Designer (can be left out in the interest of time)
- 4 Customized Drawings (Colors, Transparency, Clipping, Coordinate System Transformation)
- 3 Text Processing
- 8 The Qt Event System (Internal Details, Synthetic Events, Delayed Invocation, Event Filters)
- 7 Container Classes
- 9 Debugging
- 4 Writing Your Own Widget
- 7 Help Systems
- 7 Tool Tips and What's This
- 4 Using Rich Text
- 5 Portability
- 3 System Resources (Sound, Saving Settings, the System Clipboard, Drag and Drop, Network Programming, External Processes with QProcess)
- 4 Emulating MDI with QWorkspace
- 7 QGraphicsView
- 7 QScrollView
- 10 Model/View Programming
- 9 Using Convenience Classes (QListWidget, QTreeWidget, QTableWidget)
- 9 Stacked Widgets or Layouts
- 7 Using OpenGL with Qt
- 8 Widget Styles
- 5 qmake — Automating Makefile Creation
- 7 CMAKE -
- 4 Internationalization
- 4 XML in Qt
- 4 Mulitithreading
- 3 SQL
- 6 Integrating with Visual Studio
- 6 Development Tools for Linux (KDevelop, ...)
- 7 Licensing
- 6 Deploying Qt Applications
- 6 Plugins
- 2 Qt4 vs Qt3
- 2 Qt vs other toolkits
- 7 Qt with Python
- 5 Qt Scripting using Javascript
- 1 Qt embedded
- 1 Qt on Nokia devices
Sample Scenarios
These are examples of the type of programming the NA-MIC community would be interested using Qt to accomplish.
Simple Image Viewer
The program would display a floating point 2D image mapped through a window/level function to display in an 8 bit grayscale graphics window. For example the original floating point data could have a dynamic range of -100 to 800 and to enhance the contrast in the image we may want to concentrate the grayscale to the range of 300 to 500. In this case the 'window' would be 200 and the 'level' would be 400. For display we would create an unsigned char buffer where the pixels would be defined as:
min = level-(window/2.); max = min + window; slope = 255./window; if (floats[i] < min) bytes[i] = 0; else if (floats[i] > max) bytes[i] = 255; else bytes[i] = int ((floats[i] - min) * slope);
The user should be given sliders for window and level or, even better, a ctkRangeWidget as shown here.
Things to describe with this example:
- hooking up signals and slots from the slider
- integrating the custom range widget
- drawing an image with Qt graphics
Dynamic GUI Layout
Sometimes our modules will need to present different information depending on the underlying data type of the nodes associated with the modules. The Volumes module currently encapsulates information for grey scale scalar volumes, label map scalar volumes, DWI volumes, DTI volumes and the GUI updates when you select a specific volume from the scene. For instance, a label map volume version of the GUI will only show one piece of information (the colour map used for display), while the grey scale volume version will show the colour map, as well as a historgram, window and level range widgets. How can we best manage the disparate gui elements that must be shown and then hidden depending on the properties of a selector widget?
Layout for complex GUIs, with consistent cross platform appearance
For some of the more complex GUIs in Slicer, we have a combination of information to display and operations to expose. For example in the Fiducials GUI, we display information about the points in the list, and allow users to click on the point information to perform functions with them (such as jumping to that location). There are multiple lists available to display, and operations that can work on all lists or just the one selected.
We want to be able to use the Qt designer to quickly lay out complex guis with both information and operations, and to ensure that the GUIs look uniform across different platforms. It would be useful to have a detailed list of which widgets will take on radically different appearances depending on the platform on which Slicer is running.
Day-to-Day Code Development
- What are the best ways to debug Qt data structures from within visual studio?
- How to customize IDEs to produce code that conforms to Qt style?
- (for the Kitware and Qt developers:) conventions for mixing VTK and Qt
- file naming (.cxx vs .cpp)
- method naming (Get/Set vs set)
- Macros and private implementation conventions