From cb52ad8bc58c4af9b88e869a74b94ab1d37d6f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 11 Oct 2016 03:17:30 +0200 Subject: [PATCH] Better file select button --- src/fileselectwidget.cpp | 5 +++-- src/fileselectwidget.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fileselectwidget.cpp b/src/fileselectwidget.cpp index 7defa108..7cc6c69b 100644 --- a/src/fileselectwidget.cpp +++ b/src/fileselectwidget.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -12,7 +12,8 @@ FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent) QFontMetrics fm(QApplication::font()); _edit = new QLineEdit(); _edit->setMinimumWidth(fm.boundingRect(QDir::homePath()).width()); - _button = new QPushButton(tr("Browse...")); + _button = new QToolButton(); + _button->setText("..."); connect(_button, SIGNAL(clicked()), this, SLOT(browse())); QHBoxLayout *layout = new QHBoxLayout(); diff --git a/src/fileselectwidget.h b/src/fileselectwidget.h index ee0901e2..25111a10 100644 --- a/src/fileselectwidget.h +++ b/src/fileselectwidget.h @@ -4,7 +4,7 @@ #include #include -class QPushButton; +class QToolButton; class FileSelectWidget : public QWidget { @@ -22,7 +22,7 @@ private slots: private: QLineEdit *_edit; - QPushButton *_button; + QToolButton *_button; QString _filter; };