QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
Loading...
Searching...
No Matches
qgsencodingfiledialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsencodingfiledialog.h - File dialog which queries the encoding type
3 --------------------------------------
4 Date : 16-Feb-2005
5 Copyright : (C) 2005 by Marco Hugentobler
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSENCODINGFILEDIALOG_H
17#define QGSENCODINGFILEDIALOG_H
18
19#include "qgis_gui.h"
20#include "qgis_sip.h"
21
22#include <QFileDialog>
23
24class QComboBox;
25class QPushButton;
26
31class GUI_EXPORT QgsEncodingFileDialog : public QFileDialog
32{
33 Q_OBJECT
34 public:
39 QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &caption = QString(), const QString &directory = QString(), const QString &filter = QString(), const QString &encoding = QString()
40 );
42 QString encoding() const;
44 void addCancelAll();
46 bool cancelAll() const;
47
48 public slots:
49 void saveUsedEncoding();
50
52
53 private:
55 QComboBox *mEncodingComboBox = nullptr;
56
57 /* The button to click */
58 QPushButton *mCancelAllButton = nullptr;
59
60 /* Set if user clicked 'Cancel All' */
61 bool mCancelAll;
62};
63
68class GUI_EXPORT QgsEncodingSelectionDialog : public QDialog
69{
70 Q_OBJECT
71
72 public:
80 QgsEncodingSelectionDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &caption = QString(), const QString &encoding = QString(), Qt::WindowFlags flags = Qt::WindowFlags() );
81
86 QString encoding() const;
87
92 void setEncoding( const QString &encoding );
93
94 private:
95 QComboBox *mEncodingComboBox = nullptr;
96};
97
98
99#endif
QString encoding() const
Returns a string describing the chosen encoding.
void addCancelAll()
Adds a 'Cancel All' button for the user to click.
QgsEncodingFileDialog(QWidget *parent=nullptr, const QString &caption=QString(), const QString &directory=QString(), const QString &filter=QString(), const QString &encoding=QString())
Constructor for QgsEncodingFileDialog.
bool cancelAll() const
Returns true if the user clicked 'Cancel All'.
QString encoding() const
Returns the encoding selected within the dialog.
QgsEncodingSelectionDialog(QWidget *parent=nullptr, const QString &caption=QString(), const QString &encoding=QString(), Qt::WindowFlags flags=Qt::WindowFlags())
Constructor for QgsEncodingSelectionDialog.
void setEncoding(const QString &encoding)
Sets the encoding selected within the dialog.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52