KNameAndUrlInputDialog Class

Dialog to ask for a name (e.g. filename) and a URL. More...

Header: #include <KNameAndUrlInputDialog>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KF6::KIOFileWidgets)
Inherits: QDialog

Public Functions

KNameAndUrlInputDialog(const QString &nameLabel, const QString &urlLabel, const QUrl &startDir, QWidget *parent)
QString name() const
void setSuggestedName(const QString &name)
void setSuggestedUrl(const QUrl &url)
QUrl url() const
(since 5.25) QString urlText() const

Detailed Description

Basically a merge of KLineEditDlg and KUrlRequesterDlg ;)

Member Function Documentation

KNameAndUrlInputDialog::KNameAndUrlInputDialog(const QString &nameLabel, const QString &urlLabel, const QUrl &startDir, QWidget *parent)

nameLabel label for the name field

urlLabel label for the URL requester

startDir start directory for the URL requester (optional)

parent parent widget

QString KNameAndUrlInputDialog::name() const

Returns the name the user entered

void KNameAndUrlInputDialog::setSuggestedName(const QString &name)

Pre-fill the name lineedit.

void KNameAndUrlInputDialog::setSuggestedUrl(const QUrl &url)

Pre-fill the URL requester.

QUrl KNameAndUrlInputDialog::url() const

Returns the URL the user entered

[since 5.25] QString KNameAndUrlInputDialog::urlText() const

Returns the URL the user entered, as plain text. This is only useful for creating relative symlinks.

This function was introduced in 5.25.