1 #ifndef LG_DIMZEROSBOX_H 2 #define LG_DIMZEROSBOX_H 3 4 #include <QComboBox> 5 //#include <QAbstractTableModel> 6 #include <QStandardItemModel> 7 #include <QListView> 8 9 /* 10 * DimZin value is mixed integer and bit flag value 11 * inches and feet are integer values, removal of left and right zeros are flags 12 * 0: removes 0' & 0" 13 * 1: draw 0' & 0" 14 * 2: removes 0" 15 * 4: removes 0' 16 * bit 3 set (4) remove 0 to the left 17 * bit 4 set (8) removes 0's to the right 18 * 19 * DimAZin value is integer or bit flag value 20 * 0: draw all 21 * 1: remove 0 to the left 22 * 2: removes 0's to the right 23 * 3: removes all zeros 24 */ 25 26 class LG_DimzerosBox : public QComboBox { 27 Q_OBJECT 28 29 public: 30 explicit LG_DimzerosBox(QWidget *parent = 0); 31 ~LG_DimzerosBox(); 32 void setLinear(); 33 void setData(int i); 34 int getData(); 35 private: 36 QStandardItemModel *model; 37 QListView *view; 38 bool dimLine; 39 int convertDimZin(int v, bool toIdx); 40 }; 41 42 #endif // LG_DIMZEROSBOX_H 43