2020-06-01 17:11:56 +01:00
|
|
|
#ifndef HCOMBOINPUTDIALOG_H
|
|
|
|
#define HCOMBOINPUTDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialogButtonBox>
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
|
|
class CComboInputDialogPrivate;
|
|
|
|
|
|
|
|
#include "../mischelpers_global.h"
|
|
|
|
|
|
|
|
class MISCHELPERS_EXPORT CComboInputDialog: public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString text READ text WRITE setText)
|
|
|
|
Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap)
|
|
|
|
Q_PROPERTY(QDialogButtonBox::StandardButtons buttons READ standardButtons WRITE setStandardButtons)
|
|
|
|
Q_PROPERTY(QDialogButtonBox::StandardButton defaultButton READ defaultButton WRITE setDefaultButton)
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit CComboInputDialog(QWidget *parent = NULL);
|
|
|
|
virtual ~CComboInputDialog();
|
|
|
|
|
|
|
|
QString text() const;
|
|
|
|
void setText(const QString &);
|
|
|
|
|
2022-07-09 10:46:07 +01:00
|
|
|
void addItem(const QString&, const QVariant & = QVariant(), const QString& info = QString());
|
2020-06-01 17:11:56 +01:00
|
|
|
void setEditable(bool);
|
|
|
|
|
|
|
|
QString value() const;
|
|
|
|
void setValue(const QString &);
|
2020-07-19 21:09:02 +01:00
|
|
|
int findValue(const QString &) const;
|
2020-06-01 17:11:56 +01:00
|
|
|
|
|
|
|
QVariant data() const;
|
|
|
|
void setData(const QVariant &);
|
2020-07-19 21:09:02 +01:00
|
|
|
int findData(const QVariant &) const;
|
2020-06-01 17:11:56 +01:00
|
|
|
|
|
|
|
QDialogButtonBox::StandardButtons standardButtons() const;
|
|
|
|
void setStandardButtons(QDialogButtonBox::StandardButtons s);
|
|
|
|
QPushButton *button(QDialogButtonBox::StandardButton b) const;
|
|
|
|
QPushButton *addButton(const QString &text, QDialogButtonBox::ButtonRole role);
|
|
|
|
|
|
|
|
QDialogButtonBox::StandardButton defaultButton() const;
|
|
|
|
void setDefaultButton(QDialogButtonBox::StandardButton s);
|
|
|
|
|
|
|
|
// See static QMessageBox::standardPixmap()
|
|
|
|
QPixmap iconPixmap() const;
|
|
|
|
void setIconPixmap (const QPixmap &p);
|
|
|
|
|
|
|
|
// Query the result
|
|
|
|
QAbstractButton *clickedButton() const;
|
|
|
|
QDialogButtonBox::StandardButton clickedStandardButton() const;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotClicked(QAbstractButton *b);
|
2022-07-09 10:46:07 +01:00
|
|
|
void onCmbIndex(int index);
|
2020-06-01 17:11:56 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
CComboInputDialogPrivate *d;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // HCOMBOINPUTDIALOG_H
|