Date:2010-04-07 19:36:17 (10 years 4 months ago)
Author:Mirko Lindner
Commit:c4feb4a5b3e770f892f763eaaab3193ac2431ccb
Message:add mouse movement

Signed-off-by: Mirko Lindner <mirko@sharism.cc>
Files: htmlarea.cpp (2 diffs)
htmlarea.h (1 diff)
moc_htmlarea.cpp (1 diff)
moc_qmain.cpp (1 diff)
qmain.cpp (3 diffs)

Change Details

htmlarea.cpp
115115        log_debug("Text set");
116116// log_debug("index: " << article.getIndex());
117117// log_debug("enabled: " << this->isEnabled());
118        log_debug("string: " << str.toUtf8().data());
119118        qApp->processEvents();
120119        qobject_cast<QMain *>(this->parentWidget())->setEnabled(true);
120        log_debug("string: " << str.toUtf8().data());
121121
122122    }else{
123123        this->setText(current);
...... 
324324        log_debug("term :" << phrase.toUtf8().data());
325325        return result;
326326}
327
328///////////////////////////////////
329// functions related to navigation
330
331void HtmlArea::keyPressEvent(QKeyEvent *e){
332    log_debug("key pressed");
333    switch (e->key()) {
334         case Qt::Key_Right:
335                {
336                    QPoint pos = qApp->overrideCursor()->pos();
337                    qApp->overrideCursor()->setPos(pos.x() + 5, pos.y());
338                }
339                return;
340
341            case Qt::Key_Left:
342                {
343                    QPoint pos = qApp->overrideCursor()->pos();
344                    qApp->overrideCursor()->setPos(pos.x() - 5, pos.y());
345                }
346                return;
347
348            case Qt::Key_Down:
349                {
350                    QPoint pos = qApp->overrideCursor()->pos();
351                    qApp->overrideCursor()->setPos(pos.x(), pos.y() + 5);
352                }
353                return;
354
355            case Qt::Key_Up:
356                {
357                    QPoint pos = qApp->overrideCursor()->pos();
358                    qApp->overrideCursor()->setPos(pos.x(), pos.y() - 5);
359                }
360                return;
361    }
362    QTextBrowser::keyPressEvent(e);
363}
htmlarea.h
5252        void setNewContent( int method, QString str );
5353        QVariant loadResource(int type, const QUrl &name);
5454
55    protected:
56        virtual void keyPressEvent(QKeyEvent *e);
57
5558    public Q_SLOTS:
5659        void linking( const QUrl &txt );
5760        void sourceChange( const QUrl &txt );
moc_htmlarea.cpp
11/****************************************************************************
22** Meta object code from reading C++ file 'htmlarea.h'
33**
4** Created: Wed Apr 7 18:36:22 2010
4** Created: Wed Apr 7 19:01:42 2010
55** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
66**
77** WARNING! All changes made in this file will be lost!
moc_qmain.cpp
11/****************************************************************************
22** Meta object code from reading C++ file 'qmain.h'
33**
4** Created: Wed Apr 7 18:36:22 2010
4** Created: Wed Apr 7 19:01:42 2010
55** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
66**
77** WARNING! All changes made in this file will be lost!
qmain.cpp
2323#include <QMessageBox>
2424#include "qmain.h"
2525
26#include <cxxtools/log.h>
27
28log_define("qvido.qmain");
29
2630QMain::QMain(std::string File)
2731{
2832
...... 
3943                                         centralWidget,SLOT(linking(const QUrl&)));
4044        QObject::connect(centralWidget,SIGNAL(sourceChanged(const QUrl &)),
4145                                         centralWidget,SLOT(sourceChange(const QUrl&)));
42
46
47        QCursor cursor;
48
49        if (qApp->overrideCursor() == false){
50            qApp->setOverrideCursor(cursor);
51            log_debug("no cursor");
52        }
53
4354}
4455
4556QMain::~QMain(){}
...... 
8495        connect(goToTopAct, SIGNAL(triggered()), this->centralWidget, SLOT(goToTop()));
8596        this->addAction(goToTopAct);
8697
87        // quit qvid0
98        // quit qvido
8899        quitAct = new QAction(tr("Quit QVido"), this);
89100        quitAct->setShortcut(tr("Ctrl+Q"));
90101        quitAct->setStatusTip(tr("Quit"));

Archive Download the corresponding diff file

Branches:
master



interactive