lyx_mirror/src/frontends/qt4
André Pönitz fee6fea248 some controller simplification
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20871 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-09 19:52:34 +00:00
..
ui small cleanup 2007-10-05 11:58:34 +00:00
Action.cpp shuffle some code around 2007-10-03 18:56:37 +00:00
Action.h
alert_pimpl.cpp
BulletsModule.cpp
BulletsModule.h
ButtonController.cpp
ButtonController.h
ColorCache.cpp
ColorCache.h
Dialogs.cpp remove unneeded #include 2007-10-07 20:36:09 +00:00
DialogView.h some controller simplification 2007-10-09 19:52:34 +00:00
DockView.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
EmptyTable.cpp
EmptyTable.h
FileDialog.cpp
FloatPlacement.cpp
FloatPlacement.h
GuiAbout.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiAbout.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiApplication.cpp
GuiApplication.h
GuiBibitem.cpp some refactoring 2007-10-07 14:44:41 +00:00
GuiBibitem.h move stuff around. probably not the final destination... 2007-10-07 21:14:24 +00:00
GuiBibtex.cpp one more 2007-10-07 18:40:01 +00:00
GuiBibtex.h one more 2007-10-07 18:40:01 +00:00
GuiBox.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiBox.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiBranch.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiBranch.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiBranches.cpp next one 2007-10-06 22:43:21 +00:00
GuiBranches.h
GuiChanges.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiChanges.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiCharacter.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiCharacter.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiCitation.cpp some refactoring 2007-10-07 14:59:01 +00:00
GuiCitation.h one more 2007-10-07 18:40:01 +00:00
GuiClipboard.cpp
GuiClipboard.h
GuiCommandBuffer.cpp one more 2007-10-07 18:40:01 +00:00
GuiCommandBuffer.h one more 2007-10-07 18:40:01 +00:00
GuiCommandEdit.cpp
GuiCommandEdit.h
GuiDelimiter.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiDelimiter.h math stuff 2007-10-07 20:34:09 +00:00
GuiDialog.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiDialog.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiDocument.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiDocument.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiEmbeddedFiles.cpp set eol-style. 2007-10-09 06:38:07 +00:00
GuiEmbeddedFiles.h set eol-style. 2007-10-09 06:38:07 +00:00
GuiErrorList.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiErrorList.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiERT.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiERT.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiExternal.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiExternal.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiFloat.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiFloat.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiFontExample.cpp
GuiFontExample.h
GuiFontLoader.cpp
GuiFontLoader.h
GuiFontMetrics.cpp Add a FIXME and a hint for implementation of surrogate pair metric problem. 2007-10-08 08:55:21 +00:00
GuiFontMetrics.h
GuiGraphics.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiGraphics.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiGraphicsUi.h
GuiImage.cpp
GuiImage.h
GuiImplementation.cpp
GuiImplementation.h
GuiInclude.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiInclude.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiIndex.cpp some refactoring 2007-10-07 14:59:01 +00:00
GuiIndex.h some refactoring 2007-10-07 14:59:01 +00:00
GuiKeySymbol.cpp cosmetics 2007-10-02 21:51:54 +00:00
GuiKeySymbol.h cosmetics 2007-10-02 21:51:54 +00:00
GuiListings.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiListings.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiLog.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiLog.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiMath.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiMath.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiMathMatrix.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiMathMatrix.h math stuff 2007-10-07 20:34:09 +00:00
GuiMenubar.cpp
GuiMenubar.h
GuiNomencl.cpp next ones 2007-10-07 14:41:49 +00:00
GuiNomencl.h next ones 2007-10-07 14:41:49 +00:00
GuiNote.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiNote.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiPainter.cpp
GuiPainter.h
GuiParagraph.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiParagraph.h math stuff 2007-10-07 20:34:09 +00:00
GuiPopupMenu.cpp
GuiPopupMenu.h
GuiPrefs.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiPrefs.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiPrint.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiPrint.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiRef.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiRef.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiSearch.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiSearch.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiSelection.cpp
GuiSelection.h
GuiSelectionManager.cpp
GuiSelectionManager.h
GuiSendto.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiSendto.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiSetBorder.cpp
GuiSetBorder.h
GuiShowFile.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiShowFile.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiSpellchecker.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiSpellchecker.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiTabular.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiTabular.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiTabularCreate.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiTabularCreate.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiTexinfo.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiTexinfo.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiThesaurus.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiThesaurus.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiToc.cpp Fix memory leak. 2007-10-09 09:29:27 +00:00
GuiToc.h Fix memory leak. 2007-10-09 09:29:27 +00:00
GuiToolbar.cpp math stuff 2007-10-07 20:34:09 +00:00
GuiToolbar.h
GuiToolbars.cpp
GuiToolbars.h
GuiURL.cpp next ones 2007-10-07 14:41:49 +00:00
GuiURL.h next ones 2007-10-07 14:41:49 +00:00
GuiView.cpp * GuiToc: make it work. 2007-10-09 08:06:36 +00:00
GuiView.h Move TabWidget related code to TabWorkArea class in GuiWorkArea.{cpp,h} 2007-10-06 15:48:58 +00:00
GuiViewSource.cpp * GuiViewSource: port back to DockView. 2007-10-09 09:43:56 +00:00
GuiViewSource.h * GuiViewSource: port back to DockView. 2007-10-09 09:43:56 +00:00
GuiVSpace.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiVSpace.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiWorkArea.cpp Transfer some more code from GuiView to TabWorkArea. 2007-10-07 08:12:20 +00:00
GuiWorkArea.h remove X11's namespace pollution 2007-10-08 19:36:15 +00:00
GuiWrap.cpp move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
GuiWrap.h move Controller inheritance further up the tree 2007-10-09 19:34:27 +00:00
IconPalette.cpp
IconPalette.h
InsertTableWidget.cpp
InsertTableWidget.h
LaTeXHighlighter.cpp set eol-style. 2007-10-09 06:39:53 +00:00
LaTeXHighlighter.h move LaTeXHighlighte 2007-10-06 19:03:41 +00:00
LengthCombo.cpp
LengthCombo.h
LyXFileDialog.cpp
LyXFileDialog.h
Makefile.am some controller simplification 2007-10-09 19:52:34 +00:00
PanelStack.cpp
PanelStack.h
pch.h
qlkey.h
qt_helpers.cpp
qt_helpers.h
README
TocModel.cpp
TocModel.h
TocWidget.cpp next one 2007-10-06 20:54:31 +00:00
TocWidget.h next one 2007-10-06 20:54:31 +00:00
Validator.cpp one more 2007-10-07 08:55:20 +00:00
Validator.h

