Nowadays all IContext instances of the whole parent hierarchy of the
current focus widget are collected.
Nevertheless it makes sense to just add the current mode's context.
Change-Id: Ia42a693d9b4cd58ac63bb99749b5dfa62f7801aa
Reviewed-by: David Schulz <david.schulz@qt.io>
With e.g. the Extensions mode we add a mode that is probably not
interesting most of the times for most people. The only way to get rid
of modes currently is to disable the plugin that provides it.
Instead add the option to hide modes via the View > Modes menu. Modes
reappear if they are switched to (either via the short cut or other
means, like Debug mode when starting the debugger, or edit mode when
pressing escape often enough).
Change-Id: I56e20849a1f810aea9b5993b04892c915278845f
Reviewed-by: hjk <hjk@qt.io>
When switching between different editors in Design mode (e.g. ui and
qml), the side bar buttons must update. So far they reacted on mode
switches, but not on changes of the main window while staying in the
same mode.
Change-Id: I85635f12bb8613e90ec81056d8763431c04fea2e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Interface was moved to icore.h. The initial worry that lots of code
need changes was apparently unfounded.
Change-Id: I53a494d1ca914c7b1b16500c979029d06f5ab5f6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Partially reverts 6a142dfd95
Looks like this was used by 3rdparty plugin(s) for a mode that is only
useful for some time and then should not be shown again.
Re-add removeMode from before 5.0, but do not trigger that automatically
from the mode destructor, so it doesn't interfere at shutdown.
This patch is just a binary compatible partial revert. Since removeMode
is broken in several aspects (e.g. corresponding commands are not
removed) and we don't really support adding and removing modes during
runtime, this should be replaced later on by a different way to handle
the usecase, like a "visible" property for modes, which could be useful
in other ways too.
Fixes: QTCREATORBUG-26270
Change-Id: Ief2a36d94bd09b0511a14f528b33fdbcc4c4222b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
After the 867c0b8d8a53974074b1fff5b132f3ae9f150066 got integrated
into qtbase, Qt started issuing a warning on Creator shutdown.
The reason is that mode's widget might be deleted before the
mode's destruction. Deleting the mode's widget removes it automatically
from the contained stacked layout of the mode manager. This
means that the indices inside the stacked layout and those inside
the ModeManager's d->m_modes list are now out of sync.
FancyTabWidget::removeTab() can't find the right widget for the
passed index now or returns wrong widget for it.
The fix is to remove removeMode() method (and in turn some more
unused now). The context objects don't need to be removed on
shutdown, and the remaining mode's widgets will be deleted
by Qt itself when the main windows is destroyed.
Fixes: QTCREATORBUG-25925
Change-Id: I70c2773eea2984c5d06ce3bf71a4271b267efbe0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
It was not possible to return false from
ProjectExplorerPlugin::initialize() without triggering crashes.
Change-Id: I96b2f80c835e69769f64f9b9c61f473e9ff88623
Reviewed-by: hjk <hjk@qt.io>
- In the main window, the locator input (actually the status bar)
visually feels like being part of the mode widget, so give
it its context.
- In extra editor windows, the whole editor window should have
"editor manager" context, so that is also active for the locator
input.
Task-number: QTCREATORBUG-20626
Task-number: QTCREATORBUG-20071
Change-Id: Ib68d6a8177446572ea59c3cc057eca0706173e11
Reviewed-by: Xing Xiong
Reviewed-by: David Schulz <david.schulz@qt.io>
This adds an icon-only mode to the mode selection bar (and action bar).
A newly introduced Action can cycle between icon+text, icon-only and
hidden.
Also, the "Window" Application menu gets a submenu with the three
styles.
Task-number: QTCREATORBUG-18845
Change-Id: I4e0c453f6d920dfbfd795b8b054f6ff392a8700a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... instead of adding-by-index. This amends 3d2db474.
Also, simplify the shortcut setting, the loop is not needed
anymore as the mode order is fixed now.
Change-Id: I87959f8b5bc5c3a0cd0ca240fb8709db75aed105
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
cf7f898db3 broke initial mode display due to the then-intentional
delay in registration. Now change the approach: Only record
the modes and the last requested start mode and do all remaining
setup triggered from MainWindow::extensionsInitialized.
This changes behavior insofar as only the last requested mode
on startup (typical Welcome, if Welcome not loaded, Edit) will
be activated.
Change-Id: I62b28342c347938b001c6d3be6a076c5a69b560b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... instead of having the indirection of the global object pool.
ModeManagerPrivate has been maintaining the list of instantiated
modes by tracking (all...) pool object additions / removals. This
can be achieved more directly by calling functions from the
IMode base constructor/destructor.
The pattern used deviates a bit from the otherwise used 'static
QList<Foo *> allFoos();' acessor pattern as there is some sorting
logic etc. associated each time a mode is appended.
Sticking to the preexisting structure seemed less effort for now.
Change-Id: Ic1b4e641e155f949248890acc48cafbe74025115
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Setting the mode means resetting all of the UI and repainting the
whole window. This can be painfully slow if the window contains some
large graphical objects, like QML profiler trace.
Change-Id: I64835de49e482826a54e3a844d59bc747ca38370
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
If modes provide a QMenu, a little arrow is shown next to the mode icon.
If the user clicks there, the menu is shown instead of changing the
mode.
Limitations: Modes need to provide some QMenu instance already when they
are added to the object pool. Setting or removing the menu later will
not update the UI.
Change-Id: Ic4ef709e6200afcff14f41054a5dd98c37b0b849
Reviewed-by: hjk <hjk@theqtcompany.com>
Makes it more uniform to use and allows placeholder widget
creation to be independent of mode creations.
Change-Id: I4021bc9db7f8c78f0374c0cc3b3331506959afe4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
... and default to C_GLOBAL. A rather common case.
Similar for ActionContainer::addSeparator().
Change-Id: I7f9ba573af201c0a472132d5a494ad17cc4175b7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Breaks BC with MSVC2010.
This partially reverts commit fe8ed7f5a6.
Change-Id: I36f995f992f3d12f16900c6dbe1dc94123c188bd
Reviewed-by: hjk <hjk121@nokiamail.com>
This was broken in d52ee686d1.
Task-number: QTCREATORBUG-13098
Change-Id: Ia075e13fdd00e561b78058a3cab0cb02d2eb5fe6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
No-one is using the aggregated IMode, everyone is deriving from IMode
Change-Id: Ic4f21ce983924afe80cc2180101aae838b9f590d
Reviewed-by: Eike Ziller <eike.ziller@digia.com>