lyx_mirror/src/frontends/qt4
Abdelrazak Younes 3c296efd19 simplify paintText() interface.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15590 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-28 09:59:43 +00:00
..
ui Layout improvements 2006-10-24 17:52:37 +00:00
Action.C This commit cleans up everything related to singleton. The other important change is that lyx::dispatch() and lyx::getStatus become _the_ official way to use LyXFunc equivalent methods. 2006-10-11 17:24:46 +00:00
Action.h more unicode Work: Menubar and Toolbar. 2006-10-09 12:30:55 +00:00
Alert_pimpl.C * Gui.h: new closeAll() pure virtual method. 2006-10-24 15:01:07 +00:00
BulletsModule.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
BulletsModule.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
ChangeLog
checkedwidgets.C
checkedwidgets.h
ColorCache.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
ColorCache.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
Dialogs.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
emptytable.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
emptytable.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
FileDialog_private.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
FileDialog_private.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
FileDialog.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
FloatPlacement.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
FloatPlacement.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
GuiApplication.C * Gui.h: new closeAll() pure virtual method. 2006-10-24 15:01:07 +00:00
GuiApplication.h new LFUN_WINDOW_CLOSE 2006-10-23 16:29:24 +00:00
GuiClipboard.C Fix clipboard/selection encoding 2006-09-03 07:02:38 +00:00
GuiClipboard.h Fix clipboard/selection encoding 2006-09-03 07:02:38 +00:00
GuiFontLoader.C - Do not use kerning, because that fucks up cursor positioning for good 2006-10-22 13:10:12 +00:00
GuiFontLoader.h This commit is a big rework of the FontLoader/FontMetrics interaction. Only Qt4 for now, I would be grateful is somebody steps up for qt3 and gtk. 2006-10-07 16:15:06 +00:00
GuiFontMetrics.C replace the map based width cache with an array based one. 2006-10-27 22:46:36 +00:00
GuiFontMetrics.h delete unused code and comment. 2006-10-28 09:19:37 +00:00
GuiImplementation.C * Gui.h: new closeAll() pure virtual method. 2006-10-24 15:01:07 +00:00
GuiImplementation.h * Gui.h: new closeAll() pure virtual method. 2006-10-24 15:01:07 +00:00
GuiSelection.C Fix clipboard/selection encoding 2006-09-03 07:02:38 +00:00
GuiSelection.h Fix clipboard/selection encoding 2006-09-03 07:02:38 +00:00
GuiView.C class session reorganization 2006-10-27 14:18:03 +00:00
GuiView.h This commit fixes 3 crashes when reverting a document: 2006-10-26 13:29:10 +00:00
GuiWorkArea.C simplify paintText() interface. 2006-10-28 09:59:43 +00:00
GuiWorkArea.h stop/start the blinking cursor when the WorkArea get a focusInEvent or focusOutEvent. 2006-10-27 23:26:52 +00:00
iconpalette.C cosmetics 2006-10-22 17:58:09 +00:00
iconpalette.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
InsertTableWidget.C This commit cleans up everything related to singleton. The other important change is that lyx::dispatch() and lyx::getStatus become _the_ official way to use LyXFunc equivalent methods. 2006-10-11 17:24:46 +00:00
InsertTableWidget.h
lengthcombo.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
lengthcombo.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
LyXKeySymFactory.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
Makefile.am compile fix. 2006-10-25 07:48:48 +00:00
Makefile.dialogs compile fix. 2006-10-25 07:48:48 +00:00
panelstack.C - implement sizeHint() 2006-10-24 11:32:20 +00:00
panelstack.h - implement sizeHint() 2006-10-24 11:32:20 +00:00
pch.h
QAbout.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QAbout.h
QAboutDialog.C
QAboutDialog.h
QBibitem.C Use the new InsetCommandParams interface (frontend part), from Ugras and me 2006-10-20 13:53:43 +00:00
QBibitem.h
QBibitemDialog.C
QBibitemDialog.h
QBibtex.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QBibtex.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QBibtexDialog.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QBibtexDialog.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QBox.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QBox.h
QBoxDialog.C
QBoxDialog.h
QBranch.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QBranch.h
QBranchDialog.C
QBranchDialog.h
QBranches.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QBranches.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QChanges.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QChanges.h
QChangesDialog.C
QChangesDialog.h
QCharacter.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QCharacter.h
QCharacterDialog.C
QCharacterDialog.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QCitation.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QCitation.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QCitationDialog.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QCitationDialog.h
QCommandBuffer.C make macrfos readable again 2006-10-22 14:37:32 +00:00
QCommandBuffer.h make macrfos readable again 2006-10-22 14:37:32 +00:00
QCommandEdit.C make macrfos readable again 2006-10-22 14:37:32 +00:00
QCommandEdit.h make macrfos readable again 2006-10-22 14:37:32 +00:00
QDelimiterDialog.C Fix some glitches with fixed size delimiters 2006-10-20 10:43:53 +00:00
QDelimiterDialog.h
QDialogView.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QDialogView.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QDocument.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QDocument.h
QDocumentDialog.C Restore inputenc support 2006-10-26 15:01:45 +00:00
QDocumentDialog.h
QErrorList.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QErrorList.h
QErrorListDialog.C
QErrorListDialog.h
QERT.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QERT.h
QERTDialog.C
QERTDialog.h
QExternal.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QExternal.h
QExternalDialog.C This commit is converting everything related to browsing to unicode (qt4 only). 2006-10-09 16:33:20 +00:00
QExternalDialog.h
QFloat.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QFloat.h
QFloatDialog.C
QFloatDialog.h
qfontexample.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
qfontexample.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QGraphics.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QGraphics.h
QGraphicsDialog.C This commit is converting everything related to browsing to unicode (qt4 only). 2006-10-09 16:33:20 +00:00
QGraphicsDialog.h
QGraphicsUi.h
QInclude.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QInclude.h
QIncludeDialog.C
QIncludeDialog.h
QIndex.C Use the new InsetCommandParams interface (frontend part), from Ugras and me 2006-10-20 13:53:43 +00:00
QIndex.h Patch 1 Log: 2006-10-09 10:35:14 +00:00
QIndexDialog.C
QIndexDialog.h
QLImage.C
QLImage.h
qlkey.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QLMenubar.C MacOSX compilation fix. 2006-10-04 09:34:56 +00:00
QLMenubar.h Change MenuBackend and the other menuclasses to store a docstring. Do the required updates to lstrings/convert. 2006-09-09 22:27:22 +00:00
QLog.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QLog.h
QLogDialog.C
QLogDialog.h
QLPainter.C remove paperHeight() and paperWidth() in Painter and inherited classes. 2006-10-28 09:36:22 +00:00
QLPainter.h remove paperHeight() and paperWidth() in Painter and inherited classes. 2006-10-28 09:36:22 +00:00
QLPopupMenu.C This commit transfers the singletons defined in the Application class to the private LyX::Singletons implementation. It also put the session_ member and top_level_keymap global variable into this Singleton structure. 2006-10-19 07:20:32 +00:00
QLPopupMenu.h Change MenuBackend and the other menuclasses to store a docstring. Do the required updates to lstrings/convert. 2006-09-09 22:27:22 +00:00
QLPrintDialog.C This commit is converting everything related to browsing to unicode (qt4 only). 2006-10-09 16:33:20 +00:00
QLPrintDialog.h
QLToolbar.C - Comments 2006-10-20 19:40:02 +00:00
QLToolbar.h more unicode Work: Menubar and Toolbar. 2006-10-09 12:30:55 +00:00
QLyXKeySym.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QLyXKeySym.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QMath.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QMath.h
QMathDialog.C This commit is purely mechanical and get rid of lyx_gui.[Ch]. 2006-10-12 14:10:13 +00:00
QMathDialog.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QMathMatrixDialog.C
QMathMatrixDialog.h
QNote.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QNote.h
QNoteDialog.C
QNoteDialog.h
QParagraph.C Change (and fix) the bullets in itemize to be more unicode friendly. 2006-10-20 19:26:23 +00:00
QParagraph.h
QParagraphDialog.C
QParagraphDialog.h
QPrefs.C This commit is purely mechanical and get rid of lyx_gui.[Ch]. 2006-10-12 14:10:13 +00:00
QPrefs.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QPrefsDialog.C - Do not use kerning, because that fucks up cursor positioning for good 2006-10-22 13:10:12 +00:00
QPrefsDialog.h more unicode work. 2006-10-09 12:07:05 +00:00
QPrint.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QPrint.h
QRef.C Use the new InsetCommandParams interface (frontend part), from Ugras and me 2006-10-20 13:53:43 +00:00
QRef.h Convert labels to unicode 2006-10-12 10:50:45 +00:00
QRefDialog.C
QRefDialog.h
QSearch.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QSearch.h
QSearchDialog.C
QSearchDialog.h
QSendto.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QSendto.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QSendtoDialog.C
QSendtoDialog.h
qsetborder.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
qsetborder.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QShowFile.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QShowFile.h
QShowFileDialog.C
QShowFileDialog.h
QSpellchecker.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QSpellchecker.h
QSpellcheckerDialog.C
QSpellcheckerDialog.h
Qt2BC.C even more unicode work... 2006-10-09 13:28:32 +00:00
Qt2BC.h even more unicode work... 2006-10-09 13:28:32 +00:00
qt_helpers.C microoptimization 2006-10-22 19:33:37 +00:00
qt_helpers.h microoptimization 2006-10-22 19:33:37 +00:00
QTabular.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QTabular.h
QTabularCreate.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QTabularCreate.h
QTabularCreateDialog.C
QTabularCreateDialog.h
QTabularDialog.C add missing lyx:: 2006-10-24 19:05:26 +00:00
QTabularDialog.h
QTexinfo.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QTexinfo.h
QTexinfoDialog.C
QTexinfoDialog.h
QThesaurus.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QThesaurus.h
QThesaurusDialog.C
QThesaurusDialog.h
QToc.C - Fix a crash when IN is clicked multiple time in a single line document. 2006-10-19 14:35:06 +00:00
QToc.h
QTocDialog.C - Fix a crash when IN is clicked multiple time in a single line document. 2006-10-19 14:35:06 +00:00
QTocDialog.h
qtTimeout.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
qtTimeout.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
QURLDialog.C
QURLDialog.h
QViewSource.C - Do not use kerning, because that fucks up cursor positioning for good 2006-10-22 13:10:12 +00:00
QViewSource.h
QViewSourceDialog.C
QViewSourceDialog.h
QVSpace.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QVSpace.h
QVSpaceDialog.C
QVSpaceDialog.h
QWrap.C Patch 1 Log: 2006-10-09 10:35:14 +00:00
QWrap.h
QWrapDialog.C
QWrapDialog.h
README
socket_callback.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
socket_callback.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00
TocModel.C Introduce wide streams. This fixes the remaining problems of plain text 2006-10-11 19:40:50 +00:00
TocModel.h
UrlView.C Use the new InsetCommandParams interface (frontend part), from Ugras and me 2006-10-20 13:53:43 +00:00
UrlView.h
validators.C move everything into namespace lyx 2006-10-21 00:16:43 +00:00
validators.h move everything into namespace lyx 2006-10-21 00:16:43 +00:00

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, 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.

*DO NOT USE DESIGNER FROM Qt 3*. You must use a designer from Qt 2 to
maintain compatibility.

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/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)


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 isn't unicoded yet. But you should follow these simple rules :

o Use qt_() not _() in code
o Use fromqstr and toqstr NOT .latin1() / .c_str()

Using these functions (in qt_helpers.h) will make sure we use
the right locale for converting to Qt's QString, which is unicode.