lyx_mirror/src/frontends/qt4
Abdelrazak Younes 8ad113c30a Fix bug 4123:
http://bugzilla.lyx.org/show_bug.cgi?id=4123

* GuiView:
- closeEvent(): set quitting=true only when quitting. I don't know why and how this was changed but it was clearly wrong.
- update_view_state_qt(): only update when focus is in. Make sure this is the current LyXView.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19643 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-19 10:48:16 +00:00
..
ui Streamlining CollapseStatus stuff 2007-08-16 16:36:50 +00:00
Action.cpp
Action.h
alert_pimpl.cpp fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
BulletsModule.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
BulletsModule.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
ChangeLog
CheckedLineEdit.cpp
CheckedLineEdit.h
ColorCache.cpp
ColorCache.h
Dialogs.cpp cosmetics + move frontends/* to frontend namespace. 2007-08-14 09:54:59 +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
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
GuiApplication.cpp [the "translation" patch series] Part 4: translating the LyX menu on the mac 2007-08-07 21:23:40 +00:00
GuiApplication.h [the "translation" patch series] Part 4: translating the LyX menu on the mac 2007-08-07 21:23:40 +00:00
GuiClipboard.cpp fix unicode decomposition (bugs 3313 and 3498): 2007-07-05 14:45:00 +00:00
GuiClipboard.h
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 Optimisation: don't search twice the hash tables. 2007-08-13 13:56:54 +00:00
GuiImplementation.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
GuiImplementation.h cosmetics + move frontends/* to frontend namespace. 2007-08-14 09:54:59 +00:00
GuiSelection.cpp fix unicode decomposition (bugs 3313 and 3498): 2007-07-05 14:45:00 +00:00
GuiSelection.h
GuiView.cpp Fix bug 4123: 2007-08-19 10:48:16 +00:00
GuiView.h Probable compile fix. 2007-08-14 13:20:16 +00:00
GuiWorkArea.cpp implement --enable-monolithic-{client,frontend-qt4,controllers}. Careful with frontend-qt4, it takes ~490 MB to build (but 3 instead of 8 minutes...) 2007-08-19 09:44:34 +00:00
GuiWorkArea.h Transfer Drag&Drop handling from GuiWorkArea to GuiView. 2007-08-14 13:14:47 +00:00
IconPalette.cpp Get rid of a few warnings. 2007-08-10 20:14:54 +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
InsertTableWidget.h Whitespace cleanup 2007-05-28 22:27:45 +00:00
KeySymbol.cpp
LengthCombo.cpp
LengthCombo.h
LyXFileDialog.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
LyXFileDialog.h
Makefile.am implement --enable-monolithic-{client,frontend-qt4,controllers}. Careful with frontend-qt4, it takes ~490 MB to build (but 3 instead of 8 minutes...) 2007-08-19 09:44:34 +00:00
PanelStack.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
PanelStack.h
pch.h
QAbout.cpp
QAbout.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QBibitem.cpp
QBibitem.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QBibtex.cpp fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QBibtex.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QBox.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QBox.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QBranch.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QBranch.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QBranches.cpp
QBranches.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QChanges.cpp
QChanges.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QCharacter.cpp
QCharacter.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QCitation.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QCitation.h Whitespace cleanup 2007-05-28 22:27:45 +00:00
QCitationDialog.cpp implement --enable-monolithic-{client,frontend-qt4,controllers}. Careful with frontend-qt4, it takes ~490 MB to build (but 3 instead of 8 minutes...) 2007-08-19 09:44:34 +00:00
QCitationDialog.h Fix bug 4121. The cause was the empty on_available_entered method. Not sure why 2007-08-13 23:25:47 +00:00
QCommandBuffer.cpp * On MacOSX enter is no activation key for a QListWidget. Hence it 2007-06-21 06:38:50 +00:00
QCommandBuffer.h
QCommandEdit.cpp implement --enable-monolithic-{client,frontend-qt4,controllers}. Careful with frontend-qt4, it takes ~490 MB to build (but 3 instead of 8 minutes...) 2007-08-19 09:44:34 +00:00
QCommandEdit.h
QDelimiterDialog.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QDelimiterDialog.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QDialogView.cpp
QDialogView.h
QDocument.cpp Fix Bug 4053: Update other controls allows invalid listings parameters to be passed in listings-related dialogs. 2007-07-27 18:17:00 +00:00
QDocument.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QErrorList.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QErrorList.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QERT.cpp Streamlining CollapseStatus stuff 2007-08-16 16:36:50 +00:00
QERT.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QExternal.cpp Fix bug 2753: LyX doesn't support paths and filenames with parentheses 2007-06-26 16:55:42 +00:00
QExternal.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QFloat.cpp
QFloat.h
QFloatDialog.cpp
QFloatDialog.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QFontExample.cpp
QFontExample.h
QGraphics.cpp Fix bug 2753: LyX doesn't support paths and filenames with parentheses 2007-06-26 16:55:42 +00:00
QGraphics.h
QGraphicsDialog.cpp Fix bug 1749. CAUTION: lyx2lyx not fully working yet (see FIXMEs). 2007-06-25 13:49:51 +00:00
QGraphicsDialog.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QGraphicsUi.h
QInclude.cpp Fix loading non-lyx child documents with relative path names, change 'Load' to 'Edit' in the child document dialog. (Bug 4107 and 4111) 2007-08-07 18:39:34 +00:00
QInclude.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QIndex.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QIndex.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QKeySymbol.cpp Transfer q_key_state() from GuiWorkArea.cpp to QKeySymbol.cpp. This will also be used later in GuiView. 2007-08-14 15:00:09 +00:00
QKeySymbol.h Transfer q_key_state() from GuiWorkArea.cpp to QKeySymbol.cpp. This will also be used later in GuiView. 2007-08-14 15:00:09 +00:00
QLImage.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QLImage.h
QListings.cpp Fix Bug 4053: Update other controls allows invalid listings parameters to be passed in listings-related dialogs. 2007-07-27 18:17:00 +00:00
QListings.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
qlkey.h * src/frontends/qt4/qlkey.h: add AltGr as modifier key (fix bug 4026) 2007-07-18 16:52:52 +00:00
QLMenubar.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QLMenubar.h cosmetics + move frontends/* to frontend namespace. 2007-08-14 09:54:59 +00:00
QLog.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QLog.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QLPainter.cpp disable pixmap cache under X11 2007-08-17 07:14:03 +00:00
QLPainter.h
QLPopupMenu.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QLPopupMenu.h
QLPrintDialog.cpp whitespace 2007-08-12 12:51:00 +00:00
QLPrintDialog.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QLToolbar.cpp Allow unicode in Layout names. 2007-07-11 13:39:08 +00:00
QLToolbar.h cosmetics + move frontends/* to frontend namespace. 2007-08-14 09:54:59 +00:00
QMathMatrixDialog.cpp cosmetics 2007-08-12 12:44:42 +00:00
QMathMatrixDialog.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QNomencl.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QNomencl.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QNote.cpp
QNote.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QParagraph.cpp Make LYX_ALIGN_LAYOUT always be an available layout. This simplifies a couple 2007-08-06 05:04:38 +00:00
QParagraph.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QPrefs.cpp Converted '#warning ...' into FIXME-comments 2007-08-10 11:47:12 +00:00
QPrefs.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QPrint.cpp * src/frontends/qt4/QPrint.cpp: 2007-06-26 16:46:40 +00:00
QPrint.h
QRef.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QRef.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QSearch.cpp cosmetics 2007-08-12 12:44:42 +00:00
QSearch.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QSendto.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QSendto.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QSetBorder.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QSetBorder.h
QShowFile.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QShowFile.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QSpellchecker.cpp
QSpellchecker.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
Qt2BC.cpp
Qt2BC.h
qt_helpers.cpp Get rid of a few warnings. 2007-08-10 20:14:54 +00:00
qt_helpers.h Whitespace cleanup 2007-05-28 22:27:45 +00:00
QTabular.cpp Properly fix bug 3258. 2007-07-18 09:55:33 +00:00
QTabular.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QTabularCreate.cpp whitespace 2007-08-12 12:51:00 +00:00
QTabularCreate.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QTexinfo.cpp
QTexinfo.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QThesaurus.cpp
QThesaurus.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QToc.cpp Whitespace cleanup 2007-05-28 22:27:45 +00:00
QToc.h Whitespace cleanup 2007-05-28 22:27:45 +00:00
QURLDialog.cpp cosmetics (whitespace and no-op functions) 2007-08-12 12:40:11 +00:00
QURLDialog.h cosmetics (whitespace and no-op functions) 2007-08-12 12:40:11 +00:00
QViewSource.cpp compilation fix 2007-08-13 15:22:13 +00:00
QViewSource.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QVSpace.cpp
QVSpace.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
QWrap.cpp Converted '#warning ...' into FIXME-comments 2007-08-10 11:47:12 +00:00
QWrap.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
README
socket_callback.cpp
socket_callback.h
TocModel.cpp Cosmetics. 2007-06-12 12:29:19 +00:00
TocModel.h
TocWidget.cpp implement --enable-monolithic-{client,frontend-qt4,controllers}. Careful with frontend-qt4, it takes ~490 MB to build (but 3 instead of 8 minutes...) 2007-08-19 09:44:34 +00:00
TocWidget.h fix building with automake; break scons, cmake and qmake 2007-08-11 15:48:15 +00:00
UrlView.cpp
UrlView.h
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.