Notes on Migration of Moonlight|3D to Qt 4

Note: This page does no longer contain relevant information. The main part of the Qt 4 migration was finished with the release of Moonlight|3D 0.1.3. It is only kept for archival purposes.

ui.xml

  • move ui.xml to user preferences dir (TODO)
  • let plugins place their UI contributions in the layout tree during plugin load to obtain default layouts (TODO)
  • overwrite these defaults when loading user ui.xml (TODO)
  • during shutdown save layouts to ui.xml should they differ from the default layout generated at startup (saving DONE)
  • make the generated default UI invariant to plugin load order: use "gravity" (north, east, south, west) to define view placement (TODO)
  • make menu ordering invariant to plugin load order by providing extension points as position markers for plugins (DONE)
  • make extension points top level menu items when there is no specific location for them (TODO)
  • menu extension points are described in MoonlightMenuBar

View drag and drop

  • maybe don't use Qt DnD support at all and just use mouse drag and a transparent popup widget (DONE)
  • visual studio has nice icons that appear during view DnD - hotspots too smal, but great idea (DONE)
  • solution: icons and big hotspots with icon highlighting (DONE)
  • need to synchronise the window's FrameLayout with the one in !UIManager somehow (DONE)
  • need to traverse both FrameLayout tree and widget tree somehow (add backpointer to LayoutNode to View class) (DONE)
  • make views anchorable to avoid unwanted DnD (TODO)

QAction framework

  • make use of QAction to the fullest extent possible: what's this, tooltip, status tip, icons, checked (important!) (TODO)
  • extend QAction to Action with an additional setName()/getName() and some sort of group identifier for categorical grouping in the UI (DONE)
  • actions might only be available in certain modes. but that's what mode switch listeners are there for
  • central place to store named actions in !UIManager (DONE)
  • ActionGenerator allows for dynamically generated actions (DONE)
  • TODO: find way to force menu rebuilds/updates (e.g. new camera -> add entry to perspectives in view)
  • hotkey management, make hotkeys configurable (hotkeys may have contexts, Qt has support for this) (TODO)

Toolbars

  • TODO: figure out what support there is in Qt
  • Add toolbar management (TODO)
  • Add toolbar generation, maybe using a contribution approach similar to menu bars (TODO)

Plugin system

  • TODO: make Plugin#load() aware of batch mode? Plugin#load(boolean batch) perhaps? (CHECK)

Property sheet and graph renderer

  • Do 1:1 port as far as possible (DONE)
  • fix that stupid cursor jumping around bug in some property editors! (DONE)

UI Modes

  • Mode class: activate(), deactivate(). getName() (DONE)
  • ModeGroup class to handle mutually exclusive modes: add(), remove() (CHECK)
  • ModeSwitchListener: void modeSwitched(Mode from, Mode, to) (DONE)
  • ModeManager: Mode getCurrentMode(), setMode(Mode mode), setMode(String modeName), getMode(String mode) (DONE)
  • maybe introduce dependencies between mode groups and modes (modes from group a can only be used if mode b is active or so) (CHECK)
  • TODO: figure out when to switch to which modes and how to trigger this (implicit switches e.g. on OG node selection to reenter corresponding edit mode)

Toolchest

  • all new toolchest; the current one is too limited (DONE)
  • seperate hierarchical structure, sorted by tasks (DONE)
  • tools have expandable pane that holds tool-specific settings (DONE)
  • request: make contents context dependent (requires listeners for selections, modes. ...) (CHECK)

Using Qt Text Support

  • rich text support useful for syntax highlighting and help viewer
  • build internal online help viewer based on QTextEdit and QTextDocument (find out how to load files) (TODO)
  • build common syntax highlighting framework for script editor and GLSL editor (DONE)
  • use a factory pattern to generate syntax highlighters on demand (DONE)
  • SyntaxHighlighterManager: registerFactory, unregisterFactory, getByName, getNames (DONE - it's in UIManager)