patrik08
25th February 2007, 20:42
I have write my own QSqlTableModel && QSqlRelationalDelegate (date edit)
If model update a query QScrollBar go to int 0 now i have reimplement a function to save
the last scroll ... & after 2 msec. i move QScrollBar to this position...
this run ok .... but if i display a ToolTip from Line nr. on QScrollBar this tips gomming after
1 or 2 sek. .. Question How i can make tis tooltips faster like Calc from openoffice 2?
Is here an event to handle?.....
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);
}
note:
This text is paste from window XP .... Not from ubuntu firefox .... buggi \n\n
If model update a query QScrollBar go to int 0 now i have reimplement a function to save
the last scroll ... & after 2 msec. i move QScrollBar to this position...
this run ok .... but if i display a ToolTip from Line nr. on QScrollBar this tips gomming after
1 or 2 sek. .. Question How i can make tis tooltips faster like Calc from openoffice 2?
Is here an event to handle?.....
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);
}
note:
This text is paste from window XP .... Not from ubuntu firefox .... buggi \n\n