GUI: Add completer to directory selector
Directory selector now suggest directory names Probably similar fixes should be applied to FileChooser in File mode Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
parent
8c93b29737
commit
0b310174ee
|
@ -25,6 +25,7 @@
|
|||
#ifndef _PreComp_
|
||||
# include <QApplication>
|
||||
# include <QButtonGroup>
|
||||
# include <QCompleter>
|
||||
# include <QComboBox>
|
||||
# include <QDesktopServices>
|
||||
# include <QGridLayout>
|
||||
|
@ -521,7 +522,14 @@ FileChooser::FileChooser ( QWidget * parent )
|
|||
layout->setMargin( 0 );
|
||||
layout->setSpacing( 6 );
|
||||
|
||||
lineEdit = new QLineEdit( this );
|
||||
lineEdit = new QLineEdit ( this );
|
||||
completer = new QCompleter ( this );
|
||||
completer->setMaxVisibleItems( 12 );
|
||||
fs_model = new QFileSystemModel( completer );
|
||||
fs_model->setRootPath(QString::fromUtf8(""));
|
||||
completer->setModel( fs_model );
|
||||
lineEdit->setCompleter( completer );
|
||||
|
||||
layout->addWidget( lineEdit );
|
||||
|
||||
connect(lineEdit, SIGNAL(textChanged(const QString &)),
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
#include <QFileDialog>
|
||||
#include <QFileIconProvider>
|
||||
#include <QFileSystemModel>
|
||||
#include <QCompleter>
|
||||
|
||||
class QButtonGroup;
|
||||
class QGridLayout;
|
||||
|
@ -177,6 +179,8 @@ private Q_SLOTS:
|
|||
|
||||
private:
|
||||
QLineEdit *lineEdit;
|
||||
QCompleter *completer;
|
||||
QFileSystemModel *fs_model;
|
||||
QPushButton *button;
|
||||
Mode md;
|
||||
QString _filter;
|
||||
|
|
Loading…
Reference in New Issue
Block a user