lyx_mirror/src/frontends/qt4
Bo Peng f8422ebb00 Embedding: fix a file selection and a file copy bug
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19986 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 05:36:39 +00:00
..
ui Embedding dialog: use two buttons (will have more) for the actions 2007-09-01 20:48:51 +00:00
Action.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
Action.h move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
alert_pimpl.cpp fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
BulletsModule.cpp Fix ambiguity in translation 2007-08-31 11:09:46 +00:00
BulletsModule.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
ChangeLog move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
CheckedLineEdit.cpp Rename .C ==> .cpp for files in src/frontends/qt4, part two 2007-04-26 03:53:51 +00:00
CheckedLineEdit.h Rename .C ==> .cpp for files in src/frontends/qt4, part two 2007-04-26 03:53:51 +00:00
ColorCache.cpp I guess Windows folks are not too happy with files named color.h and Color.h 2007-04-26 19:21:38 +00:00
ColorCache.h rename LColor into Color 2007-04-26 17:34:20 +00:00
Dialogs.cpp merge GuiBC<.,.> into Qt2BC 2007-09-01 20:44:14 +00:00
DockView.h * added WidgetFlags argument to DockView to set Qt::Drawer flag where needed 2007-05-29 11:38:28 +00:00
EmptyTable.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
EmptyTable.h Rename .C ==> .cpp for files in src/frontends/qt4, part two 2007-04-26 03:53:51 +00:00
FileDialog.cpp add comment and ling to bug 3907. 2007-07-03 08:23:04 +00:00
FloatPlacement.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
FloatPlacement.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
GuiAbout.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiAbout.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiApplication.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiApplication.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiBibitem.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiBibitem.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiBibtex.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiBibtex.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiBox.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiBox.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiBranch.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiBranch.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiBranches.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiBranches.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiChanges.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiChanges.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiCharacter.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiCharacter.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiCitation.cpp somewhat more uniform naming 2007-08-31 22:37:05 +00:00
GuiCitation.h somewhat more uniform naming 2007-08-31 22:37:05 +00:00
GuiClipboard.cpp fix unicode decomposition (bugs 3313 and 3498): 2007-07-05 14:45:00 +00:00
GuiClipboard.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiCommandBuffer.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiCommandBuffer.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiCommandEdit.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiCommandEdit.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiDelimiter.cpp somewhat more uniform naming 2007-08-31 22:37:05 +00:00
GuiDelimiter.h somewhat more uniform naming 2007-08-31 22:37:05 +00:00
GuiDialogView.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiDialogView.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiDocument.cpp This patch continues 19964. It takes advantage of the work there to simplify a few things elsewhere. First, in ControlDocument::dispatchParams(), we're setting the TextClass and then dispatching the BufferParams, which sets it again now. So we can get rid of the first call. This, however, requires loading the TextClass somewhere other than LFUN_TEXTCLASS_APPLY, which I do in BufferParams::setBaseClass(), which is when you'd actually need to do it. So I've moved some of the loading logic there. (It seemed a good idea to make setBaseClass() return whether it was successful, then, though this isn't used at the moment.) 2007-09-01 04:03:24 +00:00
GuiDocument.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiEmbeddedFiles.cpp Embedding: fix a file selection and a file copy bug 2007-09-02 05:36:39 +00:00
GuiEmbeddedFiles.h Embedding dialog: use two buttons (will have more) for the actions 2007-09-01 20:48:51 +00:00
GuiErrorList.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiErrorList.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiERT.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiERT.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiExternal.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiExternal.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiFloat.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiFloat.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiFontExample.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiFontExample.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiFontLoader.cpp * workaround for Qt not selecting a Times font on Mac with Qt 4.3.0. As soon as the 2007-06-04 12:10:30 +00:00
GuiFontLoader.h Whitespace cleanup 2007-05-28 22:27:45 +00:00
GuiFontMetrics.cpp Optimisation: don't search twice the hash tables. 2007-08-13 13:56:54 +00:00
GuiFontMetrics.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiGraphics.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiGraphics.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiGraphicsUi.h move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiImage.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiImage.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiImplementation.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiImplementation.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiInclude.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiInclude.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiIndex.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiIndex.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiKeySymbol.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiKeySymbol.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiListings.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiListings.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiLog.cpp Fix compiling error caused by Andre's patch. 2007-09-01 02:43:14 +00:00
GuiLog.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiMathMatrix.cpp somewhat more uniform naming 2007-08-31 22:37:05 +00:00
GuiMathMatrix.h somewhat more uniform naming 2007-08-31 22:37:05 +00:00
GuiMenubar.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiMenubar.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiNomencl.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiNomencl.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiNote.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiNote.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiPainter.cpp comment out debug info. 2007-09-01 09:26:37 +00:00
GuiPainter.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiParagraph.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiParagraph.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiPopupMenu.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiPopupMenu.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiPrefs.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiPrefs.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiPrint.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiPrint.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiRef.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiRef.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiSearch.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiSearch.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiSelection.cpp fix unicode decomposition (bugs 3313 and 3498): 2007-07-05 14:45:00 +00:00
GuiSelection.h code cosmetics whitespace, unneeded lyx:: qualification, indentation, unneeded destructors and the like 2007-04-25 16:39:21 +00:00
GuiSelectionManager.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiSelectionManager.h move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiSendto.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiSendto.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiSetBorder.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiSetBorder.h move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiShowFile.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiShowFile.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiSpellchecker.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiSpellchecker.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiTabular.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiTabular.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiTabularCreate.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiTabularCreate.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiTexinfo.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiTexinfo.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiThesaurus.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiThesaurus.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiToc.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiToc.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiToolbar.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiToolbar.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiURL.cpp somewhat more uniform naming 2007-08-31 22:37:05 +00:00
GuiURL.h somewhat more uniform naming 2007-08-31 22:37:05 +00:00
GuiView.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiView.h move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiViewSource.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
GuiViewSource.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiVSpace.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiVSpace.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiWorkArea.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiWorkArea.h The BufferView/WorkArea/LyXView reorg a.k.a Multiple WorkAreas: 2007-08-21 07:33:46 +00:00
GuiWrap.cpp Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
GuiWrap.h Merge QController into individual dialogs. Also various cleanup 2007-08-31 22:16:11 +00:00
IconPalette.cpp xpm -> png 2007-08-30 20:09:12 +00:00
IconPalette.h * Get rid the of the QWidgetAction subclass and use homebrew tearoff widget: 2007-06-21 09:51:50 +00:00
InsertTableWidget.cpp Rename .C ==> .cpp for files in src, part one 2007-04-26 04:41:58 +00:00
InsertTableWidget.h Whitespace cleanup 2007-05-28 22:27:45 +00:00
LengthCombo.cpp rename/merge LyXLength related stuff 2007-04-28 12:58:49 +00:00
LengthCombo.h rename/merge LyXLength related stuff 2007-04-28 12:58:49 +00:00
LyXFileDialog.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
LyXFileDialog.h Rename .C ==> .cpp for files in src/frontends/qt4, part two 2007-04-26 03:53:51 +00:00
Makefile.am somewhat more uniform naming 2007-08-31 22:37:05 +00:00
PanelStack.cpp single depth for preference items, 2007-08-30 14:22:56 +00:00
PanelStack.h Rename .C ==> .cpp for files in src/frontends/qt4, part two 2007-04-26 03:53:51 +00:00
pch.h
qlkey.h * src/frontends/qt4/qlkey.h: add AltGr as modifier key (fix bug 4026) 2007-07-18 16:52:52 +00:00
Qt2BC.cpp forgot this 2007-09-01 21:05:31 +00:00
Qt2BC.h merge GuiBC<.,.> into Qt2BC 2007-09-01 20:44:14 +00:00
qt_helpers.cpp Get rid of a few warnings. 2007-08-10 20:14:54 +00:00
qt_helpers.h move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
README renaming in frontends/qt4/ui: s/Q//g 2007-04-24 08:56:28 +00:00
socket_callback.cpp Rename .C ==> .cpp for files in src/frontends/qt4, part two 2007-04-26 03:53:51 +00:00
socket_callback.h
TocModel.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
TocModel.h
TocWidget.cpp move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
TocWidget.h move our stuff off the Q* namespace 2007-08-31 05:53:55 +00:00
Validator.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
Validator.h Whitespace cleanup 2007-05-28 22:27:45 +00:00

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.