mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-11 01:40:00 +00:00
Implemented row deletion / insertion.
This commit is contained in:
parent
ffa6d8b958
commit
279db31a5b
2 changed files with 28 additions and 0 deletions
|
@ -148,6 +148,30 @@ void UXTEditor::activateWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void UXTEditor::insertRow()
|
||||||
|
{
|
||||||
|
d_ptr->infos.push_back( STRING_MANAGER::TStringInfo() );
|
||||||
|
d_ptr->t->setRowCount( d_ptr->t->rowCount() + 1 );
|
||||||
|
|
||||||
|
setWindowModified( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void UXTEditor::deleteRow()
|
||||||
|
{
|
||||||
|
int r = d_ptr->t->currentRow();
|
||||||
|
if( r < 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::vector< STRING_MANAGER::TStringInfo >::iterator itr = d_ptr->infos.begin();
|
||||||
|
itr += r;
|
||||||
|
d_ptr->infos.erase( itr );
|
||||||
|
|
||||||
|
d_ptr->t->removeRow( r );
|
||||||
|
|
||||||
|
setWindowModified( true );
|
||||||
|
}
|
||||||
|
|
||||||
void UXTEditor::closeEvent( QCloseEvent *e )
|
void UXTEditor::closeEvent( QCloseEvent *e )
|
||||||
{
|
{
|
||||||
if( isWindowModified() )
|
if( isWindowModified() )
|
||||||
|
|
|
@ -37,6 +37,10 @@ public:
|
||||||
void saveAs( QString filename );
|
void saveAs( QString filename );
|
||||||
void activateWindow();
|
void activateWindow();
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void insertRow();
|
||||||
|
void deleteRow();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent( QCloseEvent *e );
|
void closeEvent( QCloseEvent *e );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue