Add options for Grid Matrix

This commit is contained in:
hooper114 2009-10-31 22:43:40 +00:00
parent 6beac47e8d
commit 054bd02dcc
4 changed files with 314 additions and 89 deletions

199
frontend_qt4/grpGrid.ui Normal file
View File

@ -0,0 +1,199 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>grpGrid</class>
<widget class="QWidget" name="grpGrid">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>423</width>
<height>159</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QRadioButton" name="radGridAuto">
<property name="text">
<string>A&amp;utomatic Resizing</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="radGridSize">
<property name="text">
<string>Adjust Si&amp;ze To:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cmbGridSize">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>18 x 18 (Version 1)</string>
</property>
</item>
<item>
<property name="text">
<string>30 x 30 (Version 2)</string>
</property>
</item>
<item>
<property name="text">
<string>42 x 40 (Version 3)</string>
</property>
</item>
<item>
<property name="text">
<string>54 x 54 (Version 4)</string>
</property>
</item>
<item>
<property name="text">
<string>66 x 66 (Version 5)</string>
</property>
</item>
<item>
<property name="text">
<string>78 x 78 (Version 6)</string>
</property>
</item>
<item>
<property name="text">
<string>90 x 90 (Version 7)</string>
</property>
</item>
<item>
<property name="text">
<string>102 x 102 (Version 8)</string>
</property>
</item>
<item>
<property name="text">
<string>114 x 114 (Version 9)</string>
</property>
</item>
<item>
<property name="text">
<string>126 x 126 (Version 10)</string>
</property>
</item>
<item>
<property name="text">
<string>138 x 138 (Version 11)</string>
</property>
</item>
<item>
<property name="text">
<string>150 x 150 (Version 12)</string>
</property>
</item>
<item>
<property name="text">
<string>162 x 162 (Version 13)</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="radGridECC">
<property name="text">
<string>Add &amp;Error Correction:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="cmbGridECC">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>~10%</string>
</property>
</item>
<item>
<property name="text">
<string>~20%</string>
</property>
</item>
<item>
<property name="text">
<string>~30%</string>
</property>
</item>
<item>
<property name="text">
<string>~40%</string>
</property>
</item>
<item>
<property name="text">
<string>~50%</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>radGridSize</sender>
<signal>toggled(bool)</signal>
<receiver>cmbGridSize</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>98</x>
<y>54</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>53</y>
</hint>
</hints>
</connection>
<connection>
<sender>radGridECC</sender>
<signal>toggled(bool)</signal>
<receiver>cmbGridECC</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>114</x>
<y>89</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>89</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -1,7 +1,8 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>grpQR</class> <class>grpQR</class>
<widget class="QWidget" name="grpQR" > <widget class="QWidget" name="grpQR">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -9,265 +10,265 @@
<height>208</height> <height>208</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout" > <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QGridLayout" name="gridLayout" > <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" > <item row="0" column="0">
<widget class="QRadioButton" name="radQRAuto" > <widget class="QRadioButton" name="radQRAuto">
<property name="text" > <property name="text">
<string>A&amp;utomatic Resizing</string> <string>A&amp;utomatic Resizing</string>
</property> </property>
<property name="checked" > <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="1" column="0">
<widget class="QRadioButton" name="radQRSize" > <widget class="QRadioButton" name="radQRSize">
<property name="text" > <property name="text">
<string>Adjust Si&amp;ze To:</string> <string>Adjust Si&amp;ze To:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" > <item row="1" column="1">
<widget class="QComboBox" name="cmbQRSize" > <widget class="QComboBox" name="cmbQRSize">
<property name="enabled" > <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<item> <item>
<property name="text" > <property name="text">
<string>21 x 21 (Version 1)</string> <string>21 x 21 (Version 1)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>25 x 25 (Version 2)</string> <string>25 x 25 (Version 2)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>29 x 29 (Version 3)</string> <string>29 x 29 (Version 3)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>33 x 33 (Version 4)</string> <string>33 x 33 (Version 4)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>37 x 37 (Version 5)</string> <string>37 x 37 (Version 5)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>41 x 41 (Version 6)</string> <string>41 x 41 (Version 6)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>45 x 45 (Version 7)</string> <string>45 x 45 (Version 7)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>49 x 49 (Version 8)</string> <string>49 x 49 (Version 8)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>53 x 53 (Version 9)</string> <string>53 x 53 (Version 9)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>57 x 57 (Version 10)</string> <string>57 x 57 (Version 10)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>61 x 61 (Version 11)</string> <string>61 x 61 (Version 11)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>65 x 65 (Version 12)</string> <string>65 x 65 (Version 12)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>69 x 69 (Version 13)</string> <string>69 x 69 (Version 13)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>73 x 73 (Version 14)</string> <string>73 x 73 (Version 14)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>77 x 77 (Version 15)</string> <string>77 x 77 (Version 15)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>81 x 81 (Version 16)</string> <string>81 x 81 (Version 16)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>85 x 85 (Version 17)</string> <string>85 x 85 (Version 17)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>89 x 89 (Version 18)</string> <string>89 x 89 (Version 18)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>93 x 93 (Version 19)</string> <string>93 x 93 (Version 19)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>97 x 97 (Version 20)</string> <string>97 x 97 (Version 20)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>101 x 101 (Version 21)</string> <string>101 x 101 (Version 21)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>105 x 105 (Version 22)</string> <string>105 x 105 (Version 22)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>109 x 109 (Version 23)</string> <string>109 x 109 (Version 23)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>113 x 113 (Version 24)</string> <string>113 x 113 (Version 24)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>117 x 117 (Version 25)</string> <string>117 x 117 (Version 25)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>121 x 121 (Version 26)</string> <string>121 x 121 (Version 26)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>125 x 125 (Version 27)</string> <string>125 x 125 (Version 27)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>129 x 129 (Version 28)</string> <string>129 x 129 (Version 28)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>133 x 133 (Version 29)</string> <string>133 x 133 (Version 29)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>137 x 137 (Version 30)</string> <string>137 x 137 (Version 30)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>141 x 141 (Version 31)</string> <string>141 x 141 (Version 31)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>145 x 145 (Version 32)</string> <string>145 x 145 (Version 32)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>149 x 149 (Version 33)</string> <string>149 x 149 (Version 33)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>153 x 153 (Version 34)</string> <string>153 x 153 (Version 34)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>157 x 157 (Version 35)</string> <string>157 x 157 (Version 35)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>161x 161 (Version 36)</string> <string>161 x 161 (Version 36)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>165 x 165 (Version 37)</string> <string>165 x 165 (Version 37)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>169 x 169 (Version 38)</string> <string>169 x 169 (Version 38)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>173 x 173 (Version 39)</string> <string>173 x 173 (Version 39)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>177 x 177 (Version 40)</string> <string>177 x 177 (Version 40)</string>
</property> </property>
</item> </item>
</widget> </widget>
</item> </item>
<item row="2" column="0" > <item row="2" column="0">
<widget class="QRadioButton" name="radQRECC" > <widget class="QRadioButton" name="radQRECC">
<property name="text" > <property name="text">
<string>Add &amp;Error Correction:</string> <string>Add &amp;Error Correction:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" > <item row="2" column="1">
<widget class="QComboBox" name="cmbQRECC" > <widget class="QComboBox" name="cmbQRECC">
<property name="enabled" > <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<item> <item>
<property name="text" > <property name="text">
<string>~20% (Level L)</string> <string>~20% (Level L)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>~37% (Level M)</string> <string>~37% (Level M)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>~55% (Level Q)</string> <string>~55% (Level Q)</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>~65% (Level H)</string> <string>~65% (Level H)</string>
</property> </property>
</item> </item>
@ -276,18 +277,18 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="grpAztecMode" > <widget class="QGroupBox" name="grpAztecMode">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>70</height> <height>70</height>
</size> </size>
</property> </property>
<property name="title" > <property name="title">
<string>Data Encoding</string> <string>Data Encoding</string>
</property> </property>
<widget class="QRadioButton" name="radQRStand" > <widget class="QRadioButton" name="radQRStand">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>17</y> <y>17</y>
@ -295,21 +296,21 @@
<height>24</height> <height>24</height>
</rect> </rect>
</property> </property>
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="text" > <property name="text">
<string>S&amp;tandard</string> <string>S&amp;tandard</string>
</property> </property>
<property name="checked" > <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" name="radQRHIBC" > <widget class="QRadioButton" name="radQRHIBC">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>200</x> <x>200</x>
<y>14</y> <y>14</y>
@ -317,12 +318,12 @@
<height>24</height> <height>24</height>
</rect> </rect>
</property> </property>
<property name="text" > <property name="text">
<string>&amp;HIBC QR Code</string> <string>&amp;HIBC QR Code</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" name="radQRGS1" > <widget class="QRadioButton" name="radQRGS1">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>9</x> <x>9</x>
<y>41</y> <y>41</y>
@ -330,18 +331,18 @@
<height>24</height> <height>24</height>
</rect> </rect>
</property> </property>
<property name="text" > <property name="text">
<string>&amp;GS-1 Data Mode</string> <string>&amp;GS-1 Data Mode</string>
</property> </property>
</widget> </widget>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer" > <spacer name="verticalSpacer">
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0" > <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>35</height> <height>35</height>
@ -359,11 +360,11 @@
<receiver>cmbQRSize</receiver> <receiver>cmbQRSize</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel">
<x>89</x> <x>89</x>
<y>39</y> <y>39</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel">
<x>255</x> <x>255</x>
<y>46</y> <y>46</y>
</hint> </hint>
@ -375,11 +376,11 @@
<receiver>cmbQRECC</receiver> <receiver>cmbQRECC</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel">
<x>95</x> <x>95</x>
<y>79</y> <y>79</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel">
<x>308</x> <x>308</x>
<y>79</y> <y>79</y>
</hint> </hint>

