mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
GUI plishing
This commit is contained in:
parent
be3c101c07
commit
0ca264b176
@ -91,6 +91,7 @@ ExportDialog::ExportDialog(QPrinter *printer, QWidget *parent)
|
|||||||
line->setFrameShadow(QFrame::Sunken);
|
line->setFrameShadow(QFrame::Sunken);
|
||||||
pageSetupLayout->addRow(line);
|
pageSetupLayout->addRow(line);
|
||||||
pageSetupLayout->addRow(tr("File:"), _fileSelect);
|
pageSetupLayout->addRow(tr("File:"), _fileSelect);
|
||||||
|
pageSetupLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||||
#else // Q_OS_MAC
|
#else // Q_OS_MAC
|
||||||
pageSetupBox->setLayout(pageSetupLayout);
|
pageSetupBox->setLayout(pageSetupLayout);
|
||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <QPushButton>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
@ -12,8 +13,13 @@ FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent)
|
|||||||
QFontMetrics fm(QApplication::font());
|
QFontMetrics fm(QApplication::font());
|
||||||
_edit = new QLineEdit();
|
_edit = new QLineEdit();
|
||||||
_edit->setMinimumWidth(fm.boundingRect(QDir::homePath()).width());
|
_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 = new QToolButton();
|
||||||
_button->setText("...");
|
_button->setText("...");
|
||||||
|
#endif // Q_OS_WIN32
|
||||||
connect(_button, SIGNAL(clicked()), this, SLOT(browse()));
|
connect(_button, SIGNAL(clicked()), this, SLOT(browse()));
|
||||||
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout();
|
QHBoxLayout *layout = new QHBoxLayout();
|
||||||
@ -21,6 +27,9 @@ FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent)
|
|||||||
layout->addWidget(_edit);
|
layout->addWidget(_edit);
|
||||||
layout->addWidget(_button);
|
layout->addWidget(_button);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
|
QSizePolicy p(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||||
|
setSizePolicy(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileSelectWidget::browse()
|
void FileSelectWidget::browse()
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
|
||||||
|
class QPushButton;
|
||||||
class QToolButton;
|
class QToolButton;
|
||||||
|
|
||||||
class FileSelectWidget : public QWidget
|
class FileSelectWidget : public QWidget
|
||||||
@ -22,7 +23,11 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QLineEdit *_edit;
|
QLineEdit *_edit;
|
||||||
|
#ifdef Q_OS_WIN32
|
||||||
|
QPushButton *_button;
|
||||||
|
#else // Q_OS_WIN32
|
||||||
QToolButton *_button;
|
QToolButton *_button;
|
||||||
|
#endif // Q_OS_WIN32
|
||||||
|
|
||||||
QString _filter;
|
QString _filter;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user