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>
Add convenience method in variable chooser and move magic constant to
the place where it's used.
Change-Id: Ie93acb98e13efcacb77d1a478df927a11b16926b
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Even if the variable chooser currently doesn't have focus.
Task-number: QTCREATORBUG-7155
Change-Id: Ie3a7527e13dd6c3f37c1abe86a596753d2b8e286
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>