mirror of
git://projects.qi-hardware.com/qvido.git
synced 2024-12-22 09:09:32 +02:00
add mouse movement
Signed-off-by: Mirko Lindner <mirko@sharism.cc>
This commit is contained in:
parent
f06a95726a
commit
c4feb4a5b3
39
htmlarea.cpp
39
htmlarea.cpp
@ -115,9 +115,9 @@ void HtmlArea::setNewContent( int method, QString str = "" ){
|
||||
log_debug("Text set");
|
||||
// log_debug("index: " << article.getIndex());
|
||||
// log_debug("enabled: " << this->isEnabled());
|
||||
log_debug("string: " << str.toUtf8().data());
|
||||
qApp->processEvents();
|
||||
qobject_cast<QMain *>(this->parentWidget())->setEnabled(true);
|
||||
log_debug("string: " << str.toUtf8().data());
|
||||
|
||||
}else{
|
||||
this->setText(current);
|
||||
@ -324,3 +324,40 @@ zim::Search::Results HtmlArea::searchArticleFromTitle(QString phrase)
|
||||
log_debug("term :" << phrase.toUtf8().data());
|
||||
return result;
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
// functions related to navigation
|
||||
|
||||
void HtmlArea::keyPressEvent(QKeyEvent *e){
|
||||
log_debug("key pressed");
|
||||
switch (e->key()) {
|
||||
case Qt::Key_Right:
|
||||
{
|
||||
QPoint pos = qApp->overrideCursor()->pos();
|
||||
qApp->overrideCursor()->setPos(pos.x() + 5, pos.y());
|
||||
}
|
||||
return;
|
||||
|
||||
case Qt::Key_Left:
|
||||
{
|
||||
QPoint pos = qApp->overrideCursor()->pos();
|
||||
qApp->overrideCursor()->setPos(pos.x() - 5, pos.y());
|
||||
}
|
||||
return;
|
||||
|
||||
case Qt::Key_Down:
|
||||
{
|
||||
QPoint pos = qApp->overrideCursor()->pos();
|
||||
qApp->overrideCursor()->setPos(pos.x(), pos.y() + 5);
|
||||
}
|
||||
return;
|
||||
|
||||
case Qt::Key_Up:
|
||||
{
|
||||
QPoint pos = qApp->overrideCursor()->pos();
|
||||
qApp->overrideCursor()->setPos(pos.x(), pos.y() - 5);
|
||||
}
|
||||
return;
|
||||
}
|
||||
QTextBrowser::keyPressEvent(e);
|
||||
}
|
@ -52,6 +52,9 @@ class HtmlArea : public QTextBrowser
|
||||
void setNewContent( int method, QString str );
|
||||
QVariant loadResource(int type, const QUrl &name);
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent *e);
|
||||
|
||||
public Q_SLOTS:
|
||||
void linking( const QUrl &txt );
|
||||
void sourceChange( const QUrl &txt );
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'htmlarea.h'
|
||||
**
|
||||
** Created: Wed Apr 7 18:36:22 2010
|
||||
** Created: Wed Apr 7 19:01:42 2010
|
||||
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'qmain.h'
|
||||
**
|
||||
** Created: Wed Apr 7 18:36:22 2010
|
||||
** Created: Wed Apr 7 19:01:42 2010
|
||||
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
|
13
qmain.cpp
13
qmain.cpp
@ -23,6 +23,10 @@
|
||||
#include <QMessageBox>
|
||||
#include "qmain.h"
|
||||
|
||||
#include <cxxtools/log.h>
|
||||
|
||||
log_define("qvido.qmain");
|
||||
|
||||
QMain::QMain(std::string File)
|
||||
{
|
||||
|
||||
@ -40,6 +44,13 @@ QMain::QMain(std::string File)
|
||||
QObject::connect(centralWidget,SIGNAL(sourceChanged(const QUrl &)),
|
||||
centralWidget,SLOT(sourceChange(const QUrl&)));
|
||||
|
||||
QCursor cursor;
|
||||
|
||||
if (qApp->overrideCursor() == false){
|
||||
qApp->setOverrideCursor(cursor);
|
||||
log_debug("no cursor");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QMain::~QMain(){}
|
||||
@ -84,7 +95,7 @@ void QMain::registerCommands()
|
||||
connect(goToTopAct, SIGNAL(triggered()), this->centralWidget, SLOT(goToTop()));
|
||||
this->addAction(goToTopAct);
|
||||
|
||||
// quit qvid0
|
||||
// quit qvido
|
||||
quitAct = new QAction(tr("Quit QVido"), this);
|
||||
quitAct->setShortcut(tr("Ctrl+Q"));
|
||||
quitAct->setStatusTip(tr("Quit"));
|
||||
|
Loading…
Reference in New Issue
Block a user