lyx_mirror/src/frontends/qt3
Bo Peng c8e5ee867f load files from lyx_main.C instead of lyx_gui.C, do not add session-restored files to lastfile list.
* src/frontends/lyx_gui.h: add prototype for create_view
	* src/frontends/(gtk,qt3,qt4)/lyx_gui.C: separate start()
	* src/lyx_main.C: call create_view, load file, and call start


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14500 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-27 14:13:45 +00:00
..
moc * src/frontends/qt3/moc/Makefile.am: Remove extra qt3 include path 2006-05-02 13:07:38 +00:00
ui merge booktabs branch 2006-07-03 19:13:56 +00:00
Alert_pimpl.C
BulletsModule.C delete some emits that I missed, add comments about emitting signals 2006-06-30 14:11:50 +00:00
BulletsModule.h
ChangeLog merge booktabs branch 2006-07-03 19:13:56 +00:00
checkedwidgets.C
checkedwidgets.h
Dialogs.C * gtk/lyx_gui.C: 2006-07-10 18:58:44 +00:00
emptytable.C delete some emits that I missed, add comments about emitting signals 2006-06-30 14:11:50 +00:00
emptytable.h
FileDialog_private.C
FileDialog_private.h
FileDialog.C
floatplacement.C delete some emits that I missed, add comments about emitting signals 2006-06-30 14:11:50 +00:00
floatplacement.h
GuiClipboard.C Split clipboard and X selection 2006-07-10 11:32:25 +00:00
GuiClipboard.h Split clipboard and X selection 2006-07-10 11:32:25 +00:00
GuiImplementation.h Split clipboard and X selection 2006-07-10 11:32:25 +00:00
GuiSelection.C Split clipboard and X selection 2006-07-10 11:32:25 +00:00
GuiSelection.h Split clipboard and X selection 2006-07-10 11:32:25 +00:00
GuiWorkArea.h GUI API Cleanup step 2: merge of the "younes" branch. 2006-06-26 16:55:35 +00:00
iconpalette.C delete some emits that I missed, add comments about emitting signals 2006-06-30 14:11:50 +00:00
iconpalette.h
lcolorcache.C
lcolorcache.h
lengthcombo.C delete some emits that I missed, add comments about emitting signals 2006-06-30 14:11:50 +00:00
lengthcombo.h
lyx_gui.C load files from lyx_main.C instead of lyx_gui.C, do not add session-restored files to lastfile list. 2006-07-27 14:13:45 +00:00
LyXKeySymFactory.C
Makefile.am Split clipboard and X selection 2006-07-10 11:32:25 +00:00
Makefile.dialogs The Grand Font Selection Redesign: 2006-06-19 08:10:17 +00:00
panelstack.C
panelstack.h
pch.h
QAbout.C
QAbout.h
QAboutDialog.C
QAboutDialog.h
QBibitem.C
QBibitem.h
QBibitemDialog.C
QBibitemDialog.h
QBibtex.C
QBibtex.h
QBibtexDialog.C
QBibtexDialog.h
QBox.C
QBox.h
QBoxDialog.C
QBoxDialog.h
QBranch.C
QBranch.h
QBranchDialog.C
QBranchDialog.h
QBrowseBox.C delete some emits that I missed, add comments about emitting signals 2006-06-30 14:11:50 +00:00
QBrowseBox.h
QChanges.C
QChanges.h
QChangesDialog.C
QChangesDialog.h
QCharacter.C
QCharacter.h
QCharacterDialog.C
QCharacterDialog.h
QCitation.C
QCitation.h
QCitationDialog.C
QCitationDialog.h
qcoloritem.C
qcoloritem.h
QCommandBuffer.C delete some emits that I missed, add comments about emitting signals 2006-06-30 14:11:50 +00:00
QCommandBuffer.h
QCommandEdit.C delete some emits that I missed, add comments about emitting signals 2006-06-30 14:11:50 +00:00
QCommandEdit.h
QContentPane.C Let Meta be an alias for Alt 2006-07-09 17:30:21 +00:00
QContentPane.h This is the merging of the GUI API cleanup branch that was developed in svn+ssh://svn.lyx.org/lyx/lyx-devel/branches/personal/younes. 2006-06-20 08:39:16 +00:00
QDelimiterDialog.C Implement GUI for fixed size math delimiters (by Enrico Forestieri and me): 2006-05-07 10:51:19 +00:00
QDelimiterDialog.h Implement GUI for fixed size math delimiters (by Enrico Forestieri and me): 2006-05-07 10:51:19 +00:00
QDialogView.C
QDialogView.h
QDocument.C * readd accidentally removed code (rev 14143) 2006-06-22 09:25:02 +00:00
QDocument.h
QDocumentDialog.C The Grand Font Selection Redesign: 2006-06-19 08:10:17 +00:00
QDocumentDialog.h The Grand Font Selection Redesign: 2006-06-19 08:10:17 +00:00
QErrorList.C
QErrorList.h
QErrorListDialog.C
QErrorListDialog.h
QERT.C
QERT.h
QERTDialog.C
QERTDialog.h
QExternal.C
QExternal.h
QExternalDialog.C
QExternalDialog.h
QFloat.C
QFloat.h
QFloatDialog.C
QFloatDialog.h
qfont_loader.C use our own font width cache with Qt/Mac 2006-06-16 14:39:52 +00:00
qfont_loader.h use our own font width cache with Qt/Mac 2006-06-16 14:39:52 +00:00
qfont_metrics.C
qfontexample.C
qfontexample.h
QGraphics.C
QGraphics.h
QGraphicsDialog.C
QGraphicsDialog.h
QInclude.C
QInclude.h
QIncludeDialog.C
QIncludeDialog.h
QIndex.C
QIndex.h
QIndexDialog.C
QIndexDialog.h
QLImage.C
QLImage.h
qlkey.h
QLMenubar.C
QLMenubar.h
QLog.C
QLog.h
QLogDialog.C
QLogDialog.h
QLPainter.C delete Painter::fillPolygon() and associated frontend implementations 2006-07-10 15:14:29 +00:00
QLPainter.h delete Painter::fillPolygon() and associated frontend implementations 2006-07-10 15:14:29 +00:00
QLPopupMenu.C
QLPopupMenu.h
QLPrintDialog.C
QLPrintDialog.h
QLToolbar.C
QLToolbar.h
QLyXKeySym.C
QLyXKeySym.h
QMath.C
QMath.h
QMathDialog.C
QMathDialog.h
QMathMatrixDialog.C
QMathMatrixDialog.h
QNote.C Remove quite a few compiler warnings: 2006-07-06 08:18:51 +00:00
QNote.h
QNoteDialog.C Add support for framed.sty 2006-06-03 16:46:27 +00:00
QNoteDialog.h
QParagraph.C
QParagraph.h
QParagraphDialog.C
QParagraphDialog.h
QPrefs.C remove xforms relicts 2006-07-08 09:40:15 +00:00
QPrefs.h
QPrefsDialog.C Renaming: 2006-06-27 10:51:24 +00:00
QPrefsDialog.h Renaming: 2006-06-27 10:51:24 +00:00
QPrint.C
QPrint.h
QRef.C
QRef.h
QRefDialog.C
QRefDialog.h
qscreen.C GUI API Cleanup step 2: merge of the "younes" branch. 2006-06-26 16:55:35 +00:00
qscreen.h Fix some WorkArea fallouts 2006-07-09 01:08:47 +00:00
QSearch.C
QSearch.h
QSearchDialog.C
QSearchDialog.h
QSendto.C
QSendto.h
QSendtoDialog.C
QSendtoDialog.h
qsetborder.C delete some emits that I missed, add comments about emitting signals 2006-06-30 14:11:50 +00:00
qsetborder.h
QShowFile.C
QShowFile.h
QShowFileDialog.C
QShowFileDialog.h
QSpellchecker.C Patch from Martin Vermeer for bug 2218. 2006-06-27 12:20:16 +00:00
QSpellchecker.h
QSpellcheckerDialog.C
QSpellcheckerDialog.h
Qt2BC.C
Qt2BC.h
qt_helpers.C
qt_helpers.h
QTabular.C merge booktabs branch 2006-07-03 19:13:56 +00:00
QTabular.h
QTabularCreate.C
QTabularCreate.h
QTabularCreateDialog.C
QTabularCreateDialog.h
QTabularDialog.C merge booktabs branch 2006-07-03 19:13:56 +00:00
QTabularDialog.h merge booktabs branch 2006-07-03 19:13:56 +00:00
QTexinfo.C
QTexinfo.h
QTexinfoDialog.C
QTexinfoDialog.h
QThesaurus.C
QThesaurus.h
QThesaurusDialog.C
QThesaurusDialog.h
QtLyXView.h
QToc.C Change capitalization for outline (DOWN -> Down etc.) 2006-04-28 07:28:10 +00:00
QToc.h
QTocDialog.C
QTocDialog.h
qttableview.C
qttableview.h
qtTimeout.C This is the merging of the GUI API cleanup branch that was developed in svn+ssh://svn.lyx.org/lyx/lyx-devel/branches/personal/younes. 2006-06-20 08:39:16 +00:00
qtTimeout.h This is the merging of the GUI API cleanup branch that was developed in svn+ssh://svn.lyx.org/lyx/lyx-devel/branches/personal/younes. 2006-06-20 08:39:16 +00:00
QtView.C GUI API Cleanup step 3: merge with "younes" branch. 2006-07-13 16:37:55 +00:00
QtView.h GUI API Cleanup step 3: merge with "younes" branch. 2006-07-13 16:37:55 +00:00
QURL.C
QURL.h
QURLDialog.C
QURLDialog.h
QViewSource.C
QViewSource.h
QViewSourceDialog.C
QViewSourceDialog.h
QVSpace.C
QVSpace.h
QVSpaceDialog.C
QVSpaceDialog.h
QWorkArea.C Move more methods from WorkArea to Clipboard in qt3 and gtk 2006-07-08 15:11:18 +00:00
QWorkArea.h Move more methods from WorkArea to Clipboard in qt3 and gtk 2006-07-08 15:11:18 +00:00
QWrap.C
QWrap.h
QWrapDialog.C
QWrapDialog.h
README
socket_callback.C
socket_callback.h
validators.C
validators.h

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_

Don't #undef emit - #include "QtLyXView.h" instead

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.