资源简介
只实现了技术,动画什么的就简单了,可以自己添加了。
代码片段和文件信息
#include “Book.h“
#include “ui_Book.h“
#include
#include
#include
#include
CBook::CBook(QWidget *parent) :
QDialog(parent)
//ui(new Ui::CBook)
{
//ui->setupUi(this);
m_eDirection = E_Forward;
setAttribute(Qt::WA_OpaquePaintEvent true);
setAttribute(Qt::WA_NoSystemBackground true);
m_listPixmap.append(QPixmap(“:/images/1.jpg“));
m_listPixmap.append(QPixmap(“:/images/2.jpg“));
m_listPixmap.append(QPixmap(“:/images/3.jpg“));
m_listPixmap.append(QPixmap(“:/images/4.jpg“));
m_listPixmap.append(QPixmap(“:/images/5.jpg“));
m_listPixmap.append(QPixmap(“:/images/6.jpg“));
m_listPixmap.append(QPixmap(“:/images/7.jpg“));
m_iCurrentIndex = 0;
connect(&m_animationLine SIGNAL(frameChanged(int)) SLOT(update()));
m_animationLine.setDuration(200);
m_animationLine.setDuration(1000);
m_animationLine.setCurveShape(QTimeLine::EaseInOutCurve);
m_pressPoint = QPoint(this->width() this->height());
}
CBook::~CBook()
{
//delete ui;
}
void CBook::paintEvent(QPaintEvent* event)
{
QPainter painter(this);
painter.fillRect(rect() Qt::black);
painter.drawPixmap(QRect(QPoint(0 0) this->size()) m_listPixmap[m_iCurrentIndex]);
painter.setCompositionMode(QPainter::CompositionMode_Source);
QPainterPath path;
/* Draw region 1 */
painter.save();
path.moveTo(00);
path.lineTo(this->width() 0);
path.lineTo(this->width() m_pressPoint.y());
path.lineTo(m_pressPoint.x() this->height());
path.lineTo(0 this->height());
path.closeSubpath ();
painter.setClipPath (path);
painter.drawPixmap (00 m_listPixmap[m_iCurrentIndex]);
painter.restore();
/*Draw region 2*/
painter.save();
path = QPainterPath();
path.moveTo(m_pressPoint.x() this->height());
path.lineTo(this->width() m_pressPoint.y());
path.lineTo(this->width() this->height());
path.closeSubpath ();
painter.setClipPath(path);
painter.drawPixmap (00 m_listPixmap[m_iCurrentIndex + 1]);
painter.restore();
/* Draw region 3 */
path = QPainterPath();
path.moveTo (m_pressPoint.x() this->height());
path.cubicTo(QPointF(m_pressPoint.x() m_pressPoint.y() + (this->height() - m_pressPoint.y()) / 2)
QPointF(m_pressPoint.x() + 20 m_pressPoint.y() + (this->height() - m_pressPoint.y()) / 2)
QPointF(m_pressPoint.x() m_pressPoint.y()));
path.cubicTo(QPointF(m_pressPoint.x() + (this->width() - m_pressPoint.x()) / 2 m_pressPoint.y() + 20)
QPointF(m_pressPoint.x() + (this->width() - m_pressPoint.x()) / 2 m_pressPoint.y())
QPointF(this->size().width() m_pressPoint.y()));
path.closeSubpath();
painter.setBrush(Qt::gray);
painter.drawPath(path);
}
void CBook::resizeEvent(QResizeEvent* event)
{
QDialog::resizeEvent(event);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3553 2014-03-30 12:25 PageHands\Book.cpp
文件 836 2014-03-29 21:16 PageHands\Book.h
文件 438 2014-03-29 17:59 PageHands\Book.ui
文件 165173 2014-03-29 18:02 PageHands\images\1.jpg
文件 193475 2014-03-29 18:02 PageHands\images\2.jpg
文件 143308 2014-03-29 18:02 PageHands\images\3.jpg
文件 138997 2014-03-29 18:02 PageHands\images\4.jpg
文件 37196 2014-03-29 18:02 PageHands\images\5.jpg
文件 162479 2014-03-29 18:02 PageHands\images\6.jpg
文件 140312 2014-03-29 18:02 PageHands\images\7.jpg
文件 182936 2014-03-29 18:02 PageHands\images\8.jpg
文件 172 2014-03-29 17:59 PageHands\main.cpp
文件 401 2014-03-29 18:01 PageHands\PageHands.pro
文件 18003 2014-03-30 12:27 PageHands\PageHands.pro.user
文件 329 2014-03-29 18:04 PageHands\PageHands.qrc
目录 0 2014-03-29 18:04 PageHands\images
目录 0 2014-03-30 12:27 PageHands
----------- --------- ---------- ----- ----
1187608 17
- 上一篇:ios libjpeg .a静态库
- 下一篇:稀疏矩阵LU分解在GPU上的性能优化
评论
共有 条评论