Open 3D Engine AzQtComponents API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzQtComponents::BrowseEdit Class Reference

A widget combining a Line Edit and a Push Button. Use this widget when you want to extend a Line Edit with support for user interaction. More...

#include <BrowseEdit.h>

Inherits QFrame.

Public Types

typedef LineEdit::Config Config
 

Signals

void attachedButtonTriggered ()
 Triggered when the button attached to the BrowseEdit is triggered.
 
void editingFinished ()
 Triggered when the user has finished editing the BrowseEdit's value.
 
void returnPressed ()
 Triggered when the return button is pressed while the BrowseEdit is focused.
 
void textChanged (const QString &text)
 
void textEdited (const QString &text)
 Triggered when the text value in the BrowseEdit is edited by the user.
 
void hasAcceptableInputChanged (bool acceptable)
 

Public Member Functions

 BrowseEdit (QWidget *parent=nullptr)
 
void setAttachedButtonIcon (const QIcon &icon)
 Sets the Icon for the button attached to this BrowseEdit.
 
QIcon attachedButtonIcon () const
 Returns the Icon currently being used by the button attached to this BrowseEdit.
 
void setClearButtonEnabled (bool enable)
 Enables the clear button on the Browse Edit.
 
bool isClearButtonEnabled () const
 Returns true if the clear button is currently enabled on this Browse Edit.
 
void setLineEditReadOnly (bool readOnly)
 Renders the BrowseEdit read-only. Double clicking on the read-only text will trigger the attached button.
 
bool isLineEditReadOnly () const
 Returns true if the text of this BrowseEdit is currently read-only.
 
void setPlaceholderText (const QString &placeholderText)
 
QString placeholderText () const
 Returns the current placeholder text for the BrowseEdit.
 
void setText (const QString &text)
 Sets the text value for the BrowseEdit.
 
QString text () const
 Gets the text value from the BrowseEdit.
 
void setErrorToolTip (const QString &toolTipText)
 
QString errorToolTip () const
 Returns the current error message for this BrowseEdit.
 
void setValidator (const QValidator *validator)
 Sets a validator on the BrowseEdit.
 
const QValidator * validator () const
 Returns a pointer to the validator object on the BrowseEdit, if set.
 
bool hasAcceptableInput () const
 Returns true if the current text value is accepted by the currently set validator.
 
QLineEdit * lineEdit () const
 Returns a pointer to the underlying LineEdit.
 

Static Public Member Functions

static Config loadConfig (QSettings &settings)
 
static Config defaultConfig ()
 Gets the default BrowseEdit style configuration.
 
static void applyDropTargetStyle (BrowseEdit *browseEdit, bool valid)
 
static void removeDropTargetStyle (BrowseEdit *browseEdit)
 

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override
 
bool event (QEvent *event) override
 
void setHasAcceptableInput (bool acceptable)
 

Properties

bool acceptableInput
 Read-only value indicating whether or not user input satisfies the inputMask condition and any validator. Default value is true.
 

Friends

class Style
 

Detailed Description

A widget combining a Line Edit and a Push Button. Use this widget when you want to extend a Line Edit with support for user interaction.

Member Function Documentation

◆ applyDropTargetStyle()

static void AzQtComponents::BrowseEdit::applyDropTargetStyle ( BrowseEdit browseEdit,
bool  valid 
)
static

Applies the drop target styling to the BrowseEdit.

Parameters
browseEditPointer to the BrowseEdit instance to apply the style on.
validWhether the BrowseEdit is a valid drop target or not.

◆ hasAcceptableInputChanged

void AzQtComponents::BrowseEdit::hasAcceptableInputChanged ( bool  acceptable)
signal

Triggered when the text value changes from acceptable to non acceptable and vice versa, based on the current validator.

◆ loadConfig()

static Config AzQtComponents::BrowseEdit::loadConfig ( QSettings &  settings)
static

Sets the BrowseEdit style configuration.

Parameters
settingsThe settings object to load the configuration from.
Returns
The new configuration of the BrowseEdit.

◆ removeDropTargetStyle()

static void AzQtComponents::BrowseEdit::removeDropTargetStyle ( BrowseEdit browseEdit)
static

Remove the drop target styling from the BrowseEdit.

Parameters
browseEditPointer to the BrowseEdit instance to remove the style from.

◆ setErrorToolTip()

void AzQtComponents::BrowseEdit::setErrorToolTip ( const QString &  toolTipText)

Sets the error message shown when hovering on the warning icon when the current text value is not acceptable.

◆ setPlaceholderText()

void AzQtComponents::BrowseEdit::setPlaceholderText ( const QString &  placeholderText)

Sets the placeholder text for the BrowseEdit. This is the message shown when the current text value is an empty string.

◆ textChanged

void AzQtComponents::BrowseEdit::textChanged ( const QString &  text)
signal

Triggered when the text value in the BrowseEdit is changed, either by the user or programmatically.


The documentation for this class was generated from the following file: