Populate VariablesView headers in class rather than ui/.
This commit is contained in:
@@ -29,11 +29,13 @@
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
enum ICol {
|
enum ICol {
|
||||||
I_COL_NAME = 0,
|
I_COL_NAME,
|
||||||
I_COL_TYPE = 1,
|
I_COL_TYPE,
|
||||||
I_COL_VALUE = 2,
|
I_COL_VALUE,
|
||||||
I_COL_INCREMENT = 3,
|
I_COL_INCREMENT,
|
||||||
I_COL_STEP_SIZE = 4
|
I_COL_STEP_SIZE,
|
||||||
|
I_COL_DUMMY,
|
||||||
|
N_COLS
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,6 +52,33 @@ namespace glabels
|
|||||||
setupUi( this );
|
setupUi( this );
|
||||||
|
|
||||||
titleLabel->setText( QString( "<span style='font-size:18pt;'>%1</span>" ).arg( tr("Variables") ) );
|
titleLabel->setText( QString( "<span style='font-size:18pt;'>%1</span>" ).arg( tr("Variables") ) );
|
||||||
|
|
||||||
|
table->setColumnCount( N_COLS );
|
||||||
|
|
||||||
|
auto* nameHeaderItem = new QTableWidgetItem( tr("Name") );
|
||||||
|
nameHeaderItem->setFlags( nameHeaderItem->flags() ^ Qt::ItemIsEditable );
|
||||||
|
table->setHorizontalHeaderItem( I_COL_NAME, nameHeaderItem );
|
||||||
|
|
||||||
|
auto* typeHeaderItem = new QTableWidgetItem( tr("Type") );
|
||||||
|
typeHeaderItem->setFlags( typeHeaderItem->flags() ^ Qt::ItemIsEditable );
|
||||||
|
table->setHorizontalHeaderItem( I_COL_TYPE, typeHeaderItem );
|
||||||
|
|
||||||
|
auto* valueHeaderItem = new QTableWidgetItem( tr("Value") );
|
||||||
|
valueHeaderItem->setFlags( valueHeaderItem->flags() ^ Qt::ItemIsEditable );
|
||||||
|
table->setHorizontalHeaderItem( I_COL_VALUE, valueHeaderItem );
|
||||||
|
|
||||||
|
auto* incrementHeaderItem = new QTableWidgetItem( tr("Increment") );
|
||||||
|
incrementHeaderItem->setFlags( incrementHeaderItem->flags() ^ Qt::ItemIsEditable );
|
||||||
|
table->setHorizontalHeaderItem( I_COL_INCREMENT, incrementHeaderItem );
|
||||||
|
|
||||||
|
auto* stepSizeHeaderItem = new QTableWidgetItem( tr("Step Size") );
|
||||||
|
stepSizeHeaderItem->setFlags( stepSizeHeaderItem->flags() ^ Qt::ItemIsEditable );
|
||||||
|
table->setHorizontalHeaderItem( I_COL_STEP_SIZE, stepSizeHeaderItem );
|
||||||
|
|
||||||
|
auto* dummyHeaderItem = new QTableWidgetItem();
|
||||||
|
dummyHeaderItem->setFlags( Qt::NoItemFlags );
|
||||||
|
table->setHorizontalHeaderItem( I_COL_DUMMY, dummyHeaderItem );
|
||||||
|
table->horizontalHeader()->setStretchLastSection( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="columnCount">
|
<property name="columnCount">
|
||||||
<number>5</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="verticalHeaderVisible">
|
<attribute name="verticalHeaderVisible">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@@ -47,31 +47,6 @@
|
|||||||
<attribute name="verticalHeaderHighlightSections">
|
<attribute name="verticalHeaderHighlightSections">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Name</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Type</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Value</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Increment</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Step Size</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
|
|||||||
+20
-20
@@ -1087,26 +1087,6 @@
|
|||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>VariablesView</name>
|
<name>VariablesView</name>
|
||||||
<message>
|
|
||||||
<source>Name</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Type</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Value</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Increment</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Step Size</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source><html><head/><body><p>Add variable</p></body></html></source>
|
<source><html><head/><body><p>Add variable</p></body></html></source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
@@ -2153,6 +2133,26 @@
|
|||||||
<source>Edit Variable</source>
|
<source>Edit Variable</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Name</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Type</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Value</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Increment</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Step Size</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>glabels::barcode::Backends</name>
|
<name>glabels::barcode::Backends</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user