Commit Graph

64 Commits

Author SHA1 Message Date
Andre Hartmann
e3abd5b348 JsonWizard: Fix restoreLastHistoryItem for LineEdit
The value was successfully loaded from the history,
but overwritten again.

Let's now check if the line edit already contains
a value (loaded from history) before setting the
default text.

Change-Id: Ic0acad83f76e0aca76309dfd213183a210d334ac
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-08 10:45:03 +00:00
Andre Hartmann
0c1906319d JsonWizard: Fix spelling of "restoreLastHistoryItem"
Change-Id: If442b51bc5dc67ab668eb77afb8f0a0ead7c7c95
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-06 16:25:42 +00:00
hjk
84d0e3dda8 Utils: Use FilePath for PathChooser::m_baseDirectory
... and collapse the two accessor versions to one.

Change-Id: I282753a0092601cff073684053ff914016452645
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-19 07:59:13 +00:00
Nikolai Kosjar
6c1b11dd3e ProjectExplorer: Simplify
bugprone-branch-clone
readability-simplify-boolean-expr

Change-Id: Iaaac21e96a3e9db6b9819d77fdae623ede373e59
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-01 09:31:32 +00:00
Christian Kandeler
0d81e90bb1 Wizards: Fix ComboBox implementation
The ComboBoxField class used the QComboBox view's selection model as the
source for the current value, which makes no sense, as the item that was
last selected was not necessarily activated by the user.

Fixes: QTCREATORBUG-23149
Change-Id: I8587dd20381e142b91f13a987e54c86b8f6237c8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-10-28 12:14:18 +00:00
Christian Kandeler
4702faba06 Wizards: Add the ability to remember user choices
Wizard authors can now provide a persistence key to values where that
makes sense.
For now, we make use of it for the build system type in all wizards and
the minimum Qt version as well as the virtual keyboard settings in the
QtQuick wizards.

Fixes: QTCREATORBUG-16657
Change-Id: I179930665bd163b1cf198467ab8b43bc72f8ec4a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-23 12:48:56 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Alessandro Portale
0933c20de8 connect() to ambiguous signals/slots: Replace static_cast with QOverload
Change-Id: I473d7a2a16509cee944a2a21b022a3f6f02cfd8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 14:07:03 +00:00
Eike Ziller
e0d38ae414 Export Wizard values to JavaScript macro
Registers a new function "value('name')", available to the wizard json
files, which returns the value of the variable "name" as a JavaScript
object. So, variables with a string value are actual JavaScript strings,
booleans are booleans, lists are lists, and dictionaries are
dictionaries.

The patch also makes it actually possible to assign JSON lists and
dictionaries to values.

This removes some hacks involving creating complex JavaScript objects
through string substitution.

Change-Id: I4ac6da22bc5bccc9fadee97694c2fa14d44c9307
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-09 11:19:43 +00:00
Eike Ziller
788ef20247 JSON Wizards: Give labels more space even when word-wrapped
QLabel has a horizontal size policy of "Preferred", but if the label is
word-wrapped, the sizeHint is a using a golden ratio for width & height,
but we want the label to grab as much horizontal space as it gets
anyhow.

Change-Id: I6ed049f4f23158014dc04f2d5020b7c2dd4c1980
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-05 07:26:10 +00:00
Alessandro Portale
616e19ff9e Fix warning: "Missing emit keyword on signal call"
[-Wclazy-incorrect-emit]

Change-Id: I93bdc6e23cdaccf35c9899ae16870ccc65a54f80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-17 15:54:56 +00:00
Robert Loehning
747d1ef9f1 Remove unused variables
Change-Id: I8b49a2eea7509abb685d751a0f038dc3b4f555ca
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-07 14:02:23 +00:00
Tobias Hunger
80c2ce118d ProjectExplorer: Modernize even more
Use unique_ptr for all *Private classes, except for those
in singletons.

Change-Id: Ib56c31ddedc6e9cf321f15de1f1e697a27ad4089
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-24 09:04:54 +00:00
Alessandro Portale
8d19333075 ProjectExplorer: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: Iebed22caa2e733d292f334e956e3d16b844e14e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-16 10:01:53 +00:00
Alessandro Portale
8797123128 ProjectExplorer: Fix warning about signed/unsigned mismatch
Msvc says:
warning: C4018: '>=': signed/unsigned mismatch