View File

@ -409,6 +409,21 @@ void MainWindow::change_options()
connect(m_optionWidget->findChild<QObject*>("cmbMQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbMQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
} }
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_GRIDMATRIX)
{
QFile file(":/grpGrid.ui");
if (!file.open(QIODevice::ReadOnly))
return;
m_optionWidget=uiload.load(&file);
file.close();
tabMain->insertTab(1,m_optionWidget,tr("Grid Matrix"));
connect(m_optionWidget->findChild<QObject*>("radGridAuto"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radGridSize"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radGridECC"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbGridSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbGridECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
}
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_MAXICODE) if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_MAXICODE)
{ {
@ -750,11 +765,20 @@ void MainWindow::update_preview()
case BARCODE_MICROQR: case BARCODE_MICROQR:
m_bc.bc.setSymbol(BARCODE_MICROQR); m_bc.bc.setSymbol(BARCODE_MICROQR);
if(m_optionWidget->findChild<QRadioButton*>("radMQRSize")->isChecked()) if(m_optionWidget->findChild<QRadioButton*>("radMQRSize")->isChecked())
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbMQRSize")->currentIndex() + 1); m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbMQRSize")->currentIndex());
if(m_optionWidget->findChild<QRadioButton*>("radMQRECC")->isChecked()) if(m_optionWidget->findChild<QRadioButton*>("radMQRECC")->isChecked())
m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbMQRECC")->currentIndex() + 1); m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbMQRECC")->currentIndex() + 1);
break; break;
case BARCODE_GRIDMATRIX:
m_bc.bc.setSymbol(BARCODE_GRIDMATRIX);
if(m_optionWidget->findChild<QRadioButton*>("radGridSize")->isChecked())
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbGridSize")->currentIndex() + 1);
if(m_optionWidget->findChild<QRadioButton*>("radGridECC")->isChecked())
m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbGridECC")->currentIndex() + 1);
break;
case BARCODE_MAXICODE: case BARCODE_MAXICODE:
m_bc.bc.setSymbol(BARCODE_MAXICODE); m_bc.bc.setSymbol(BARCODE_MAXICODE);

View File

@ -20,5 +20,6 @@
<file>grpQR.ui</file> <file>grpQR.ui</file>
<file>grpCodeOne.ui</file> <file>grpCodeOne.ui</file>
<file>grpC49.ui</file> <file>grpC49.ui</file>
<file>grpGrid.ui</file>
</qresource> </qresource>
</RCC> </RCC>