Commit Graph

5176 Commits

Author SHA1 Message Date
hjk
080cb86761 Core: Pimpl MainWindow
I'd like to disentangle things a bit, and there's quite a bit
non-window-ish stuff here.

Change-Id: Iad1e1d17ccd10b3ffff14251039ae2a5d6bfb675
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-25 08:47:45 +00:00
hjk
4282aff307 Core: Fix saving of session value keys
Amends 621a2850d.

Change-Id: If98ca4022cec76f5945db71dae29b4b9bb030128
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-25 08:31:22 +00:00
hjk
41856dd254 Core: Disentangle SettingsDatabase access
There's nothing inherently tied to the main window here.

Change-Id: I48ae09777a4408fc4c955d23fdee3483d8a97dd0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-21 13:50:02 +00:00
Cristian Adam
957fa89315 Core: Set the SH_Slider_AbsoluteSetButtons style for QSlider
This way when the user clicks on the slider with the mouse the slider
jumps under the mouse and not left and right according to the slider
page.

Change-Id: If36f9d8ea82f5b200e2322758f4fc25aef5e1a04
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-19 17:11:44 +00:00
Eike Ziller
ea47e6cbd7 OutputPane: Show "manage" menu as context menu for the buttons too
Simply makes sense.

Change-Id: I2f68b0bfdea66185c0c70d8e888fe0965276a7ab
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-19 13:12:38 +00:00
Eike Ziller
8a72318c97 OutputPane: Fix wrongly checked button with "Reset to Default"
We only want to set the button "checked" if the Output panes are
visible.

Amends b72f9dc8ef

Change-Id: Ia6fd461338086e141dac09ebf47de09c0635b28b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-19 13:12:22 +00:00
Marcus Tillmanns
5da1f14903 Core: Revert unintended change
Amends: e34762c844

Change-Id: I024b6ae5b65dffe45bacc1f44bba5e8ce41fe49d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-19 11:39:24 +00:00
Christian Kandeler
bdded29b33 qbs build: Improve some base items
Clean-up, simplification and modernization.
Also fix the bugs uncovered by this.

Change-Id: Ia3a77557f10faf9a901540a55fd6c07a2e986bf5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-18 11:50:09 +00:00
Eike Ziller
b72f9dc8ef OutputPane: Add Reset to Default to menu
Resetting the visibility of the buttons to the default.

Change-Id: I0f8bf1cd9c33ac0a318e992526657c564f51f170
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-18 11:10:26 +00:00
Eike Ziller
39fdfc9e0c OutputPane: Modernize menu
Use lambdas instead of user data.

Change-Id: I66585df8de2f1f3ea42f66c6f3b0df7d4d3f3f01
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-18 10:15:27 +00:00
Eike Ziller
b0043ed1ac OutputPane: Use setter for priority and fix default visibility
Do not show the buttons of output views with priority < 0 (instead of
only == -1). Reduce the number of buttons that are shown by default to
the essential ones.

Change-Id: I5b44f18537b3033ce9d616f044a8b54b76988783
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-18 10:14:51 +00:00
Eike Ziller
053c6253b8 OutputPane: Add an id() for the settings
It was using the displayName for the key in the settings (visibility and
shortcut), which is annoying when changing the language.

Change-Id: Iffa784347c59389599c90f468dcba15834599c39
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-18 10:14:42 +00:00
Eike Ziller
409a4c972a OutputPane: Use setter for display name
Change-Id: I2e89fbd052330c9e7124272c2f2fa81a0db94de9
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-18 10:14:35 +00:00
Eike Ziller
431583872a Session: Restore session/open files after initialization
Only restore a session or file from the command line (or the setting)
after initialization is completely done.

Kit restoration moved to delayedInitialize, and before that we cannot
sensibly open a session anyway.

Change-Id: I73b984a8744729ea63af16b1f0161b49a2cd5d55
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-18 09:12:23 +00:00
David Schulz
0b85fc5aa0 ProjectExplorer: reduce the perceived startup time
... by moving restoreKits to the delayed initialize phase.

Change-Id: If72e41b64ee71f2917b3f7a317d9887afc6e29e8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-15 13:08:49 +00:00
hjk
de42485b8f Core: Cosmetics and unused #includes
Change-Id: I5838b7340b9f5fca6d43a49026c8fc82f0d0a494
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-15 10:32:57 +00:00
hjk
4ecf769293 Core: Remove SettingsDatabase QObject base
Was not really needed except for the ownership.

Change-Id: I88e32123cbb85a8217ade9450b5b578845736311
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-15 10:32:44 +00:00
hjk
680d77bc35 Core: Remove some unneeded #include
Change-Id: I642b578964ee18677d344201e47ba45312938807
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-15 10:32:32 +00:00
The Qt Project
8f2221cee8 Merge "Merge remote-tracking branch 'origin/qds/dev'" 2023-09-14 15:41:22 +00:00
Tim Jenssen
1a3a8ecc96 Merge remote-tracking branch 'origin/qds/dev'
Change-Id: Id242ab4ca485527defdcc1555d204e12e50ddb7a
2023-09-14 17:37:24 +02:00
Eike Ziller
e76ec76c0f Remove unused variable
Amends 7f908d737b

