Commit Graph

479 Commits

Author SHA1 Message Date
Eike Ziller
351f0301de Un-virtualize Command and remove an inheritance
This was a left-over from times where we had a QShortcut variant of
Command, which was removed in Qt Creator 3.2.

Change-Id: I62a728f3af352c61bc137461232fc1ed8debccf2
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-31 14:19:38 +00:00
Artem Sokolovskii
85d2159e41 CorePlugin: Remove foreach / Q_FOREACH usage part 2
Task-number: QTCREATORBUG-27464
Change-Id: I4767c333c2724c954e63a7297c5013d11ae71777
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-05-13 13:35:04 +00:00
Eike Ziller
f562ebf239 Mimetypes: Make implementation switchable between new and old
- configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in
  utils/mimetypes2/
- added utils/mimeutils.h header for the Qt Creator specific static
  wrappers, that also includes the "public" headers for MimeType et al
  from the new or old implementation, depending on configuration
- change all utils/mimetypes/ includes to utils/mimeutils.h
- move the implementation for the wrappers to
  utils/mimetypes(2)/mimeutils.cpp
- also move the MimeDatabase declaration in the "old" implementation
  back to utils/mimetypes/mimedatabase.h

Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-25 07:19:58 +00:00
Eike Ziller
c6fdb66b2b Collect Qt Creator debug menu items into common submenu
instead of spreading them over the place.

- rename "Logger..." to "Show Logs..."
- create "Tools > Debug Qt Creator" menu and put "Show Logs", "Inspect
Language Clients" and "Inspect C++ Code Model" there
- add missing ellipsis

That gets rid of the otherwise not useful "Language Client" submenu, and
creates a nicer place for the "Show Logs" item.

Change-Id: I2588b4c93327669579979dfbfce37005ada29dab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-26 12:59:21 +00:00
Christian Stenger
5eafa345ed Core: Add LoggingView support
Add a way to inspect QC internal loggings. This is basically
useful for inspecting issues while running QC and facing them
without the need to restart and set appropriate logging rules.

Change-Id: Ic647ba1abfb2611c4e4e99a375413d399c71886d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-01-17 06:08:58 +00:00
Christian Kandeler
03499bd619 Fix some compiler warnings
Change-Id: I1ac0cbba1b47c429a752c545b1475c8d7d23c5dd
Reviewed-by: hjk <hjk@qt.io>
2021-12-15 16:10:08 +00:00
Eike Ziller
d097314873 Split "New File or Project" into "File" and "Project" parts
This was non-standard to begin with, and splitting it makes it
possible to have different designs for New Project and New File dialogs
that are more tailored for the different needs (as is done in
Design Studio)

Change-Id: Ie6246e3c3f3527702c4562ec6f8fcbf5fae6c6ad
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-12-02 11:02:35 +00:00
Thomas Hartmann
55c21cecdf QtDesignStudio: Split "New Files" from "New Project"
Just having the "New Project" dialog there is confusing to many users
and they do not know how to add new files.
Upstream in master we can remove the condition and split the dialog
also for Qt Creator.

Task-number: QDS-5494
Change-Id: I9a21f27fad932759fcfc412ecfac7f3f6d2bcfee
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
2021-11-16 11:24:19 +00:00
Samuel Ghinet
a850b1b866 Implement the New Project creation wizard for QDS
Task-number: QDS-4490
Change-Id: Ie8073e8838ec14a7f11ad972acc6fca4456adf58
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-11-09 18:21:22 +00:00
Eike Ziller
f16589f969 Fix that Restart Now might not close Qt Creator
The call of QWidget::close() on the main window is blocked by Qt if
there are modal windows open. First close/accept all currently open
modal dialogs, then close the main window.

Reverts a8bc9774f9 which was specific to
the Link with Qt functionality, and generalizes the code in
MainWindow::exit().

Fixes: QTCREATORBUG-26525
Task-number: QTCREATORBUG-24098
Change-Id: I4c62f684cdfd749dfb3d3c18bd513b9fee10ddda
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-11-08 13:05:16 +00:00
Samuel Ghinet
4e7ee4687b Allow the NewDialog to be overridden by other plugins
So that Qt Design Studio can set its own implementation for the New
Project dialog box.

