QSortFilterProxyModel::filterRegExp is going to go away in Qt6,
so port over to use QRegularExpression instead.
This required some changes where setFilterWildcard/FixedString()
was being used, as those would instantiate QRegExp based filters
in Qt 5, and will use QRegularExpression in Qt 6. Use the generic
setFilterRegularExpression here, to keep things portable between
5 and 6.
Change-Id: I6379be781aa3821b10ba783c088f82c1a0970911
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
Make the preview of variable "FOO" work in the variable chooser when the
macroexpander also has a prefix "FOO:" defined.
The MacroExpander::isPrefixVariable method is broken in this case: It will
append ':' to the variable name if it is not there already and will thus
return true for both "FOO" and "FOO:". So avoid calling it.
In this case this does not even lead to more look-ups: As the variable chooser
uses the description of the variable as a key, it contains "FOO:<value>" for
the variable name and uses that checks whether "FOO:<value>:" is a prefix variable
or not. That is always false.
Task-number: QTCREATORBUG-20504
Change-Id: I3ea83a4df6d72aac157fa6777106966cc9e9976d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
A QIcon contains variants for different resolutions. This change
makes sure that in a Multi-screen/mixed-scaling-mode scenario,
the right of those resolutions is chosen, depending on which screen
the line edit currently is.
Task-number: QTCREATORBUG-18869
Change-Id: I8775e9e2c9b15c2863e9415751e1306f9e43c9aa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
Utils::FancyLineEdit is usually used for filter fields, since it already
has the "Filter" place holder and a nice clear button.
Change-Id: Ifc6244129f5b47ba29dd0d421f3c69f5e21e8aac
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Serhii Moroz <frost.asm@gmail.com>
The tree has a QSortFilterProxyModel, so we have to map
the current index back to its source model to avoid
using a wrong index.
Change-Id: I78b6172a2c9b3d4255132e30e8eddf72dc95d5e4
Reviewed-by: hjk <hjk@qt.io>
This way we can use them from libraries, not only from plugins.
Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
One step towards the removal of the TreeItem::m_flags member
that's unused in most instances.
Instead of introducing another conversion, use a QByteArray
to store the variable name.
Change-Id: Icbe591988178faaf77db558d968843d8eb2b0160
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The LeveledTreeModel case is general enough to cover
the UniformTreeModel case, so merge them and rename to
TreeModel. The former TreeModel is now BaseTreeModel.
BaseTreeModels should not be instantiated directly,
a tree model with non-uniform basic items is available
as TreeModel<>.
Done-with: Eike Ziller <eike.ziller@qt.io>
Change-Id: I64a65617ab68c0cde39cf65f4bc092ef808ee6fb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
With Qt 5.7 the currentChanged() callback is called immediately on
QTreeView::setModel(), which leads to the label text being set. That
crashes if the label hasn't been created, yet.
Change-Id: I73763e1ac1c86215090a8f4b0118bc0cd286cf47
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
fce83bd9f84883f93829e6ca9eacf098b018a02d in qtbase causes a crash:
setModel creates a new selection model, which calls currentChanged,
which accesses an uninitialized member. Hence, protect the access to it.
Change-Id: I144f40aa4286f1a9edba24519a30c08ff5091f57
Reviewed-by: hjk <hjk@theqtcompany.com>
Resolving "Prefix:<value>" does not make any sense, so let's not
do that.
Task-number: QTCREATORBUG-15072
Change-Id: Ia9741f9b48d269a7be31163ad73c3bc232856419
Reviewed-by: hjk <hjk@theqtcompany.com>
Use book style capitalization for icon tooltips and
menu items.
Change-Id: I410ebf7be236ebf8b904c1555203f306eb569c99
Reviewed-by: hjk <hjk@theqtcompany.com>
isLazy/populate was the first incarnation of the canFetchMore/
fetchMore mechanism which now can take over completely. So:
- remove isLazy/populate
- the use in VariableChooser
Change-Id: I885d492c134fb6899759e19a73156b52df7a880a
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I5c6690f51488bf8ca3610ba9fb11e6e5fd814aaa
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
... and use it for the Current* fallbacks in the Kit expander.
Change-Id: I1d346aa56647f6d3030bd4384eb89e2a27db6418
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
The setTextMargin call which makes room for the button, can result in
sizeHint changes of the line edit, and therefore in relayouting and
geometry changes.
The patch also moves the escape key handling to the (line)edit instead
of unconditionally the focus widget, since there is code to hide the
chooser when the focus widget is not the (line)edit anyhow.
Change-Id: I687307985ca95e63c16086b8e77c371f642ab060
Task-number: QTCREATORBUG-13221
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Allow multiple expanders to be registered for lineedits, e.g. a
local and the global ones, and actually show them.
Use a tree view in the chooser for somewhat more structured display.
Change-Id: I769f92144e5249f45e54381de52aa6973eb20118
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This allows a MacroExpander also to describe an expansion it can
do which was restricted to the global VariableManager only.
The global is now just a thin (unneeded) wrapper about new "standard"
functionality.
Change-Id: Ida7ca70cf3d319eae4220ea8d12f3dd1c0d4042c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Helps to determine whether a specific variable is the right one
to use. At least structure can be more easily inferred than from
most available descriptions.
Change-Id: I401603934a99e3d3fe9a26c7cb617b9baa0d502c
Reviewed-by: Eike Ziller <eike.ziller@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>