This file contains some do's and dont's for the Qt4 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
changed(). If you are using a more complicated thing anyway,
then remember to call 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, but this must be done in the derived class's
constructor, and use _("..."). Non-trivial means that things like "OK"
/must not/ have a tooltip.

moc needs a fully qualified "std::string" for .connect() statements
to work. Be very, very careful.

Remember to check tab order on a dialog (third icon, with blue bars in
designer).

Remember to check sensible resizing behaviour on a dialog. This is
usually done by adding a top-level layout to the dialog in Designer.

Remember to use Edit->Check Accelerators

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 slotOK() etc. Refer to close/cancel as close in the
source.

Override update_contents() to update the dialog, not update().  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_

Naming conventions
------------------

QFoo.{cpp,h}     The file that interacts with the controller _and_
the implementation of the dialog, derived from the generated files
ui/FooDialog.ui  The designer file
ui_FooDialog.h   Generated files from FooDialog.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
GB - group box
LA - label
LC - LengthCombo
LV - QListView
ML - QTextBrowser
PB - push button
RB - radio button
SB - spin box
SL - slider
TE - text edit
TW - tree widget (FIXME: also TV in some files)


Qt, Unicode, and LyX
--------------------

LyX uses a different encoding (UCS4) than Qt (UTF16), therefore there are a
number of conversion functions in qt_helpers.{cpp,h}. Read the doxygen
documentation for details when to use which function.

Additionally, you should follow these simple rules :

o Use qt_() not _() in code
o Use the conversion functions of qt_helpers.h, NOT .latin1() / .c_str() etc.