Change-Id: I5e28f850c6a4d836ba7c48bd117a91aab64f478c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-14 14:35:25 +00:00
hjk
b5b61480bd Core: Code cosmetics in saveitemsdialog.cpp
Including removing one use of QDir::toNativeSeparators()

Change-Id: I5c1fe7733942d6161bd9dda94195a44c0cfded72
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-14 12:06:54 +00:00
Christian Kandeler
c816a9b523 qbs build: Remove unneeded Project items
Also update type descriptions.

Change-Id: I2b7d8814913cfb72cb8280601338ab763d8fabe6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-14 09:58:01 +00:00
Eike Ziller
1870501443 Delay modifications to MIME database until first use
Initialization of the MIME database takes time, and it is good to avoid
this during startup.
We nevertheless want to apply some modifications to the MIME database, so
we need to delay these modifications until first use. Allow registration
of additional initialization functions. Since the initialization
functions access the MIME database, which does locking for thread-
safety, we need to separate the initialization to outside these locking
functions.

Change-Id: I2b1706347768bcf081644e078ccfa45302d61641
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-13 08:05:21 +00:00
Eike Ziller
dab19c4a8c Use Nanotrace to generate startup performance report
Add various trace points to the code, including the plugin
initialization methods (centrally in plugin manager), code that is
scheduled on the event loop with QTimer::singleShot or
QMetaObject::invokeMethod during initialization, and code that is
triggered from ICore::coreOpened

Can be turned on by configuring with `BUILD_LIBRARY_NANOTRACE=ON`
Run with `-trace <file>` to write trace file. If Nanotrace is not built,
the added code expands to nothing.

Changes in Nanotrace:
- turned generated data to microseconds instead of nanoseconds, because
  that is what Chrome tracing expects
- fixed serialization of duration (needs to be an item of the event, not
  in a "arg" subitem)
- fixed shutdown() to reset the initEvent

Change-Id: I994de82023b820d771e1be0a859ebd8da0b73d4d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-12 07:32:07 +00:00
Eike Ziller
6de236351b EditorManager: Do not instantiate MimeTypes during startup
Which would trigger reading the MIME database, which is not needed at
that point in time. We persist the map of MIME type to custom default
factories via the MIME type names anyway, so just stay with that.

Change-Id: I7570432573b16700e00811fe409d43a2db6c5347
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-11 14:26:46 +00:00
Eike Ziller
2adebd0eb4 Core: Never call QMainWindow::menuBar()
It replaces the global menu bar on macOS (that is a QMenuBar(nullptr))
with a window specific menu bar, resulting in an empty menu bar for Qt
Creator.

Amends a6e779606d

Change-Id: Id6e2c0b9b2dfe4ade88af0f9a6d3b008fed790be
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-09-08 12:39:05 +00:00
Cristian Adam
a6e779606d Core: Add action to hide the menu bar
This will only affect the platforms that do not have a native menu bar
e.g. Windows and Linux excepting Unity.

Fixes: QTCREATORBUG-29498
Change-Id: I17a654cfa50342f3e506bf0a2b14225c4d3a6bee
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-08 07:59:50 +00:00
Artem Sokolovskii
f4e50126b1 Core: Add clearAboutInformation function
Change-Id: Ib6dcc3b963917c096756cbff09541f4e13c8184b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-07 12:12:26 +00:00
Eike Ziller
63927a8d6a ActionManager: Centralize ActionContainer update
Each ActionContainer used to schedule an invokeMethod on the event loop
when it changes, which creates an unnecessary amount of individual
events, especially during startup.

Instead schedule that update through the ActionManager, which then can
schedule a single event that handles all updates up to that time.

Change-Id: Ia193606adc4cfda88df8e45f2027662ca16f2ad3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-09-06 07:52:55 +00:00
Marcus Tillmanns
c14c021e45 Utils: Use QtcSettings
Fixes compile errors with Qt 6.2.4.

Change-Id: Ia97d5fcbeb80ee1242fd4c2425bc7f325dad8953
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-05 08:24:31 +00:00
hjk
a475632c66 Utils: Make TreeViews use setUniformRowHeights by default
When applicable, the flag makes a significant difference in
performacnce. However is easily forgotten in cases where it
is applicable, and cases where it is accidentally used are
easily spotted visually. So arguably, opt-out is a better
default than opt-in.

Change-Id: I88aeb05b42533ba4e23c39573a3ddd016343cd55
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-05 07:24:21 +00:00
hjk
6888d93385 Core: Rename unusual SessionManager pimpl
Left-over from the PE/Core split.

