signals:
public slots:
/* incomming last scroll position from table scroll int like row nr + 1 */
void RamScroll( int finder )
{
scroller->setToolTip(tr("Line nr. %1").arg(finder + 1));
if (permission) {
lastscrollpos = finder;
}
}
/* incomming emit sql update from model after update go to last line */
void IncommingUpdate
( bool err ,
QString lastqueryupdate ,
int lastline
) {
permission = false;
oneditline = lastline;
///////////qDebug() << "### log sql " << lastscrollpos << " " << lastqueryupdate << " res->" << err;
/* wait a small piece by update model go line scroll 0 */
QTimer::singleShot(2,
this,
SLOT(ResetPermission
()));
}
void ResetPermission() {
scroller->setValue(lastscrollpos);
tabi->setAlternatingRowColors(true);
tabi->resizeColumnsToContents();
tabi->selectRow( oneditline );
permission = true;
}
/* go to next limit x paintButton befor model */
void next()
{
int summrow = summRow() ;
showfrom = showfrom + limitfixrow;
paintButton();
model = new Beruf_model_A(db,showfrom,limitfixrow);
tabi->setModel(model);
connect( model ,
SIGNAL(OnUpdate
(bool,
QString,
int)),
this,
SLOT(IncommingUpdate
(bool,
QString,
int)));
scroller->setValue(0);
}
/* go to prev (if button enable) limit x paintButton befor model */
void prev()
{
int summrow = summRow() ;
showfrom = showfrom - limitfixrow;
paintButton();
model = new Beruf_model_A(db,showfrom,limitfixrow);
tabi->setModel(model);
connect( model ,
SIGNAL(OnUpdate
(bool,
QString,
int)),
this,
SLOT(IncommingUpdate
(bool,
QString,
int)));
scroller->setValue(0);
}
signals:
public slots:
/* incomming last scroll position from table scroll int like row nr + 1 */
void RamScroll( int finder )
{
scroller->setToolTip(tr("Line nr. %1").arg(finder + 1));
if (permission) {
lastscrollpos = finder;
}
}
/* incomming emit sql update from model after update go to last line */
void IncommingUpdate( bool err , QString lastqueryupdate , int lastline )
{
permission = false;
oneditline = lastline;
///////////qDebug() << "### log sql " << lastscrollpos << " " << lastqueryupdate << " res->" << err;
/* wait a small piece by update model go line scroll 0 */
QTimer::singleShot(2, this, SLOT(ResetPermission()));
}
void ResetPermission() {
scroller->setValue(lastscrollpos);
tabi->setAlternatingRowColors(true);
tabi->resizeColumnsToContents();
tabi->selectRow( oneditline );
permission = true;
}
/* go to next limit x paintButton befor model */
void next()
{
int summrow = summRow() ;
showfrom = showfrom + limitfixrow;
paintButton();
model = new Beruf_model_A(db,showfrom,limitfixrow);
tabi->setModel(model);
connect( model , SIGNAL(OnUpdate(bool,QString,int)), this, SLOT(IncommingUpdate(bool,QString,int)));
scroller->setValue(0);
}
/* go to prev (if button enable) limit x paintButton befor model */
void prev()
{
int summrow = summRow() ;
showfrom = showfrom - limitfixrow;
paintButton();
model = new Beruf_model_A(db,showfrom,limitfixrow);
tabi->setModel(model);
connect( model , SIGNAL(OnUpdate(bool,QString,int)), this, SLOT(IncommingUpdate(bool,QString,int)));
scroller->setValue(0);
}
To copy to clipboard, switch view to plain text mode
note:
Bookmarks