mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 02:49:46 +00:00
7c6a6e02c4
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19435 a592a061-630c-0410-9148-cb99ea01b6c8 |
||
---|---|---|
.. | ||
ui | ||
Action.cpp | ||
Action.h | ||
alert_pimpl.cpp | ||
BulletsModule.cpp | ||
BulletsModule.h | ||
ChangeLog | ||
CheckedLineEdit.cpp | ||
CheckedLineEdit.h | ||
ColorCache.cpp | ||
ColorCache.h | ||
Dialogs.cpp | ||
DockView.h | ||
EmptyTable.cpp | ||
EmptyTable.h | ||
FileDialog.cpp | ||
FloatPlacement.cpp | ||
FloatPlacement.h | ||
GuiApplication.cpp | ||
GuiApplication.h | ||
GuiClipboard.cpp | ||
GuiClipboard.h | ||
GuiFontLoader.cpp | ||
GuiFontLoader.h | ||
GuiFontMetrics.cpp | ||
GuiFontMetrics.h | ||
GuiImplementation.cpp | ||
GuiImplementation.h | ||
GuiSelection.cpp | ||
GuiSelection.h | ||
GuiView.cpp | ||
GuiView.h | ||
GuiWorkArea.cpp | ||
GuiWorkArea.h | ||
IconPalette.cpp | ||
IconPalette.h | ||
InsertTableWidget.cpp | ||
InsertTableWidget.h | ||
KeySymbol.cpp | ||
LengthCombo.cpp | ||
LengthCombo.h | ||
LyXFileDialog.cpp | ||
LyXFileDialog.h | ||
Makefile.am | ||
PanelStack.cpp | ||
PanelStack.h | ||
pch.h | ||
QAbout.cpp | ||
QAbout.h | ||
QBibitem.cpp | ||
QBibitem.h | ||
QBibtex.cpp | ||
QBibtex.h | ||
QBox.cpp | ||
QBox.h | ||
QBranch.cpp | ||
QBranch.h | ||
QBranches.cpp | ||
QBranches.h | ||
QChanges.cpp | ||
QChanges.h | ||
QCharacter.cpp | ||
QCharacter.h | ||
QCitation.cpp | ||
QCitation.h | ||
QCitationDialog.cpp | ||
QCitationDialog.h | ||
QCommandBuffer.cpp | ||
QCommandBuffer.h | ||
QCommandEdit.cpp | ||
QCommandEdit.h | ||
QDelimiterDialog.cpp | ||
QDelimiterDialog.h | ||
QDialogView.cpp | ||
QDialogView.h | ||
QDocument.cpp | ||
QDocument.h | ||
QErrorList.cpp | ||
QErrorList.h | ||
QERT.cpp | ||
QERT.h | ||
QExternal.cpp | ||
QExternal.h | ||
QFloat.cpp | ||
QFloat.h | ||
QFloatDialog.cpp | ||
QFloatDialog.h | ||
QFontExample.cpp | ||
QFontExample.h | ||
QGraphics.cpp | ||
QGraphics.h | ||
QGraphicsDialog.cpp | ||
QGraphicsDialog.h | ||
QGraphicsUi.h | ||
QInclude.cpp | ||
QInclude.h | ||
QIndex.cpp | ||
QIndex.h | ||
QKeySymbol.cpp | ||
QKeySymbol.h | ||
QLImage.cpp | ||
QLImage.h | ||
QListings.cpp | ||
QListings.h | ||
qlkey.h | ||
QLMenubar.cpp | ||
QLMenubar.h | ||
QLog.cpp | ||
QLog.h | ||
QLPainter.cpp | ||
QLPainter.h | ||
QLPopupMenu.cpp | ||
QLPopupMenu.h | ||
QLPrintDialog.cpp | ||
QLPrintDialog.h | ||
QLToolbar.cpp | ||
QLToolbar.h | ||
QMathMatrixDialog.cpp | ||
QMathMatrixDialog.h | ||
QNomencl.cpp | ||
QNomencl.h | ||
QNote.cpp | ||
QNote.h | ||
QParagraph.cpp | ||
QParagraph.h | ||
QPrefs.cpp | ||
QPrefs.h | ||
QPrint.cpp | ||
QPrint.h | ||
QRef.cpp | ||
QRef.h | ||
QSearch.cpp | ||
QSearch.h | ||
QSendto.cpp | ||
QSendto.h | ||
QSetBorder.cpp | ||
QSetBorder.h | ||
QShowFile.cpp | ||
QShowFile.h | ||
QSpellchecker.cpp | ||
QSpellchecker.h | ||
Qt2BC.cpp | ||
Qt2BC.h | ||
qt_helpers.cpp | ||
qt_helpers.h | ||
QTabular.cpp | ||
QTabular.h | ||
QTabularCreate.cpp | ||
QTabularCreate.h | ||
QTexinfo.cpp | ||
QTexinfo.h | ||
QThesaurus.cpp | ||
QThesaurus.h | ||
QToc.cpp | ||
QToc.h | ||
qtTimeout.cpp | ||
qtTimeout.h | ||
QURLDialog.cpp | ||
QURLDialog.h | ||
QViewSource.cpp | ||
QViewSource.h | ||
QVSpace.cpp | ||
QVSpace.h | ||
QWrap.cpp | ||
QWrap.h | ||
README | ||
socket_callback.cpp | ||
socket_callback.h | ||
TocModel.cpp | ||
TocModel.h | ||
TocWidget.cpp | ||
TocWidget.h | ||
UrlView.cpp | ||
UrlView.h | ||
Validator.cpp | ||
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 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, 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 is incredibly stupid and sometimes you need 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. 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 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_ Naming conventions ------------------ QFoo.[Ch] The file that interacts with the controller QFooDialog.[Ch] The implementation of the dialog, derived from the generated files ui/FooDialog.ui The designer file ui/FooDialogBase.[Ch] 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) Stuff to be aware of -------------------- The connect statement in Qt is a macro and its arguments does not follow the C++ standard as it should. Using the construct "Type const &" as argument will lead to runtime-errors, use "const Type &" instead. ex. --right-- connect(list, SIGNAL(selected(const QString &)), this, SLOT(complete_selected(const QString &))); --wrong-- connect(list, SIGNAL(selected(QString const &)), this, SLOT(complete_selected(QString const &))); Qt, Unicode, and LyX -------------------- LyX uses a different encoding (UCS4) than Qt (UTF16), therefore there are a number of conversion functions in qt_helpers.[Ch]. 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.