setPalette() does not replace the old one but rather adds the
difference. Thus a previous copy of the palette is unnecessary.
Change-Id: I5c06da456b76144efc4a984ccda13c7d2243a7bc
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Generalizes the special handling of font settings, which should only be
applied (on the document) when an editor is or becomes visible.
Change-Id: Icd1e3ba4355e1ff4a837c9679b537cc3f5ed7ea9
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Instead of once per editor.
Also remove a related unused function.
Change-Id: I4bcd86b9b0ec61b87500e546cf2138ec5d854561
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
And remove some unnecessary code in Python editor
Change-Id: I86cde74c244a16d1b36b0ac0e841ef8110ba832f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Lead to annoying behavior that pressing any disabled shortcut with control
modifier would lead to unwanted characters in the editor.
This reverts commit c1ff105a0c.
Change-Id: If61e52be9f11cabeafb46f5d71b901b4eab8e169
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
From the editor widget. Also name them autoIndent/autoReindent to
distinguish from the manual indent functions.
Change-Id: I4e1b9d503f53870b669fee66467e5e567eacefec
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
I couldn't find a situation where this code actually resulted in
performance improvement.
Change-Id: I7d905af36ef11dcba43030dc83670c3d1558f650
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Also when duplicating editors, we don't want to change the document
after construction. Actually at some places (e.g. CppEditorSupport
creation) we don't handle document changes correctly, and we are only
lucky that things still (more or less?) work. Get rid of
BaseTextEditorWidget::duplicateFrom and use copy-constructor style instead.
Change-Id: I7f688b7fcc51d1bb5e222bb333f0d28479b597a6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
First step in never changing the text document after construction,
because that is actually not really supported.
Second step will be to fix that for the editor duplicate() methods too.
Change-Id: I3d112ba0895e7ee7ac6dd8ae2318f0de7d2cebc9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This patch also moves the showMargin and marginColumn settings into a
new settings class.
Change-Id: I676447be751c13ee438edc1e31e5998b999c6771
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
It was never called with a sensible value anyhow, and only complicates things.
Change-Id: I005848700b6c00114d91495670d4a0e15a2d2e64
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
There is a 1-to-1 relationship between BaseTextDocument and QTextDocument,
so it doesn't make sense to do the setup between them in the editor widget.
Move creation of BaseTextDocumentLayout and setting up of 'changed' signal
to BaseTextDocument. This also avoids sending multiple
'changed' signals for a single QTextDocument::modificationChanged signal
in case of splits.
Change-Id: Iaab4fea594c5b50f502fd41c88948fac132de9f1
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Doesn't really make sense to have the additional IDocument *editorDocument()
method.
Change-Id: I0a7420eb1afaa76f63c3f7e9c4b373acf624ffb9
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
The actionHack was used to only forward actions to editors that "belong"
to that action handler instance. That is already clearly defined by the
context that the action handler is created for, so we can just use that
instead.
Change-Id: Ia4c6795c80bb281c1ed258324925f56ca7fd8150
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
And remove the indirection over BaseTextEditorWidget.
Change-Id: I2c570edf46b9ca72a11704ce27d8ae3f2218dcf0
Reviewed-by: David Schulz <david.schulz@digia.com>
Since the changed signal was moved from the editor to the document, we
now need to set up all the connections in the setupDocumentSignals.
Otherwise split editors, which get a different document after creation,
do no longer set up the right connections.
Task-number: QTCREATORBUG-10301
Change-Id: Ifc7b426abf87ab73ea37379c1a55e5af2005fc43
Reviewed-by: David Schulz <david.schulz@digia.com>
Only methods as programming functions are affected. Besides renaming
some actions like "Switch Between Function Declaration/Definition" this
mostly touches (api) code comments.
This is a follow-up patch to commit 872bfb7.
Change-Id: Icb65e8d73b59a022f8885b14df497169543a3b92
Reviewed-by: hjk <hjk121@nokiamail.com>
This reverts commit 36552d17ea because it
broke Ctrl+v among others.
Change-Id: I1c1eecdc9c3e003e96b9c836cd638ead9a3b444d
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
basetexteditor.cpp:6013: warning: C4189: 'ts' : local variable is
initialized but not referenced
Change-Id: Ia5d6531f8dab8debbb41da79f1cdf152ee831676
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Task-number: QTCREATORBUG-10235
Instead of rely on ICodeStylePreferences::destroyed() signal,
when all other objects might be in destruction phase,
clear project code style settings explicitly, when project
closes.
Change-Id: I0dd6675d54c5495d4006acbc9ad12c95f1d0a00c
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
F2 on a virtual function call presents a list of overrides in derived
classes. The function declaration of the static type is shown
immediately at the top.
Task-number: QTCREATORBUG-9611
Change-Id: I80ce906fa06272dc9fbd1662cd17500b8c77067f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Currently the line is completely reintented whenever an autoText
insert is being done (like inserting a matching paren). This is un-
necessary as well as actively harmful.
Unnecessary, because the electric character mechanism is already
supposed to trigger reindents where necessary.
Harmful, because the reindent method that is used does not take care
to preserve explicit user indentation. The electric character reindent
does that (by only changing indentation if the actual current indent
is the same as the previously expected indent).
Change-Id: I19db853b6c30792f867baad919bd4eb9b4c23361
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>