[QScintilla] Re: QScintilla Digest, Vol 19, Issue 4

Patrick Mabie pmabie at gmail.com
Sun Feb 10 16:51:10 GMT 2008


    Hi Phil and all!
> Using: Visual Studio 2008,QScintilla-gpl-2-snapshot-20080120,Qt 4.3.3
>
> //Connection to this Signal
> void QsciScintilla::cursorPositionChanged (int line, int pos) [signal]
> connect(CurrentEditor(),SIGNAL(cursorPositionChanged 
> (int,in)),this,SLOT(UpdateRowCol(int,int)))
>
> void MainWindow::processEvents()
> {
>     qApp->processEvents(QEventLoop::AllEvents);
> }
>
> void MainWindow::UpdateRowCol(int line,int pos)
> {
>     QString RowCol;
>     RowCol = QString(tr("Row%1 Col %2).arg(line).arg(pos));
>     statusBar()->showMessage(tr("Row      Col      "));
>     statusBar()->showMessage(RowCol);
>     processEvents();
> }
>
> I couldn't belive the lag that was involved with this , if you didn't 
> let off the key it didn't update , I am not saying this is a bug or a 
> problem , I just was wonder if you or anyone how come across this?
>
> Thanks for your Time.
>
> Patrick.

Frist off thanks for replying and sorry for not including that routine , 
it's a QT one, As for processEvent(), I only added that when I thought 
there was a event problem.

/*!
    Hides the normal status indications and displays the given \a
    message for the specified \a timeout milli-seconds (if non-zero),
    or until clearMessage() or another showMessage() is called,
    whichever occurs first.

    \sa messageChanged(), currentMessage(), clearMessage()
*/
void QStatusBar::showMessage(const QString &message, int timeout)
{
    Q_D(QStatusBar);
    if (d->tempItem == message)
        return;

    d->tempItem = message;

    if (timeout > 0) {
        if (!d->timer) {
            d->timer = new QTimer(this);
            connect(d->timer, SIGNAL(timeout()), this, 
SLOT(clearMessage()));
        }
        d->timer->start(timeout);
    } else if (d->timer) {
        delete d->timer;
        d->timer = 0;
    }

    hideOrShow();
}


Hope this helps, sorry to upset you.

Have a good day!


More information about the QScintilla mailing list