Doc: Fix docs for Core::VariableChooser

Fixes: QTCREATORBUG-23620
Change-Id: I6adf1f035968a0a00ec4acfbda90ac52130a7e24
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Leena Miettinen
2020-03-23 11:27:24 +01:00
parent 55250545da
commit 9639e07e3e

View File

@@ -339,6 +339,7 @@ using namespace Internal;
/*! /*!
* \class Core::VariableChooser * \class Core::VariableChooser
* \inmodule QtCreator
* \brief The VariableChooser class is used to add a tool window for selecting \QC variables * \brief The VariableChooser class is used to add a tool window for selecting \QC variables
* to line edits, text edits or plain text edits. * to line edits, text edits or plain text edits.
* *
@@ -351,8 +352,8 @@ using namespace Internal;
* \image variablechooser.png "External Tools Preferences with Variable Chooser" * \image variablechooser.png "External Tools Preferences with Variable Chooser"
* *
* The variable chooser monitors focus changes of all children of its parent widget. * The variable chooser monitors focus changes of all children of its parent widget.
* When a text control gets focus, the variable chooser checks if it has variable support set, * When a text control gets focus, the variable chooser checks if it has variable support set.
* either through the addVariableSupport() function. If the control supports variables, * If the control supports variables,
* a tool button which opens the variable chooser is shown in it while it has focus. * a tool button which opens the variable chooser is shown in it while it has focus.
* *
* Supported text controls are QLineEdit, QTextEdit and QPlainTextEdit. * Supported text controls are QLineEdit, QTextEdit and QPlainTextEdit.
@@ -375,7 +376,6 @@ using namespace Internal;
* Property name that is checked for deciding if a widget supports \QC variables. * Property name that is checked for deciding if a widget supports \QC variables.
* Can be manually set with * Can be manually set with
* \c{textcontrol->setProperty(VariableChooser::kVariableSupportProperty, true)} * \c{textcontrol->setProperty(VariableChooser::kVariableSupportProperty, true)}
* \sa addVariableSupport()
*/ */
const char kVariableSupportProperty[] = "QtCreator.VariableSupport"; const char kVariableSupportProperty[] = "QtCreator.VariableSupport";
const char kVariableNameProperty[] = "QtCreator.VariableName"; const char kVariableNameProperty[] = "QtCreator.VariableName";
@@ -383,7 +383,6 @@ const char kVariableNameProperty[] = "QtCreator.VariableName";
/*! /*!
* Creates a variable chooser that tracks all children of \a parent for variable support. * Creates a variable chooser that tracks all children of \a parent for variable support.
* Ownership is also transferred to \a parent. * Ownership is also transferred to \a parent.
* \sa addVariableSupport()
*/ */
VariableChooser::VariableChooser(QWidget *parent) : VariableChooser::VariableChooser(QWidget *parent) :
QWidget(parent), QWidget(parent),
@@ -406,6 +405,9 @@ VariableChooser::~VariableChooser()
delete d; delete d;
} }
/*!
Adds the macro expander provider \a provider.
*/
void VariableChooser::addMacroExpanderProvider(const MacroExpanderProvider &provider) void VariableChooser::addMacroExpanderProvider(const MacroExpanderProvider &provider)
{ {
auto item = new VariableGroupItem; auto item = new VariableGroupItem;
@@ -415,8 +417,11 @@ void VariableChooser::addMacroExpanderProvider(const MacroExpanderProvider &prov
} }
/*! /*!
* Marks the control as supporting variables. * Marks the control \a textcontrol as supporting variables.
* \sa kVariableSupportProperty *
* If the control provides a variable to the macro expander itself, set
* \a ownName to the variable name to prevent the user from choosing the
* variable, which would lead to endless recursion.
*/ */
void VariableChooser::addSupportedWidget(QWidget *textcontrol, const QByteArray &ownName) void VariableChooser::addSupportedWidget(QWidget *textcontrol, const QByteArray &ownName)
{ {