1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-07 14:54:00 +01:00
GPXSee/src/GUI/fileselectwidget.h

44 lines
849 B
C
Raw Normal View History

2016-05-24 03:01:22 +02:00
#ifndef FILESELECTWIDGET_H
#define FILESELECTWIDGET_H
#include <QWidget>
#include <QLineEdit>
2016-10-12 22:37:40 +02:00
class QPushButton;
2016-10-11 03:17:30 +02:00
class QToolButton;
2016-05-24 03:01:22 +02:00
class FileSelectWidget : public QWidget
{
Q_OBJECT
public:
FileSelectWidget(QWidget *parent = 0);
#ifdef Q_OS_ANDROID
QString file() const {return _fileName;}
#else // Q_OS_ANDROID
2020-09-27 00:34:38 +02:00
QString file() const {return _edit->text();}
2016-05-24 03:01:22 +02:00
void setFile(const QString &file) {_edit->setText(file);}
void setFilter(const QString &filter) {_filter = filter;}
#endif // Q_OS_ANDROID
2020-09-27 00:34:38 +02:00
bool checkFile(QString &error) const;
2016-05-24 03:01:22 +02:00
private slots:
void browse();
private:
QLineEdit *_edit;
2016-10-12 22:37:40 +02:00
#ifdef Q_OS_WIN32
QPushButton *_button;
#else // Q_OS_WIN32
2016-10-11 03:17:30 +02:00
QToolButton *_button;
2016-10-12 22:37:40 +02:00
#endif // Q_OS_WIN32
#ifdef Q_OS_ANDROID
QString _fileName;
#else // Q_OS_ANDROID
2016-05-24 03:01:22 +02:00
QString _filter;
#endif // Q_OS_ANDROID
2016-05-24 03:01:22 +02:00
};
#endif // FILESELECTWIDGET_H