#include </home/clem/local/src/opie/libopie2/qt3/opieui/olineedit.h>
Inheritance diagram for OLineEdit:


Public Slots | |
| virtual void | setReadOnly (bool) |
| void | rotateText (OCompletionBase::KeyBindingType) |
| virtual void | setCompletedText (const QString &) |
| void | setCompletedItems (const QStringList &items) |
| virtual void | clear () |
Signals | |
| void | returnPressed (const QString &) |
| void | completion (const QString &) |
| void | substringCompletion (const QString &) |
| void | textRotation (OCompletionBase::KeyBindingType) |
| void | completionModeChanged (OGlobalSettings::Completion) |
| void | aboutToShowContextMenu (QPopupMenu *) |
Public Member Functions | |
| OLineEdit (const QString &string, QWidget *parent, const char *name=0) | |
| OLineEdit (QWidget *parent=0, const char *name=0) | |
| virtual | ~OLineEdit () |
| void | setURL (const KURL &url) |
| void | cursorAtEnd () |
| virtual void | setCompletionMode (OGlobalSettings::Completion mode) |
| virtual void | setContextMenuEnabled (bool showMenu) |
| bool | isContextMenuEnabled () const |
| void | setURLDropsEnabled (bool enable) |
| bool | isURLDropsEnabled () const |
| void | setTrapReturnKey (bool trap) |
| bool | trapReturnKey () const |
| virtual bool | eventFilter (QObject *, QEvent *) |
| OCompletionBox * | completionBox (bool create=true) |
| virtual void | setCompletionObject (OCompletion *, bool hsig=true) |
Protected Slots | |
| virtual void | makeCompletion (const QString &) |
| void | slotAboutToShow () |
| void | slotCancelled () |
Protected Member Functions | |
| virtual void | keyPressEvent (QKeyEvent *) |
| virtual void | mousePressEvent (QMouseEvent *) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *) |
| virtual QPopupMenu * | createPopupMenu () |
| virtual void | setCompletedText (const QString &, bool) |
| virtual void | create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true) |
Properties | |
| bool | contextMenuEnabled |
| bool | urlDropsEnabled |
Private Types | |
| enum | MenuID { Default = 42, NoCompletion, AutoCompletion, ShellCompletion, PopupCompletion, SemiAutoCompletion } |
Private Slots | |
| void | completionMenuActivated (int id) |
| void | tripleClickTimeout () |
Private Member Functions | |
| void | init () |
| void | makeCompletionBox () |
Private Attributes | |
| bool | m_bEnableMenu |
| bool | possibleTripleClick |
| OLineEditPrivate * | d |
Friends | |
| class | OComboBox |
Classes | |
| class | OLineEditPrivate |
An enhanced QLineEdit widget for inputting text.
To support these new features OLineEdit also emits a few more additional signals. These are: completion( const QString& ), textRotation( KeyBindingType ), and returnPressed( const QString& ). The completion signal can be connected to a slot that will assist the user in filling out the remaining text. The text rotation signal is intended to be used to iterate through the list of all possible matches whenever there is more than one match for the entered text. The returnPressed( const QString& ) signals are the same as QLineEdit's except it provides the current text in the widget as its argument whenever appropriate.
This widget by default creates a completion object when you invoke the completionObject( bool ) member function for the first time or use setCompletionObject( OCompletion*, bool ) to assign your own completion object. Additionally, to make this widget more functional, OLineEdit will by default handle the text rotation and completion events internally when a completion object is created through either one of the methods mentioned above. If you do not need this functionality, simply use OCompletionBase::setHandleSignals( bool ) or set the boolean parameter in the above functions to FALSE.
The default key-bindings for completion and rotation is determined from the global settings in OStdAccel. These values, however, can be overriden locally by invoking OCompletionBase::setKeyBinding(). The values can easily be reverted back to the default setting, by simply calling useGlobalSettings(). An alternate method would be to default individual key-bindings by usning setKeyBinding() with the default second argument.
NOTE that if the EchoMode for this widget is set to something other than QLineEdit::Normal, the completion mode will always be defaulted to PGlobalSettings::CompletionNone. This is done purposefully to guard against protected entries such as passwords being cached in OCompletion's list. Hence, if the EchoMode is not QLineEdit::Normal, the completion mode is automatically disabled.
OLineEdit *edit = new OLineEdit( this, "mywidget" ); OCompletion *comp = edit->completionObject(); // Fill the completion object with a list of possible matches QStringList list; list << "mickeyl@handhelds.org" << "mickey@tm.informatik.uni-frankfurt.de>" << "mickey@Vanille.de"; comp->setItems( list ); // Connect to the return pressed signal (optional) connect(edit,SIGNAL(returnPressed(const QString&)),comp,SLOT(addItem(const QString&));
To use a customized completion objects or your own completion object :
OLineEdit *edit = new OLineEdit( this,"mywidget" ); KURLCompletion *comp = new KURLCompletion(); edit->setCompletionObject( comp ); // Connect to the return pressed signal - optional connect(edit,SIGNAL(returnPressed(const QString&)),comp,SLOT(addItem(const QString&));
Note that you have to either delete the allocated completion object when you don't need it anymore, or call setAutoDeleteCompletionObject( true );
// Tell the widget not to handle completion and // iteration internally. edit->setHandleSignals( false ); // Set your own completion key for manual completions. edit->setKeyBinding( OCompletionBase::TextCompletion, Qt::End ); // Hide the context (popup) menu edit->setContextMenuEnabled( false ); // Temporarly disable signal emitions // (both completion & iteration signals) edit->disableSignals(); // Default the key-bindings to system settings. edit->useGlobalKeyBindings();
Opie adaption by Michael Lauer <mickey@tm.informatik.uni-frankfurt.de>
Definition at line 150 of file olineedit.h.
|
|
Definition at line 462 of file olineedit.h. |
|
||||||||||||||||
|
Constructs a OLineEdit object with a default text, a parent, and a name.
Definition at line 76 of file olineedit.cpp. References init(). |
|
||||||||||||
|
Constructs a OLineEdit object with a parent and a name.
Definition at line 82 of file olineedit.cpp. References init(). |
|
|
Destructor. Definition at line 88 of file olineedit.cpp. References d. |
|
|
Emitted before the context menu is displayed. The signal allows you to add your own entries into the the context menu that is created on demand. NOTE: Do not store the pointer to the QPopupMenu provided through since it is created and deleted on demand.
Referenced by createPopupMenu(). |
|
|
Reimplemented to workaround a buggy QLineEdit::clear() (changing the clipboard to the text we just had in the lineedit) Definition at line 726 of file olineedit.cpp. References QString::null. Referenced by OEditListBox::addItem(), and OEditListBox::clear(). |
|
|
Emitted when the completion key is pressed.
Please note that this signal is not emitted if the completion mode is set to Referenced by keyPressEvent(). |
|
|
Definition at line 697 of file olineedit.cpp. References OLineEdit::OLineEditPrivate::completionBox, d, and makeCompletionBox(). Referenced by OComboBox::completionBox(), and OComboBox::eventFilter(). |
|
|
Definition at line 493 of file olineedit.cpp. References AutoCompletion, OLineEdit::OLineEditPrivate::completionBox, OCompletionBase::completionMode(), completionModeChanged(), d, OCompletionBox::hide(), NoCompletion, PopupCompletion, SemiAutoCompletion, setCompletionMode(), and ShellCompletion. Referenced by createPopupMenu(). |
|
|
Emitted when the user changed the completion mode by using the popupmenu. Referenced by completionMenuActivated(). |
|
||||||||||||||||
|
Reimplemented for internal reasons, the API is not affected. Definition at line 720 of file olineedit.cpp. |
|
|
Re-implemented for internal reasons. API not affected. See QLineEdit::createPopupMenu(). Definition at line 433 of file olineedit.cpp. References aboutToShowContextMenu(), AutoCompletion, completionMenuActivated(), OCompletionBase::completionMode(), OCompletionBase::compObj(), m_bEnableMenu, NoCompletion, PopupCompletion, SemiAutoCompletion, ShellCompletion, and tr. |
|
|
Puts the text cursor at the end of the string. This method is deprecated. Use QLineEdit::end() instead.
Definition at line 199 of file olineedit.h. References end. |
|
||||||||||||
|
Re-implemented for internal reasons. API not affected. Definition at line 546 of file olineedit.cpp. References OLineEdit::OLineEditPrivate::completionBox, d, OLineEdit::OLineEditPrivate::grabReturnKeyEvents, OCompletionBox::hide(), Qt::Key_Enter, Qt::Key_Return, KeyPress, and returnPressed(). |
|
|
Initializes variables. Called from the constructors. Definition at line 93 of file olineedit.cpp. References d, possibleTripleClick, and setContextMenuEnabled(). Referenced by OLineEdit(). |
|
|
Returns Definition at line 230 of file olineedit.h. References m_bEnableMenu. |
|
|
Returns Definition at line 591 of file olineedit.cpp. References d, and OLineEdit::OLineEditPrivate::handleURLDrops. |
|
|
Re-implemented for internal reasons. API not affected. See QLineEdit::keyPressEvent(). Definition at line 207 of file olineedit.cpp. References completion(), OLineEdit::OLineEditPrivate::completionBox, OCompletionBase::completionMode(), d, OCompletionBase::emitSignals(), OCompletionBase::getKeyBindings(), OCompletionBase::handleSignals(), hasSelectedText(), OCompletionBox::hide(), QString::isNull(), keycode, len, QString::length(), makeCompletion(), Dasher::Opts::Normal, qDebug(), text, and QString::unicode(). |
|
|
Completes the remaining text with a matching one from a given list. Definition at line 156 of file olineedit.cpp. References OCompletion::allMatches(), OLineEdit::OLineEditPrivate::completionBox, OCompletionBase::completionMode(), OCompletionBase::compObj(), d, OCompletionBox::hide(), QString::isNull(), OCompletion::makeCompletion(), match(), setCompletedItems(), and setCompletedText(). Referenced by keyPressEvent(), and OComboBox::makeCompletion(). |
|
|
Creates the completion box Definition at line 611 of file olineedit.cpp. References OLineEdit::OLineEditPrivate::completionBox, d, and OCompletionBase::handleSignals(). Referenced by completionBox(), and setCompletedItems(). |
|
|
Re-implemented for internal reasons. API not affected. See QWidget::mouseDoubleClickEvent(). Definition at line 407 of file olineedit.cpp. References Qt::LeftButton, possibleTripleClick, and tripleClickTimeout(). |
|
|
Re-implemented for internal reasons. API not affected. See QLineEdit::mousePressEvent(). Definition at line 418 of file olineedit.cpp. References Qt::LeftButton, and possibleTripleClick. |
|
|
Emitted when the user presses the return key.
The argument is the current text. Note that this signal is not emitted if the widget's Referenced by eventFilter(). |
|
|
Iterates through all possible matches of the completed text or the history list. This function simply iterates over all possible matches in case multimple matches are found as a result of a text completion request. It will have no effect if only a single match is found.
Definition at line 137 of file olineedit.cpp. References OCompletionBase::compObj(), hasSelectedText(), input, QString::isNull(), OCompletionBase::NextCompletionMatch, OCompletion::nextMatch(), OCompletionBase::PrevCompletionMatch, OCompletion::previousMatch(), and setCompletedText(). Referenced by OComboBox::rotateText(). |
|
|
Sets Implements OCompletionBase. Definition at line 676 of file olineedit.cpp. References OLineEdit::OLineEditPrivate::completionBox, QValueList< T >::count(), d, QValueList< T >::first(), OCompletionBox::hide(), QString::isEmpty(), QValueList< T >::isEmpty(), makeCompletionBox(), OCompletionBox::popup(), OCompletionBox::setCancelledText(), OCompletionBox::setItems(), and text. Referenced by makeCompletion(), OComboBox::setCompletedItems(), and setCompletionObject(). |
|
||||||||||||
|
Re-implemented to handle URI drops. See QLineEdit::dropEvent(). Definition at line 118 of file olineedit.cpp. References QString::length(), and text. |
|
|
See OCompletionBase::setCompletedText. Implements OCompletionBase. Definition at line 128 of file olineedit.cpp. References OCompletionBase::completionMode(). Referenced by makeCompletion(), rotateText(), and OComboBox::setCompletedText(). |
|
|
Re-implemented from OCompletionBase for internal reasons. This function is re-implemented in order to make sure that the EchoMode is acceptable before we set the completion mode. See OCompletionBase::setCompletionMode Reimplemented from OCompletionBase. Definition at line 103 of file olineedit.cpp. References OLineEdit::OLineEditPrivate::completionBox, OCompletionBase::completionMode(), d, OCompletionBox::hide(), Dasher::Opts::Normal, and OCompletionBase::setCompletionMode(). Referenced by completionMenuActivated(), OpieUIDemo::demoOLineEdit(), and OComboBox::setAutoCompletion(). |
|
||||||||||||
|
Reimplemented for internal reasons, the API is not affected. Reimplemented from OCompletionBase. Definition at line 705 of file olineedit.cpp. References OCompletionBase::compObj(), OCompletionBase::handleSignals(), setCompletedItems(), and OCompletionBase::setCompletionObject(). |
|
|
Enables/disables the popup (context) menu.
Note that when this function is invoked with its argument set to
Definition at line 225 of file olineedit.h. References m_bEnableMenu. Referenced by init(), and OComboBox::setContextMenuEnabled(). |
|
|
Re-implemented for internal reasons. API not changed. Definition at line 187 of file olineedit.cpp. References Disabled, Dasher::Opts::Normal, and p. |
|
|
By default, OLineEdit recognizes
Call this method with
Definition at line 596 of file olineedit.cpp. References d, and OLineEdit::OLineEditPrivate::grabReturnKeyEvents. Referenced by OEditListBox::init(). |
|
|
Sets |
|
|
Enables/Disables handling of URL drops. If enabled and the user drops an URL, the decoded URL will be inserted. Otherwise the default behaviour of QLineEdit is used, which inserts the encoded URL.
Definition at line 586 of file olineedit.cpp. References d, and OLineEdit::OLineEditPrivate::handleURLDrops. |
|
|
Definition at line 394 of file olineedit.h. |
|
|
Definition at line 399 of file olineedit.h. |
|
|
Emitted when the shortcut for substring completion is pressed. |
|
|
Emitted when the text rotation key-bindings are pressed. The argument indicates which key-binding was pressed. In OLineEdit's case this can be either one of two values: PrevCompletionMatch or NextCompletionMatch. See OCompletionBase::setKeyBinding for details.
Note that this signal is not emitted if the completion mode is set to |
|
|
Definition at line 601 of file olineedit.cpp. References d, and OLineEdit::OLineEditPrivate::grabReturnKeyEvents. |
|
|
Definition at line 428 of file olineedit.cpp. References possibleTripleClick. Referenced by mouseDoubleClickEvent(). |
|
|
Definition at line 152 of file olineedit.h. |
|
|
Reimplemented from OCompletionBase. Definition at line 494 of file olineedit.h. Referenced by completionBox(), completionMenuActivated(), eventFilter(), init(), isURLDropsEnabled(), keyPressEvent(), makeCompletion(), makeCompletionBox(), setCompletedItems(), setCompletionMode(), setTrapReturnKey(), setURLDropsEnabled(), trapReturnKey(), and ~OLineEdit(). |
|
|
Checks whether we should/should not consume a key used as an accelerator. Definition at line 487 of file olineedit.h. Referenced by createPopupMenu(), isContextMenuEnabled(), and setContextMenuEnabled(). |
|
|
Definition at line 489 of file olineedit.h. Referenced by init(), mouseDoubleClickEvent(), mousePressEvent(), and tripleClickTimeout(). |
|
|
Definition at line 154 of file olineedit.h. |
|
|
Definition at line 156 of file olineedit.h. |
1.4.2