File: universalinputdialog.h

package info (click to toggle)
texstudio 2.11.2%2Bdebian-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 41,292 kB
  • ctags: 12,405
  • sloc: cpp: 93,072; xml: 10,217; ansic: 4,153; sh: 145; makefile: 56
file content (42 lines) | stat: -rw-r--r-- 1,655 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef UNIVERSALINPUTDIALOG_H
#define UNIVERSALINPUTDIALOG_H

#include "mostQtHeaders.h"

#include "configmanagerinterface.h"

/* This class works almost like QInputDialog, except that it can ask for
   multiple values */
class UniversalInputDialog : public QDialog
{
	Q_OBJECT

protected:
	QGridLayout *gridLayout;
	QList<ManagedProperty> properties;
	void addWidget(QWidget *widget, const QString &description = "", const ManagedProperty &prop = ManagedProperty());
	QCheckBox *addCheckBox(const ManagedProperty &mp, const QString &description);
	QComboBox *addComboBox(const ManagedProperty &mp, const QString &description);
	QSpinBox *addSpinBox(const ManagedProperty &mp, const QString &description);
	QDoubleSpinBox *addDoubleSpinBox(const ManagedProperty &mp, const QString &description);
	QLineEdit *addLineEdit(const ManagedProperty &mp, const QString &description);
	QTextEdit *addTextEdit(const ManagedProperty &mp, const QString &description);

private slots:
	void myAccept();

public:
	UniversalInputDialog(QWidget *parent = 0);
	QCheckBox *addVariable(bool *var, const QString &description = "");
	QSpinBox *addVariable(int *var, const QString &description = "");
	QLineEdit *addVariable(QString *var, const QString &description = "");
	QComboBox *addVariable(QStringList *var, const QString &description = "");
	QTextEdit *addTextEdit(QString *var, const QString &description = "");
	QDoubleSpinBox *addVariable(float *var, const QString &description = "");
	virtual void showEvent(QShowEvent *event);
};

//seems to be not necessary in qt4.5, but I'm not sure about older versions
Q_DECLARE_METATYPE(void *)

#endif // UNIVERSALDIALOG_H