lyx_mirror/src/frontends/qt2/README
John Levon 20f2690c6d ref dialog, more updates (BC stuff should now be OK along with the coming
controllers/ patch)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2586 a592a061-630c-0410-9148-cb99ea01b6c8
2001-08-26 00:29:39 +00:00

70 lines
2.3 KiB
Plaintext

This file contains some do's and dont's for the Qt2 frontend.
General rules
-------------
Every editable field that affects the state of the dialog contents
from LyX's point of view should connect its xxxChanged() signal to
a the dialog's changed_adaptor() slot, which in turn should call
form_->changed(). If you are using a more complicated thing anyway,
then remember to call form_->changed() at the end (if it has changed !)
Every non-trivial widget should have a tooltip. If you don't know
what to write, write "FIXME", and it can fixed later. Don't be afraid
to use QWhatsThis too (e.g. the index dialog)
If necessary, you should override Qt2Base::isValid() for determining the validity
of the current dialog's contents.
OK/Apply/Restore/Close should be connected in the derived class's constructor
to call form_->slotOK() etc. Refer to close/cancel as close in the source.
Override update_contents() to update the dialog, not update(), and build_dialog(),
not build(). Only these functions may change dialog widgets that may emit changed()
during initialisation, to prevent the button controller from changing its state.
Never call buttoncontroller functions directly from dialogs. In general, you
should use Qt2Base::changed() in all circumstances. However, if you must call
the buttoncontroller, make sure to respect Qt2Base::updating_
Don't #undef emit - #include "QtLyXView.h" instead
Naming conventions
------------------
QFoo.[Ch] The file that interacts with the controller
QFooDialog.[Ch] The implementation of the dialog, derived from the generated files
ui/QFooDialog.ui The designer file
ui/QFooDialogBase.[Ch] Generated files from QFooDialog.ui
slots should be named e.g. slotFooClicked(), slotFooSelected(), where foo is the name
of the widget.
Widgets should be named like "fooXX", where XX is one of the following
widget types :
CB - check box
CO - combo box
ED - line edit
LA - label
ML -
PB - push button
(FIXME: complete this)
Dialog Maintainer MVC conversion
----------------------------------------------
Character Edwin
Citation Kalle Done
Document Kalle Waiting for MVC
Index Kalle Done
Paragraph Edwin Waiting for MVC
Print Edwin
Ref Kalle Done
Search Edwin
Splash Edwin
Tabular Waiting for MVC
TabularCreate Edwin
Toc Kalle
Url Kalle Done