Task-number: QDS-4490
Change-Id: Ie04b041a5b6e25b38416f53b0ee4943839c2f64f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-07 07:04:56 +00:00
Artem Sokolovskii
5805208cec CorePlugin: Use FilePath istead of QString
Task-number: QTCREATORBUG-2616
Change-Id: Iaa5bc7946a7bddfd8adffe51906d90b2e76f5837
Reviewed-by: hjk <hjk@qt.io>
2021-08-30 10:39:41 +00:00
hjk
ef1653698e ProjectExplorer: Use FilePath for ProjectNode::{path,directory}
... and let the fallout trickle down a bit.

Change-Id: I1a2f79e281725c4a121cc2fbbc0377e881616ce5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 08:09:26 +00:00
hjk
622a03f63c Core: FilePathify MainWindow::openFiles()
Change-Id: I2d63d9099a7eb5d7c9ea9f1b7d23555a90e737ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-02 09:37:39 +00:00
hjk
5731965045 Utils: Use FilePath in DropSupport
Change-Id: Id048d0dab4c58be367a081bb8041214abd6dbf98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-02 06:59:53 +00:00
hjk
44e841c453 Core: Use FilePath in preferredEditorFactories
Change-Id: I16f50b2a5cabc9eed9d895ce6b46efc62fcb336c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-30 07:07:29 +00:00
hjk
64c9384cb8 Core: Use FilePath in IDocumentFactory::open()
Change-Id: I369f3bba2e0d1d33fed3a29f3c1408429cc7d8f8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-30 07:07:18 +00:00
hjk
16e8cc7748 Core: Use FilePath on findDocumentFactory
Change-Id: I0308379c89f49051e8f6e753a91d756a758c5765
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-29 11:23:24 +00:00
hjk
906cfb060b Core: Use FilePath in some functions related to opening files
Change-Id: I9610855a914d315d7934996c755fb69ad399320f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-29 11:14:46 +00:00
Eike Ziller
6bc9cddb9e Merge remote-tracking branch 'origin/4.15' into 5.0
Conflicts:
	src/plugins/cmakeprojectmanager/projecttreehelper.cpp
	src/plugins/coreplugin/mainwindow.cpp

Change-Id: Ie3a281b8635e79ca5fa794a127ed0039f33fe2ee
2021-06-24 10:43:10 +02:00
Kai Köhne
10420d4e5e Replace Freenode with Libera.Chat
Change-Id: Ia4a54b72f522a02c734273630c8217af75e4ea92
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-06-23 14:40:50 +00:00
hjk
10af72100d Core: Update contact from freenode to libera.chat
Change-Id: Ia5dff84029dd7011ddc370e1493d02bafd41b9e2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-23 11:45:07 +00:00
Eike Ziller
f3997c565e Add clear button to build system output
in Projects mode.

Change-Id: I7ab5b460228f6c8a2c68ece87ccfbdef3608bd9c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-22 07:11:56 +00:00
David Schulz
95a7dc4857 Core: Use FilePaths for recent documents
Change-Id: I453e7dd2c5d8d357b651392fa7d7f0baf07173f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-14 04:38:36 +00:00
David Schulz
4b19decaa7 Core: Remove EditorManager::CanContainLineAndColumnNumber
In preparation of just supporting Utils::FilePath to open editors.
Opening editors at specific locations is still supported via
openEditorAt with Utils::Link, but the caller has first to parse the
file name via Utils::Link::fromString.

Change-Id: I17e5a28aeb50779cef9948fe72e37122d1020c50
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-07 10:09:04 +00:00
hjk
2ccf5e2795 Core: Use FilePath in ExternalEditor interface
Change-Id: If3360eb7db9cec373551c2eb0fcffaf3bc5460e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-28 09:13:23 +00:00
hjk
76db1e3746 Core: Add FilePath based overloads to EditorManager::openEditor{,at}
Part of the overall FilePath migration. Keep the original version for
a while to allow using code to catch up.

