kdevplatform/project
projectitemlineedit.cpp
Go to the documentation of this file.
97 return KDevelop::joinWithEscaping(removeProjectBasePath( mModel->pathFromIndex(index), mBase ), sep, escape)+postfix;
110 QStringList path = joinProjectBasePath( KDevelop::splitWithEscaping( input, sep, escape ), mBase );
125 if( model->data( model->index( i, 0, idx ) ).toString().startsWith( end, Qt::CaseInsensitive ) )
137 bool matchesAnyName = std::any_of(projects.begin(), projects.end(), [&](KDevelop::IProject* project) {
169 setPlaceholderText( i18nc("@info:placeholder", "Enter the path to an item from the projects tree..." ) );
171 auto* selectItemAction = new QAction(QIcon::fromTheme(QStringLiteral("folder-document")), i18nc("@action", "Select..."), this);
176 connect(this, &ProjectItemLineEdit::customContextMenuRequested, this, &ProjectItemLineEdit::showCtxMenu);
266 return model->itemFromIndex(model->pathToIndex(KDevelop::splitWithEscaping(text(), QLatin1Char('/'), QLatin1Char('\\'))));
T & first()
void setPlaceholderText(const QString &)
Definition: projectproxymodel.h:31
void setValidator(const QValidator *v)
QList< QAction * > actions() const
QMenu * createStandardContextMenu()
virtual void reject()
void setShortcut(const QKeySequence &key)
void setBaseItem(KDevelop::ProjectBaseItem *item)
Sets item as the base item for this lineedit, the user then doesn't need to specify the path leading ...
Definition: projectitemlineedit.cpp:247
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Definition: projectmodel.cpp:1033
void customContextMenuRequested(const QPoint &pos)
Interface that allows a developer to implement the three basic types of items you would see in a mult...
Definition: projectmodel.h:101
int count(const T &value) const
QIcon fromTheme(const QString &name, const QIcon &fallback)
Class providing some convenience methods for accessing the project model.
Definition: projectmodel.h:420
void selectAll()
virtual QStringList splitPath(const QString &path) const
ProjectItemLineEdit(QWidget *parent=nullptr)
Definition: projectitemlineedit.cpp:161
KDevelop::ProjectBaseItem * baseItem() const
Definition: projectitemlineedit.cpp:256
ProjectBaseItem * itemFromIndex(const QModelIndex &) const
Definition: projectmodel.cpp:967
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual State validate(QString &input, int &pos) const=0
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition: projectmodel.cpp:978
virtual QString pathFromIndex(const QModelIndex &index) const
char * toString(const T &value)
void setText(const QString &)
bool isEmpty() const
void setWindowTitle(const QString &)
~ProjectItemLineEdit() override
void accepted()
virtual void accept()
QStringList joinProjectBasePath(const QStringList &partialpath, KDevelop::ProjectBaseItem *item)
Definition: projectmodel.cpp:62
void setCompleter(QCompleter *c)
QPoint mapToGlobal(const QPoint &pos) const
KDevelop::ProjectBaseItem * currentItem() const
Definition: projectitemlineedit.cpp:263
int exec()
bool isValid() const
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
void triggered(bool checked)
void rejected()
Definition: abstractfilemanagerplugin.h:33
void setSuggestion(KDevelop::IProject *project)
Definition: projectitemlineedit.cpp:269
QStringList itemPath() const
Generates a path from the content of the lineedit, including the base item if present.
Definition: projectitemlineedit.cpp:240
void setDefault(bool)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: projectmodel.cpp:942
QStringList removeProjectBasePath(const QStringList &fullpath, KDevelop::ProjectBaseItem *item)
Definition: projectmodel.cpp:46
void addAction(QAction *action)
void setItemPath(const QStringList &path)
Sets this lineedit to show the given path, eventually removing parts from the beginning if a base ite...
Definition: projectitemlineedit.cpp:233
T takeLast()
QModelIndex pathToIndex(const QStringList &tofetch) const
Definition: projectmodel.cpp:885
QStringList pathFromIndex(const QModelIndex &index) const
Definition: projectmodel.cpp:920
Definition: projectitemlineedit.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Mar 8 2021 23:30:20 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Mar 8 2021 23:30:20 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.