yacreader/YACReader/goto_flow_widget.cpp
Luis Ángel San Martín f4e55729a2 fixed comiplation in Linux (Ubuntu)
line 117: #define _WIN64 1
must be removed in ./compressed_archive/libp7zip/CPP/myWindows/StdAfx.h

"cannot find -lpulse" compiling under Qt 5.0.2 can be fixed creating a symbolic link from libpulse.so.0 to libpulse.so (further research is needed)
2013-12-08 11:50:10 -08:00

65 lines
1.3 KiB
C++

#include "goto_flow_widget.h"
#include <QSettings>
#include <QHBoxLayout>
#include <QKeyEvent>
#include <QCoreApplication>
#include "goto_flow_toolbar.h"
#include "goto_flow_decorationbar.h"
GoToFlowWidget::GoToFlowWidget(QWidget * parent)
:QWidget(parent)
{
mainLayout = new QVBoxLayout;
mainLayout->setMargin(0);
mainLayout->setSpacing(0);
topBar = new GoToFlowDecorationBar(this);
toolBar = new GoToFlowToolBar(this);
mainLayout->addWidget(topBar);
mainLayout->addWidget(toolBar);
mainLayout->setMargin(0);
mainLayout->setSpacing(0);
setLayout(mainLayout);
}
GoToFlowWidget::~GoToFlowWidget() {
delete topBar;
delete toolBar;
delete mainLayout;
}
void GoToFlowWidget::setPageNumber(int page)
{
toolBar->setPage(page);
}
void GoToFlowWidget::keyPressEvent(QKeyEvent* event)
{
switch (event->key())
{
case Qt::Key_Return: case Qt::Key_Enter:
toolBar->goTo();
toolBar->centerSlide();
break;
case Qt::Key_Space:
toolBar->centerSlide();
break;
case Qt::Key_S:
QCoreApplication::sendEvent(this->parent(),event);
break;
case Qt::Key_Left: case Qt::Key_Right:
//if(event->modifiers() == Qt::ControlModifier)
//flow->keyPressEvent(event);
//QCoreApplication::sendEvent(flow,event);
break;
}
event->accept();
}