Change-Id: Ia7c5ea14416a06e679e8661c0e4045981db87b9b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-25 09:55:50 +00:00
hjk
61a0b2b2b3 Add some basic contact information in a new Help->Contact dialog
Change-Id: I5a01c3d3c9fd467ed7b48869b66617adf2b11fed
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-26 16:36:07 +00:00
Orgad Shaneh
dad2b3d84b Merge remote-tracking branch 'origin/4.14'
Change-Id: I7d55c01489dfcdd26fcf3ced9f26539a09073e8c
2021-02-08 12:56:36 +02:00
Eike Ziller
8875c59021 Core: Do not remove context objects during shutdown
Like we suppress context updates during shutdown also disconnect from
the context object's destroyed signal. At that point we don't care
anymore.

This also avoids issues if the context object lives as the child of a
widget in the MainWindow geometry. These widgets (and respectively their
children) are destroyed only in the QObject destructor, i.e. after the
MainWindow itself already destroyed all its members, including the
m_contextWidgets map.

Amends 6d97c1fcb1

Fixes: QTCREATORBUG-25310
Change-Id: I75db6f8783b5f62aa9805b69d4d2bba07b906a5b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-05 11:27:43 +00:00
Jarek Kobus
be1d33299e Use invokeMethod instead of single shot timer with 0 timeout
Refactor it in coreplugin.

Change-Id: I6aaad1b9270a8ff8a4a0bea6a1fff806b2fe190b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-29 15:24:41 +00:00
David Schulz
018d49f417 Core: Do not open documents for all dropped files
Only open one visible editor and add all other dropped files as
suspended documents to the document model.

Change-Id: Iade95b3891fb90c06cc8852859346bbfe10bc292
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-13 11:21:59 +00:00
Alessandro Portale
3e9385bf1b Core: Make member functions const/static
readability-make-member-function-const finds lots of member functions
that could be made const. This change just picks getter functions that
really should be const.

readability-convert-member-functions-to-static finds non-static member
functions which do not access this. This change turns most of them
into static ones, but leaves some non static to keep the class API
consistent.

Change-Id: I004d6f7fab4375f9902f940f29b4a4f561fc7604
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-11 08:28:25 +00:00
Eike Ziller
a40e5b5382 Core: Save less settings
Try to not save settings that weren't changed from their default, and
make it possible for defaults to change in the future.

Task-number: QTCREATORBUG-24762
Change-Id: If469b72573791bc92ed535edf00271ef09b55386
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-11 08:02:57 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
Eike Ziller
5cb5d8e585 Remove usages of Core::Id
It moved to Utils.

Change-Id: Ia4d12bb07db2d59b1cb084b2ebdea20e6e3b40ad
Reviewed-by: hjk <hjk@qt.io>
2020-09-21 13:06:21 +00:00
Antonio Di Monaco
6e4ca8b6af MainWindow: ask confirmation before closing Qt Creator
When working with multiple windows, pressing the close button multiple
times can close Qt Creator too.

This patch adds a system option, asking for a confirmation before
closing the IDE. By default it's not enabled.

Fixes: QTCREATORBUG-7637
Change-Id: Ifc5e8c97511f9227ce0634c8a7064d95775c76c2
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-14 14:19:45 +00:00
hjk
736e6eada0 Various Qt6 compile fixes
Task-number: QTCREATORBUG-24098
Change-Id: Ia0fe92d82d4477bd8f14ee25754b114316fc878a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-22 07:04:12 +00:00
Eike Ziller
6d97c1fcb1 Unregister deleted IContext objects automatically
Change-Id: I7b84c02c8fe1e7201431116e3d993792370fb942
Reviewed-by: hjk <hjk@qt.io>
2020-05-27 06:54:54 +00:00
Ville Nummela
1194340b85 Disable "Save All" when there are no documents to be saved
Fixes: QTCREATORBUG-22072
Change-Id: I6c84e0004d1ada27bfcec59f509d066f1b03ca2c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-30 07:52:40 +00:00
Eike Ziller
c8a2ea5433 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp

Change-Id: I2a0ccb84560174c5170d5baaff526c0e095f0ba0
2020-03-19 09:35:50 +01:00
Leena Miettinen
eecd2a5aa1 Doc: Fix QDoc warnings in Core plugin classes
Task-number: QTCREATORBUG-23620
Change-Id: Idf1fb2b3f930812c3cf18b9f8ced03fb8e0947be
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-18 13:39:43 +00:00
Eike Ziller
ed5e6a4999 Add some additional shortcuts for actions
Add Cmd+Shift+- for decreasing font size on macOS.
Do not add Cmd+= for increasing size, because it conflicts with the
existing shortcut for "Replace and Find Next".

Sprinkle some Backspace shortcuts in addition to Delete for removing
items. There are (laptop) keyboards that either do not have a designated
Delete key (requiring Fn+Backspace) or where the Delete key is not
conveniently located/sized, and there is no benefit in making the
distinction in that case anyhow.

Fixes: QTCREATORBUG-706
Fixes: QTCREATORBUG-13733
Change-Id: I06274a9810b82800ec6158a883c95d2a7ae2465e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-17 09:39:37 +00:00
Eike Ziller
a6d52a6e28 Move some actions to a "View" menu
A "View" menu seems to be what many users are looking for when they want
to show or hide panes/views, so move corresponding actions there.
Window management / split actions stay in the "Window" menu.

Fixes: QTCREATORBUG-23610
Change-Id: Id683addc681de99abb35697a735fdbc9dc0d00cd
Reviewed-by: hjk <hjk@qt.io>
2020-03-06 14:01:23 +00:00
Mahmoud Badri
fb843d3442 QmlDesigner: Remove the standalone view3D window implementation
Task-number: QDS-1692
Change-Id: I6c04aaee9ab6a119cfcc22ee2e19b808bb95ae0a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-03-05 11:00:11 +00:00
hjk
95623ae011 Core: Apply new settings page pattern to Tool settings page
Since the code "belonging" to the widget was split across two
classes, but isn't now, a bit of moving was necessary.

Use the opportunity to remove now-unneeded undirections to the
model and ui members.

Change-Id: I25bb96de05c67d9116f28ae342d4aebd3c4419e6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-29 08:25:31 +00:00
Mahmoud Badri
1eb72aabef Fix Edit View 3D on top of Some widgets issue
setting the main window as the parent of a widget makes it open above
the Edit View 3D. Also other dialogs (open file dialog, options dialog,
etc) open above the 3D View now.

Task-number: QDS-1446
Change-Id: I6f6325d7b81eccb5aec3c07dfadc021a17dfd26b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-01-16 12:25:19 +00:00
Eike Ziller
7c35c447e1 Set application details earlier
The application details (name, organization, etc) were only set during
Core plugin startup, but that is too late for e.g. the plugin manager.

Change-Id: Id47d79e38dec9e586ab7b91a3080101e5fecb20d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-01-14 08:16:52 +00:00
Eike Ziller
be19b00289 Provide "Restart Now" functionality
And use it for the plugin dialog and when changing the UI language.

Change-Id: Ic767837d2526409f7ec46d7e4612a1499f19459e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-07 12:46:59 +00:00
Mahmoud Badri
f97de35dd4 Improve edit view 3D "on top" logic
- Proxy dialog removed
- When the QDS window is minimized/maximized, the edit view 3D follows.
  The opposite is not true (edit view 3D can be minimized separately).
- Edit view 3D is always on top of QDS window. Only exception is when
  a popup is shown (so that the user can handle the popup).
- External apps go normally on top of the edit view 3D.

Known (non critical) issues:
- Activating the edit view 3D doesn't raise() the QDS window, so if an
external app is on top of the edit view 3D then the view is clicked,
the external app will be in between the view and the QDS window.
- Closing the edit view 3D from the x button doesnt work (causes a
  restart). This is not in the scope of this commit.

Task-number: QDS-1179
Change-Id: I1dd72590037be295b94735de96772307ba14c59c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-13 12:40:43 +00:00