Change-Id: Ib3fc4734088bd799271105ed3757d55562efcba3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-04-12 13:36:49 +00:00
Tim Jenssen
18ad5653d5 Wizards: fix crash when index is wrong
Task-number: QTCREATORBUG-20193
Change-Id: I20da636a3db478c6ff0d812b1b3dc3405f73cb8e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-09 08:28:10 +00:00
Robert Loehning
2109f3573f Wizards: Add missing spaces
Change-Id: If4bb6a48b1da1433c36e367c700d18a10fabe45d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-02-12 10:07:48 +00:00
Tim Jenssen
30d123e2ec Wizards: add IconListField
- reuse some code from ComboBoxField throw an abstract ListField class
 - ListField can handle more data like: icon, trToolTip
 - fix disabledIndex in ComboBoxField
 - adjust documentation

Change-Id: I00b6ab787fb2fad97dafff32786cf73c636c772d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-10-30 11:55:35 +00:00
Tim Jenssen
2f3acee4e0 Wizards: add a warning about unsupported keys
- parseData methods check that there is no unknown key is used
 - showing the name and type might be useful in warning and error messages

Change-Id: I1371bb3af1ad48ed4b85260f3b1309cdba1cb71f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-10-26 11:32:03 +00:00
Tim Jenssen
7dbd399a97 Wizards: introduce ObjectToFieldWidgetConverter
With it as a wrapper we can register any QObject
to use widget based field mechanism from QWizard.

It also helps to avoid the necessity for inheritance
to just adjust the text property of a widget.

Can not remove the TextCheckBox, because it is used
in some old C++ wizards.

Change-Id: I85a85a834714a4b38b501c13357fa8c8bb02b5bd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-29 09:34:08 +00:00
Tim Jenssen
bb16ae7323 Wizards: let the page use wizard values
For example it will be used to get the
wizard directory to show icons in fields later.

Change-Id: I6a243a67a89e4a0133550a61b870d771147667f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-29 07:59:24 +00:00
Tim Jenssen
c0b2ba829f Wizards: add label for spanned widgets
Change-Id: Ib6cd4791d33a3b14b37f63adb967e17c9357da9f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-27 09:01:41 +00:00
Tim Jenssen
08d3ef13a7 Wizards: improve looking for a factory
Change-Id: I5d384ff43b01274556c30a1669a953955d81a501
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-27 09:01:24 +00:00
Tim Jenssen
2f0a395017 Wizards: make get widget a bit more robust
Change-Id: I0182147f517a39c3fdb0f27be4354b30e2cc4f31
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-19 09:14:49 +00:00
Tim Jenssen
ca39f63b33 Wizards: Remove QLatin1String from JsonFieldPage
Change-Id: I91e69c80c62ac6f77fd1823f246097355cd81286
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-15 09:02:15 +00:00
Eike Ziller
64b19af7dd Merge remote-tracking branch 'origin/4.3'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I6d89ea588de955f5d878500b59285d3adde6c77d
2017-05-15 15:31:55 +02:00
Tobias Hunger
3e8e82b2e3 Wizards: Fix wizards in KDE environments
KDE checks for a "text" property in the wizard pages and will then replace the
text it sees there with some text with added '&' characters. This breaks the
wizards, so rename the properties to something that is not "text".

Task-number: QTCREATORBUG-17503
Change-Id: Ie513848cef9cd795f06a47659abb550abd268b11
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-12 13:34:37 +00:00
Alessandro Portale
3624a663d8 Reduce usage of qApp in favor of static function calls
Q*Application classes have unusually many static functions. In many
cases in our code, these functions are unnecessarily called as instance
functions, using the qApp helper.

This patch replaces many occurencies of qApp with the according
Q*Application classname.

Change-Id: I6099a419fa7bf969891269c37ed7a9e817ef5124
Reviewed-by: hjk <hjk@qt.io>
2017-04-24 18:36:28 +00:00
Tobias Hunger
0c0c0a6fd0 Jsonwizard: Modernize JsonFieldPage elements
QTCREATORBUG-17190 is fixed by this since initialization is fixed as a side effect;-)

Task-number: QTCREATORBUG-17190
Change-Id: I9d1f81d6cca26fcdd9ba8a49ee66e05607d6cae1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-10-31 13:04:03 +00:00
Tobias Hunger
318b6c9dba JSON Wizards: Add "isPassword" property to LineEdits
Change-Id: I5539c66c162345bda052546fa02cc69d4bd55f9a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-10-10 08:29:48 +00:00
Victor Heng
f0a4ad1b6c JsonWizard: Hide label when widget is hidden in Field Page
Setting "visible" of a widget (such as TextField) to false in a Field
Page hides the widget, but leaves it's label visible. Modified each
field to update it's label visibility when the widget is shown/hidden.

