mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-25 02:10:53 +00:00
Set header texts.
This commit is contained in:
parent
85f1e37155
commit
1df00cc8b3
2 changed files with 42 additions and 28 deletions
|
@ -50,6 +50,8 @@ void UXTEditor::open( QString filename )
|
||||||
d_ptr->t->setColumnCount( 2 );
|
d_ptr->t->setColumnCount( 2 );
|
||||||
d_ptr->t->setRowCount( infos.size() );
|
d_ptr->t->setRowCount( infos.size() );
|
||||||
|
|
||||||
|
setHeaderText( "Id", "Text" );
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
std::vector< STRING_MANAGER::TStringInfo >::const_iterator itr = infos.begin();
|
std::vector< STRING_MANAGER::TStringInfo >::const_iterator itr = infos.begin();
|
||||||
|
@ -93,4 +95,14 @@ void UXTEditor::closeEvent( QCloseEvent *e )
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UXTEditor::setHeaderText( const QString &id, const QString &text )
|
||||||
|
{
|
||||||
|
QTableWidgetItem *h1 = new QTableWidgetItem( id );
|
||||||
|
QTableWidgetItem *h2 = new QTableWidgetItem( text );
|
||||||
|
h1->setTextAlignment( Qt::AlignLeft );
|
||||||
|
h2->setTextAlignment( Qt::AlignLeft );
|
||||||
|
d_ptr->t->setHorizontalHeaderItem( 0, h1 );
|
||||||
|
d_ptr->t->setHorizontalHeaderItem( 1, h2 );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,8 @@ protected:
|
||||||
void closeEvent( QCloseEvent *e );
|
void closeEvent( QCloseEvent *e );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setHeaderText( const QString &id, const QString &text );
|
||||||
|
|
||||||
UXTEditorPvt *d_ptr;
|
UXTEditorPvt *d_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue