File: universalinputdialog.h

package info (click to toggle)
texstudio 2.3%2Bdebian-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 20,992 kB
  • sloc: cpp: 61,734; ansic: 4,300; xml: 726; sh: 125; makefile: 25
file content (30 lines) | stat: -rw-r--r-- 1,001 bytes parent folder | download
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
#ifndef UNIVERSALINPUTDIALOG_H
#define UNIVERSALINPUTDIALOG_H

#include "mostQtHeaders.h"

/* This class works almost like QInputDialog, except that it can ask for
   multiple values */
class UniversalInputDialog : public QDialog
{
	Q_OBJECT
private:
	QGridLayout* gridLayout;
	void addWidget(QWidget* widget, const QString& description="", void* storage=0);
private slots:
	void myAccept();
public:
	UniversalInputDialog(QWidget* parent=0);
	void addVariable(bool* var, const QString& description="");
	void addVariable(int* var, const QString& description="");
	void addVariable(QString* var, const QString& description="");
	void addVariable(QStringList* var, const QString& description="");
	void addTextEdit(QString* var, const QString& description="");
	void 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