Change-Id: Idf20c624b6aad09a2be159e2fc697fcb24bd2bc5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-06 18:53:27 +00:00
Eike Ziller
33210099f1 Merge remote-tracking branch 'origin/4.0'
Change-Id: I9793f0f9019b16f3725c5a9708a5ccf81557cdc6
2016-06-03 09:50:43 +02:00
Victor Heng
48423414f6 JsonWizard: Check widget visibility when determining if it's mandatory
The wizard is unable to advance when a mandatory field is hidden. Assume
a hidden widget is not mandatory.

Change-Id: I19bdc1a661d91b75151d3aec34ad9d584002a556
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-01 04:55:45 +00:00
Tobias Hunger
95ac4edfd4 Projectexplorer: Modernize codebase
Change-Id: I4793b58aa77bcd46af99f8b843c0f7439cdc9269
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
2016-04-15 09:40:53 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
0f34f9e606 JsonWizard: Allow for HistoryCompleter on lineedits and pathchoosers
Change-Id: I93ebe655e2b3526c566b32c5d62ef915906d32a4
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-12-14 14:25:48 +00:00
Tobias Hunger
e5193fe209 JsonFieldPage: Sprinkle the code with auto
Change-Id: Ic8e65d352897bf5b47c8362936830266f55a233c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
2015-09-22 09:23:56 +00:00
Tobias Hunger
4b77ae0718 JsonWizard: Allow for custom widgets in the Field page
... instead of having a hard-coded list of widgets you can use.

Change-Id: Iedf7016412ce9d619fea5cdffe6dbf86beda92b0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
2015-09-22 09:22:46 +00:00
Tobias Hunger
443f133d3e JsonFieldPage: Export the class and PIMPL the Field class
Change-Id: Id40b12b80c6c02db70614da002c8a8e7f0ab98d9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
2015-09-22 09:22:33 +00:00
Tobias Hunger
84e7f8c0e6 JsonWizard: Split Fields out of fieldpage header
Change-Id: I9029b8da8d095216ec320a8e03ec5f3d4092dddc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
2015-09-22 09:22:26 +00:00
Christian Kandeler
8d3aa026e0 Utils: Rename PathChooser::changed() signal.
The name is overly generic, particularly with a pathChanged() signal
also present. Rename to "rawPathChanged", which adequately describes the
semantics.

Change-Id: Ia62b8b0a97a794cb6d5ad6b8ce0abcd36b5f5cdb
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-09-03 11:12:57 +00:00
Tobias Hunger
fc7ce7f0c8 JsonFieldPage: Be more paranoid with the index of ComboBoxes
This avoids a combobox being shown without any selection. This has
the side-effect that QTCREATORBUG-14699 can no longer get triggered.

Task-number: QTCREATORBUG-14699
Change-Id: I98f5ae503d29370ad46c6620238bc2815c024747
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-09 09:17:45 +00:00
Leena Miettinen
3c1e53c8ac JSON Wizards: fix message punctuation and wording
Change-Id: Ic144da9b9511dfd13960c2263be89dd06683e228
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-07-03 09:02:09 +00:00
Tobias Hunger
f68704f8fd JsonWizard: Make checkbox default values true and false
That is closer to what a user expects than the "0" and "1" used
before.

Change-Id: I08b3a7b0361dd54b75ee7b2213b3d120fb016bf5
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-05-28 15:52:54 +00:00
Tobias Hunger
dbec2d21e1 JsonFieldPage: Add conditions to combobox entries
Change-Id: I4982564fcb8160302206e12e64f2f2bba338e09f
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-05-27 14:11:20 +00:00
Tobias Hunger
57e3714db4 JsonWizard: Remove member that is only ever read
Change-Id: I87529de8fb600dfc08862143f708e445bc18ed47
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-05-20 09:03:51 +00:00
Tobias Hunger
e1f47f67b2 JsonFieldPage: Make the page honor the theme settings
Change-Id: I9a286fa73392a86b6d7ed39389a7601450a42b88
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-05-13 10:07:03 +00:00
Tobias Hunger
63373ecc1d JsonFieldPage: Support tooltips for all fields
Change-Id: Ie84e659d7cecf68753056db63a389173d725ebe4
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-05-12 15:17:52 +00:00
Tobias Hunger
c9ad077ee3 JsonWizard: Trigger complete change when triggering Checkboxes
Change-Id: Idb81fee165f5950d8a4dbe51fc79822594f9b3c4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-05-12 12:18:50 +00:00
Tobias Hunger
0b4e958fb3 JsonFieldPage: Add isComplete and incompleteMessage to Fields
This allows to do more sophisticated checks on the completion state
of the page.

Change-Id: Ibb6593fdc4e9c9f37e7d70c516f1a1410123191f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-05-12 12:07:54 +00:00