Change-Id: Iea6bffa5487a43eccb04ec677fc558651a8fa997
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-04 13:46:15 +00:00
hjk
c655c1733b Clean up some navigation factory implementation
Change-Id: Ibbff643daf88200d50fb0343dd40b03803074081
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-04 13:13:28 +00:00
hjk
68cdbd9cd0 Core: Hide part of OpenEditors implementation
Change-Id: I4c7a2a62e9395450b44b96a5333135fbed773992
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-04 09:35:58 +00:00
hjk
67212a31ee Utils: Cache theme icon access
These trigger over 120k file exist check on my machine on startup,
just for a handful icons.

Change-Id: Ic73f0783142ed329c2f8c8b852f622e69fc306da
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-01 14:03:33 +00:00
Christian Kandeler
0a058bb657 CppEditor: Consider symbol occurrences in comments
... when renaming.
For local renaming, we consider only function parameters.

Task-number: QTCREATORBUG-12051
Change-Id: I7948d69f11b97663c9bd747ae6241a82dd9bdd82
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-09-01 11:42:17 +00:00
hjk
9679412a23 Replace QFile::exists by QFileInfo::exists
QFile::exists only calls QFileInfo::exists, so this saves one
function call per invocation.

Change-Id: I41cb407345654eeead14455a4955b8b9b015aedc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-01 10:24:31 +00:00
hjk
4132ffd662 Core: Fix action key construction
Amends c7710acadd.

Change-Id: I87c85cae3fa5624ba0c9d8a2c1aec4d3225c7315
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-31 09:31:45 +00:00
hjk
41184bc9fc Utils: Use numberedKey(Key, int) more wildly
Will ease transition to a key class that doen's have ::number()

Change-Id: Ib2f2957c916f41b0731a2033422bfbf7e429bcc8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-30 09:57:23 +00:00
Eike Ziller
9dc9a43f40 Adapt find tool bar input fields to searched widget's font
Adapt the font of the search and replace input fields to the font of the
widget that is searched. This makes it use the text editor font when
searching in the text editor but keeps the "application font" when
searching in other widgets.

Change-Id: I8bd3b5dd3d14ab0e774f7272be236c35abd12de0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-30 08:31:20 +00:00
hjk
c7710acadd Utils: Use Key more widely in QtcSettings
And adapt user code.

Change-Id: I6efe4ebe6823de4cc862f304a57e041b02c40eac
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-30 07:38:02 +00:00
hjk
7fccf02be7 Core: Use QtcSettings in NavigationWidgetFactory::restoreSettings()
Symmetric to saveSettings() now, and allows for central Key conversions
later.

Change-Id: I3fbf81c51197c9882b1f64ef591398b83aa0d633
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-30 06:56:30 +00:00
hjk
e5afe02556 Utils: Register Key/Store related metatypes
Change-Id: If7b0a83febfeb2cb3cfc9ee42b8423453cf3b1c4
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-29 12:16:59 +00:00
David Schulz
4526e1908c Editor: remove duplicated path is empty checks when saving
Change-Id: I1fdaacd44918a63e55bce9f15f3f80782ddcbe55
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-28 13:01:40 +00:00
Eike Ziller
e98cc72980 Editors: Fix that history of editors could grow
The "history of editors" is supposed to contain the order in which files/
documents were recently accessed. It is used for the "open documents
window" (the Ctrl+Tab popup). In contrast to the "navigation history" it
should contain each file/document only once.

Since 324de13b4e items for suspended
documents with the same file name were no longer removed. For suspended
documents it is necessary to check for the same file name.

This was so far not vital, but when we save the editor history in the
session, these do not have a document when restoring, which would lead
to an evergrowing editor history.

Amends 324de13b4e

Change-Id: Ia4b7848a1265024d0463afbf7c1cd69189c4be97
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-25 08:23:59 +00:00
hjk
b9f9d2574e Utils/ProjectExplorer: More Key and Store
Change-Id: Ic9cc3a36b320c7413c362d1a1cdf024298d25027
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 07:33:53 +00:00
hjk
4943f387c7 Core: Merge editor factory classes
Mainly to simplify the implementation and naming.

Kind of follow-up to 862c9694.

There is some consolidation needed as followup as well as some potential
renamings. I'd leave that for separate patches to keep this here
somewhat self-contained.

Change-Id: I152e138a1d5baadec3f7542fed0894b8d4ffc8a3
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-24 13:51:52 +00:00
Marcus Tillmanns
16454e13eb Core: Allow saving documents without filename
In case a document does not yet have a filename,
simply fall back to save as

Change-Id: I3cb30ab39e30ecba5c720d4b7d4c955f9dd4609f
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-24 10:42:10 +00:00
hjk
621a2850d0 Utils etc: More use of Key and Store
Change-Id: Idd2d70617f775d783aee93a2fe82544ad335a739
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-24 08:51:00 +00:00