-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
askFlagsDialog.h
56 lines (46 loc) · 1.63 KB
/
askFlagsDialog.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* OpenBRF -- by marco tarini. Provided under GNU General Public License */
#ifndef ASKFLAGSDIALOG_H
#define ASKFLAGSDIALOG_H
#include <QDialog>
class QCheckBox;
class QStatusBar;
class QGroupBox;
class QComboBox;
namespace Ui {
class AskFlagsDialog;
}
class AskFlagsDialog : public QDialog {
Q_OBJECT
public:
AskFlagsDialog(QWidget *parent, QString title, unsigned int ones, unsigned int zeros, QString* names);
~AskFlagsDialog();
unsigned int toOne() const; // result: flags that must be set to 1
unsigned int toZero() const;
void setBitCombo(QString name, QString tip, int a, int b, int* options, int zeroIndex = 0);
void setBitCombo(QString name, QString tip, int a, int b, const char** options, int zeroIndex = 0);
protected:
void changeEvent(QEvent *e);
void comboboxes2checkboxes();
void checkboxes2comboboxes();
void combobox2checkbox(int i);
void checkbox2combobox(int i);
bool event(QEvent * e);
QStatusBar *myStatusBar;
private:
static bool showingAll;
Ui::AskFlagsDialog *m_ui;
QCheckBox* cb[32];
enum{_NORMAL,_UNUSED,_RESERVED, _BIT} status[32];
// bit combos: quick and dirty: four parallel vector
std::vector<QWidget*> bcGB; // group box
std::vector<QComboBox*> bcCB;
std::vector<int> bcA; // (A-B): interval
std::vector<int> bcB;
std::vector<int> bcZeroIndex;
void _setBitCombo(QString name, QString tip, int a, int b, int* optionsInt, const char** optionsChars, int zeroIndex);
public slots:
int exec();
private slots:
void showAll(bool);
};
#endif // ASKFLAGSDIALOG_H