1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-18 19:52:09 +01:00

GUI plishing

This commit is contained in:
Martin Tůma 2016-10-12 22:37:40 +02:00
parent be3c101c07
commit 0ca264b176
3 changed files with 15 additions and 0 deletions

View File

@ -91,6 +91,7 @@ ExportDialog::ExportDialog(QPrinter *printer, QWidget *parent)
line->setFrameShadow(QFrame::Sunken);
pageSetupLayout->addRow(line);
pageSetupLayout->addRow(tr("File:"), _fileSelect);
pageSetupLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
#else // Q_OS_MAC
pageSetupBox->setLayout(pageSetupLayout);
#endif // Q_OS_MAC

View File

@ -1,3 +1,4 @@
#include <QPushButton>
#include <QToolButton>
#include <QFileDialog>
#include <QHBoxLayout>
@ -12,8 +13,13 @@ FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent)
QFontMetrics fm(QApplication::font());
_edit = new QLineEdit();
_edit->setMinimumWidth(fm.boundingRect(QDir::homePath()).width());
#ifdef Q_OS_WIN32
_button = new QPushButton("...");
_button->setMaximumWidth(_button->sizeHint().width() / 2);
#else // Q_OS_WIN32
_button = new QToolButton();
_button->setText("...");
#endif // Q_OS_WIN32
connect(_button, SIGNAL(clicked()), this, SLOT(browse()));
QHBoxLayout *layout = new QHBoxLayout();
@ -21,6 +27,9 @@ FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent)
layout->addWidget(_edit);
layout->addWidget(_button);
setLayout(layout);
QSizePolicy p(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
setSizePolicy(p);
}
void FileSelectWidget::browse()

View File

@ -4,6 +4,7 @@
#include <QWidget>
#include <QLineEdit>
class QPushButton;
class QToolButton;
class FileSelectWidget : public QWidget
@ -22,7 +23,11 @@ private slots:
private:
QLineEdit *_edit;
#ifdef Q_OS_WIN32
QPushButton *_button;
#else // Q_OS_WIN32
QToolButton *_button;
#endif // Q_OS_WIN32
QString _filter;
};