KURLRequester Class Reference
This class is a widget showing a lineedit and a button, which invokes a filedialog. A widget to request a filename/url from the user. More...
#include <kurlrequester.h>
Inheritance diagram for KURLRequester:

Public Slots | |
void | setURL (const QString &url) |
Sets the url in the lineedit to url . | |
virtual void | setCaption (const QString &caption) |
Sets the caption of the file dialog. | |
void | clear () |
Clears the lineedit/combobox. | |
Signals | |
void | textChanged (const QString &) |
Emitted when the text in the lineedit changes. | |
void | returnPressed () |
Emitted when return or enter was pressed in the lineedit. | |
void | returnPressed (const QString &) |
Emitted when return or enter was pressed in the lineedit. | |
void | openFileDialog (KURLRequester *) |
Emitted before the filedialog is going to open. | |
void | urlSelected (const QString &) |
Emitted when the user changed the URL via the file dialog. | |
Public Member Functions | |
KURLRequester (QWidget *parent=0, const char *name=0) | |
Constructs a KURLRequester widget. | |
KURLRequester (const QString &url, QWidget *parent=0, const char *name=0) | |
Constructs a KURLRequester widget with the initial URL url . | |
KURLRequester (QWidget *editWidget, QWidget *parent, const char *name=0) | |
Special constructor, which creates a KURLRequester widget with a custom edit-widget. | |
~KURLRequester () | |
Destructs the KURLRequester. | |
QString | url () const |
void | setShowLocalProtocol (bool b) |
Enables/disables showing file:/ in the lineedit, when a local file has been selected in the filedialog or was set via setURL(). | |
void | setMode (unsigned int m) |
Sets the mode of the file dialog. | |
void | setFilter (const QString &filter) |
Sets the filter for the file dialog. | |
bool | showLocalProtocol () const |
virtual KFileDialog * | fileDialog () const |
KLineEdit * | lineEdit () const |
KComboBox * | comboBox () const |
KPushButton * | button () const |
KURLCompletion * | completionObject () const |
KEditListBox::CustomEditor | customEditor () |
Protected Slots | |
void | slotOpenDialog () |
Called when the button is pressed to open the filedialog. | |
Protected Member Functions | |
void | init () |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
KURLCompletion * | myCompletion |
Detailed Description
This class is a widget showing a lineedit and a button, which invokes a filedialog. A widget to request a filename/url from the user.File name completion is available in the lineedit.
The defaults for the filedialog are to ask for one existing local file, i.e. KFileDialog::setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly ) The default filter is "*", i.e. show all files, and the start directory is the current working directory, or the last directory where a file has been selected.
You can change this behavior by using setMode() or setFilter().
- Author:
- Carsten Pfeiffer <pfeiffer@kde.org>
Definition at line 54 of file kurlrequester.h.
Constructor & Destructor Documentation
|
Constructs a KURLRequester widget.
Definition at line 160 of file kurlrequester.cpp. References KStdAccel::name(). |
|
Constructs a KURLRequester widget with the initial URL
Definition at line 168 of file kurlrequester.cpp. References KStdAccel::name(), and setURL(). |
|
Special constructor, which creates a KURLRequester widget with a custom edit-widget. The edit-widget can be either a KComboBox or a KLineEdit (or inherited thereof). Note: for geometry management reasons, the edit-widget is reparented to have the KURLRequester as parent.
Definition at line 145 of file kurlrequester.cpp. References KStdAccel::name(), and QWidget::reparent(). |
|
Destructs the KURLRequester.
Definition at line 178 of file kurlrequester.cpp. |
Member Function Documentation
|
Definition at line 236 of file kurlrequester.cpp. Referenced by KOpenWithDlg::accept(), KURLPropsPlugin::applyChanges(), KURLRequesterDlg::selectedURL(), setShowLocalProtocol(), slotOpenDialog(), KOpenWithDlg::text(), and KURLBarItemDialog::url(). |
|
Enables/disables showing file:/ in the lineedit, when a local file has been selected in the filedialog or was set via setURL(). Default is false, not showing file:/
Definition at line 294 of file kurlrequester.cpp. |
|
Sets the mode of the file dialog. Note: you can only select one file with the filedialog, so KFile::Files doesn't make much sense.
Definition at line 261 of file kurlrequester.cpp. References KFileDialog::setMode(), and KURLCompletion::setMode(). Referenced by KURLBarItemDialog::KURLBarItemDialog(). |
|
Sets the filter for the file dialog.
Definition at line 272 of file kurlrequester.cpp. References KFileDialog::setFilter(). |
|
Definition at line 117 of file kurlrequester.h. |
|
Definition at line 279 of file kurlrequester.cpp. References KFileDialog::setFilter(), and KFileDialog::setMode(). Referenced by KURLRequesterDlg::fileDialog(), setCaption(), and slotOpenDialog(). |
|
Definition at line 308 of file kurlrequester.cpp. Referenced by KOpenWithDlg::init(), and KURLBarItemDialog::KURLBarItemDialog(). |
|
Definition at line 313 of file kurlrequester.cpp. Referenced by KOpenWithDlg::accept(), and KOpenWithDlg::init(). |
|
Definition at line 325 of file kurlrequester.cpp. Referenced by KOpenWithDlg::init(). |
|
Definition at line 150 of file kurlrequester.h. |
|
Definition at line 330 of file kurlrequester.cpp. |
|
Sets the url in the lineedit to Depending on the state of showLocalProtocol(), file:/ on local files will be shown or not.
Definition at line 220 of file kurlrequester.cpp. References QString::length(), QString::mid(), and QString::startsWith(). Referenced by KOpenWithDlg::init(), KURLPropsPlugin::KURLPropsPlugin(), KURLRequester(), setShowLocalProtocol(), KOpenWithDlg::slotClear(), and slotOpenDialog(). |
|
Sets the caption of the file dialog.
Definition at line 230 of file kurlrequester.cpp. References fileDialog(), QWidget::setCaption(), and KDialog::setCaption(). |
|
Clears the lineedit/combobox.
Definition at line 303 of file kurlrequester.cpp. |
|
Emitted when the text in the lineedit changes. The parameter contains the contents of the lineedit.
|
|
Emitted when return or enter was pressed in the lineedit.
|
|
Emitted when return or enter was pressed in the lineedit. The parameter contains the contents of the lineedit. |
|
Emitted before the filedialog is going to open. Connect to this signal to "configure" the filedialog, e.g. set the filefilter, the mode, a preview-widget, etc. It's usually not necessary to set a URL for the filedialog, as it will get set properly from the editfield contents. If you use multiple KURLRequesters, you can connect all of them to the same slot and use the given KURLRequester pointer to know which one is going to open. Referenced by slotOpenDialog(). |
|
Emitted when the user changed the URL via the file dialog. The parameter contains the contents of the lineedit. Referenced by slotOpenDialog(). |
|
Called when the button is pressed to open the filedialog. Also called when KStdAccel::Open (default is Ctrl-O) is pressed. Definition at line 242 of file kurlrequester.cpp. References QDialog::exec(), fileDialog(), openFileDialog(), KURL::prettyURL(), KURL::protocol(), KFileDialog::selectedURL(), KFileDialog::setSelection(), setURL(), KProtocolInfo::supportsListing(), KURL::url(), url(), and urlSelected(). |
The documentation for this class was generated from the following files: