wwWidgets Home · All Classes · Main Classes · Grouped Classes · Functions

QwwButtonLineEdit Class Reference

A QLineEdit with an integrated customizable button. More...

 #include <QwwButtonLineEdit>

Inherits QLineEdit.

Inherited by QwwClearLineEdit, QwwFileChooser, and QwwResetLineEdit.


Public Types

enum Position { None, RightOutside, RightInside, LeftOutside, LeftInside }

Properties


Public Functions

QwwButtonLineEdit ( QWidget * parent = 0 )
QwwButtonLineEdit ( const QString & contents, QWidget * parent = 0 )
bool autoRaise () const
Qt::FocusPolicy buttonFocusPolicy () const
bool buttonIsVisible () const
Position buttonPosition () const
QIcon icon () const
QString placeholderText () const
QString regExp () const
void setButtonFocusPolicy ( Qt::FocusPolicy )
void setButtonPosition ( Position pos )

Public Slots

void setAutoRaise ( bool )
void setButtonVisible ( bool )
void setIcon ( const QIcon & )
void setPlaceholderText ( const QString & )
void setRegExp ( const QString & v )
void setRegExp ( const QRegExp & rx )

Signals

void buttonClicked ()
void validatorChanged ( const QString & regexp )

Protected Functions

QToolButton * button () const

Reimplemented Protected Functions

virtual void paintEvent ( QPaintEvent * )

Additional Inherited Members


Detailed Description

A QLineEdit with an integrated customizable button.

The control is a line edit that contains a tool button can hold an icon and can be set either on the right or the left side of the line edit and can occupy space inside or outside the line edit.

QwwButtonLineEdit

QwwButtonLineEdit

It can be used to associate an easy to access action with the line edit, i.e. that will modify contents of the box in a definable way.

Using QWidget::addAction() one can associate more than one action with the button.


Member Type Documentation

enum QwwButtonLineEdit::Position

ConstantValueDescription
QwwButtonLineEdit::None0Button is not visible
QwwButtonLineEdit::RightOutside1Button is positioned on the right side of the line edit.
QwwButtonLineEdit::RightInside2Button is positioned inside the line edit on the right.
QwwButtonLineEdit::LeftOutside3Button is positioned on the left side of the line edit.
QwwButtonLineEdit::LeftInside4Button is positioned inside the line edit on the left.


Property Documentation

autoRaise : bool

This property holds this property holds whether auto-raising is enabled or not.

The default is disabled (i.e. false).

This property is currently ignored on Mac OS X when using QMacStyle.

Access functions:

bool autoRaise () const
void setAutoRaise ( bool )

buttonFocusPolicy : Qt::FocusPolicy

Access functions:

Qt::FocusPolicy buttonFocusPolicy () const
void setButtonFocusPolicy ( Qt::FocusPolicy )

buttonPosition : Position

This property holds the position of the button relative to the line edit.

Access functions:

Position buttonPosition () const
void setButtonPosition ( Position pos )

buttonVisible : bool

This property holds information whether the button is visible.

Access functions:

bool buttonIsVisible () const
void setButtonVisible ( bool )

See also button() and buttonPosition.

icon : QIcon

This property holds the icon shown on the button

Access functions:

QIcon icon () const
void setIcon ( const QIcon & )

placeholderText : QString

Access functions:

QString placeholderText () const
void setPlaceholderText ( const QString & )

regExp : QString

This property holds the regular expression used to validate contents of the widget

Access functions:

QString regExp () const
void setRegExp ( const QString & v )
void setRegExp ( const QRegExp & rx )

Member Function Documentation

QwwButtonLineEdit::QwwButtonLineEdit ( QWidget * parent = 0 )

Constructs a button line edit with a given parent.

QwwButtonLineEdit::QwwButtonLineEdit ( const QString & contents, QWidget * parent = 0 )

Constructs a button line edit with a given parent and sets its text to contents.

QToolButton * QwwButtonLineEdit::button () const   [protected]

Returns a pointer to the button.

void QwwButtonLineEdit::buttonClicked ()   [signal]

This signal is emitted when the button is clicked.

void QwwButtonLineEdit::paintEvent ( QPaintEvent * )   [virtual protected]

void QwwButtonLineEdit::validatorChanged ( const QString & regexp )   [signal]

Signal emitted when the validator of the line edit changes to regexp


Copyright © 2007-2010 Witold Wysota Trademarks
wwWidgets 1.0.0