vertikalheader = new QHeaderView(Qt::Vertical,this);
vertikalheader = tabella_core->verticalHeader();
connect (vertikalheader,SIGNAL( sectionDoubleClicked(int)),this,SLOT(VertikalRow(int)));
wen 10 row sind geht ein doppelclick alle 10 durch... dabei will ich ja nur einen row loeschen .... was mache ich falsch!
eine zeile loeschen....
Code: Alles auswählen
void Include_Table::VertikalRow(int i)
{ /* Header QMessageBox *msgb; */
int noloop = 10;
sqlmodel->revertRow(i); /* not save or update nothing on this row! undo! */
noloop++;
if (noloop == 11) {
QString msgDB =tr("<p>Make a selection .. </p><p>You Confirm to remove row:</p><p>Click Yes (remove) button or press Esc.</p>");
int reply = msgb->question(this, tr("Confirm to Delete this row?")+QString( " row nr.%1" ).arg( int2char( i ) ),
msgDB,
msgb->Yes,
msgb->No);
if (reply == 3 and reply !=0x200) { /* 0x200 = ESC doc! */
bool remove_confirm = sqlmodel->removeRows(i,1);
if (!remove_confirm ) {
msgb->information( this , tr("Error delete row!"),tr("Sqlite 3 cant remove this row ")+QString( "%1" ).arg( int2char( i ) ));
}
}
}
RefillTable( tablename ); /* tabelle neu laden ... */
}