2010 Summer Project Week Breakout: Getting Started with Qt

From NAMIC Wiki
Jump to: navigation, search
Home < 2010 Summer Project Week Breakout: Getting Started with Qt
 Back to  Project Week Agenda

Session Leader: Adam Weinrich, Nokia

Agenda

PLEASE NOTE THAT THIS PAGE IS CURRENTLY BEING 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)

  1. 5 Nokia's angle
  2. 6 Qt Products and How They All Fit Together
  3. 9 GUI Toolkits and Cross-Platform Libraries
  4. 10 Getting Started with Qt ("Hello World")
  5. 8 Parent/Child Relationship
  6. 10 Linking User Interaction to Application Functionality (signal/slots)
  7. 6 Different Qt Libraries,
  8. 7 Various Widgets,
  9. 8 Model/View Classes
  10. 5 Dialogs
  11. 7 Geometry Management
  12. 3 file I/O
  13. 4 Networking
  14. 6 Graphics
  15. 3 Printing
  16. 3 Database
  17. 3 Multithreading
  18. 3 Multimedia
  19. 8 Painting - Basic Drawing
  20. 7 Main Window and Actions
  21. 3 Printing,
  22. 8 Scrolled Areas
  23. 8 Predefined Dialogs
  24. 8 Custom Dialogs
  25. 7 Geometry Management
  26. 8 Qt Designer (can be left out in the interest of time)
  27. 4 Customized Drawings (Colors, Transparency, Clipping, Coordinate System Transformation)
  28. 3 Text Processing
  29. 8 The Qt Event System (Internal Details, Synthetic Events, Delayed Invocation, Event Filters)
  30. 7 Container Classes
  31. 9 Debugging
  32. 4 Writing Your Own Widget
  33. 7 Help Systems
  34. 7 Tool Tips and What's This
  35. 4 Using Rich Text
  36. 5 Portability
  37. 3 System Resources (Sound, Saving Settings, the System Clipboard, Drag and Drop, Network Programming, External Processes with QProcess)
  38. 4 Emulating MDI with QWorkspace
  39. 7 QGraphicsView
  40. 7 QScrollView
  41. 10 Model/View Programming
    1. 9 Using Convenience Classes (QListWidget, QTreeWidget, QTableWidget)
    2. 9 Stacked Widgets or Layouts
  42. 7 Using OpenGL with Qt
  43. 8 Widget Styles
  44. 5 qmake — Automating Makefile Creation
  45. 7 CMAKE -
  46. 4 Internationalization
  47. 4 XML in Qt
  48. 4 Mulitithreading
  49. 3 SQL
  50. 6 Integrating with Visual Studio
  51. 6 Development Tools for Linux (KDevelop, ...)
  52. 7 Licensing
  53. 6 Deploying Qt Applications
  54. 6 Plugins
  1. 2 Qt4 vs Qt3
  2. 2 Qt vs other toolkits
  3. 7 Qt with Python
  4. 5 Qt Scripting using Javascript
  5. 1 Qt embedded
  6. 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.