资源简介
qt 滑屏翻页效果C++程序
#ifndef PICTUREFLOW_H
#define PICTUREFLOW_H
#include
class PictureFlowPrivate;
/*!
Class PictureFlow implements an image show widget with animation effect
like Apple's CoverFlow (in iTunes and iPod). Images are arranged in form
of slides, one main slide is shown at the center with few slides on
the left and right sides of the center slide. When the next or previous
slide is brought to the front, the whole slides flow to the right or
the right with smooth animation effect; until the new slide is finally
placed at the center.
*/
class PictureFlow : public QWidget
{
Q_OBJECT
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
Q_PROPERTY(QSize slideSize READ slideSize WRITE setSlideSize)
Q_PROPERTY(int slideCount READ slideCount)
Q_PROPERTY(int centerIndex READ centerIndex WRITE setCenterIndex)
public:
enum ReflectionEffect
{
NoReflection,
PlainReflection,
BlurredReflection
};
/*!
Creates a new PictureFlow widget.
*/
PictureFlow(QWidget* parent = 0);
/*!
Destroys the widget.
*/
~PictureFlow();
/*!
Returns the background color.
*/
QColor backgroundColor() const;
/*!
Sets the background color. By default it is black.
*/
void setBackgroundColor(const QColor& c);
/*!
Returns the dimension of each slide (in pixels).
*/
QSize slideSize() const;
/*!
Sets the dimension of each slide (in pixels).
*/
void setSlideSize(QSize size);
/*!
Returns the total number of slides.
*/
int slideCount() const;
/*!
Returns QImage of specified slide.
*/
QImage slide(int index) const;
/*!
Returns the index of slide currently shown in the middle of the viewport.
*/
int centerIndex() const;
/*!
Returns the effect applied to the reflection.
*/
ReflectionEffect reflectionEffect() const;
/*!
Sets the effect applied to the reflection. The default is PlainReflection.
代码片段和文件信息
/*
PictureFlow - animated image show widget
http://pictureflow.googlecode.com
Copyright (C) 2008 Ariya Hidayat (ariya@kde.org)
Copyright (C) 2007 Ariya Hidayat (ariya@kde.org)
Permission is hereby granted free of charge to any person obtaining a copy
of this software and associated documentation files (the “Software“) to deal
in the Software without restriction including without limitation the rights
to use copy modify merge publish distribute sublicense and/or sell
copies of the Software and to permit persons to whom the Software is
furnished to do so subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include
#include
#include
#include
#include
#if QT_VERSION >= 0x040000
#include
#endif
#include “pictureflow.h“
QStringList findFiles(const QString& path = QString())
{
QStringList files;
QDir dir = QDir::current();
if(!path.isEmpty())
dir = QDir(path);
dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymlinks);
#if QT_VERSION >= 0x040000
QFileInfoList list = dir.entryInfoList();
for (int i = 0; i < list.size(); ++i)
{
QFileInfo fileInfo = list.at(i);
files.append(dir.absoluteFilePath(fileInfo.fileName()));
}
#else
const QFileInfoList* list = dir.entryInfoList();
if(list)
{
QFileInfoListIterator it( *list );
QFileInfo * fi;
while( (fi=it.current()) != 0 )
{
++it;
files.append(dir.absFilePath(fi->fileName()));
}
}
#endif
return files;
}
#if QT_VERSION < 0x040000
#define modifiers state
#define AltModifier AltButton
#define setWindowtitle setCaption
#endif
#if QT_VERSION < 0x030000
#define flush flushX
#endif
class Browser: public PictureFlow
{
public:
Browser(): PictureFlow()
{
setWindowtitle(“PictureFlow“);
}
void keyPressEvent(QKeyEvent* event)
{
if(event->key() == Qt::Key_Escape || event->key() == Qt::Key_Enter ||
event->key() == Qt::Key_Return)
{
event->accept();
close();
}
// checking the speed of rendering
if(event->key() == Qt::Key_F10)
if(event->modifiers() == Qt::AltModifier)
{
qDebug(“benchmarking.... please wait“);
const int blit_count = 10;
QTime stopwatch;
stopwatch.start();
for(int i = 0; i < blit_count; i++)
{
render(); repaint(); QApplication::flu
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5490 2008-02-15 04:52 pictureflow\pictureflow-0.1.0\pictureflow-qt\main.cpp
文件 29016 2008-02-15 04:52 pictureflow\pictureflow-0.1.0\pictureflow-qt\pictureflow.cpp
文件 4885 2008-02-15 04:52 pictureflow\pictureflow-0.1.0\pictureflow-qt\pictureflow.h
文件 95 2008-02-15 04:52 pictureflow\pictureflow-0.1.0\pictureflow-qt\pictureflow.pro
目录 0 2011-04-18 16:51 pictureflow\pictureflow-0.1.0\pictureflow-qt
目录 0 2011-07-13 14:26 pictureflow\pictureflow-0.1.0
目录 0 2011-04-18 16:51 pictureflow
----------- --------- ---------- ----- ----
39486 7
- 上一篇:Linux下局域网语音对讲
- 下一篇:BP算法实现圆迹SAR点目标仿真C++语言
相关资源
- c++ qt 静态函数中发信号
- linux下QT调用讯飞sdk
- C++、QT学习记录
- QT编写的计算器小程序
- 基于Qt的学生报账系统
- Qt计算器实现
- 基于Qt的图形显示蚁群算法求解TSP问题
- log4qt qt 日志
- 在Qt中用C++编写的计算器程序
- 基于qt的心电监护软件系统设计
- Qt5 串口助手源代码
- 基于Qt的信息管理系统设计.zip
- 调节系统音量调节麦克风音量
- 已知两点经纬度,求距离和方位
- 旅店管理系统-课程作业
- 《Qt 5.9 C++开始指南》2.2节 可视化UI设
- 基于Linux 下qt改版的聊天室
- QT开发的五子棋网络对战游戏
- 使用QT编写 网络电话
- QT制作类似360悬浮球,实现各种基本功
- 磁盘调度算法模拟软件,完整课程设
- 基于QT的电子地图设计与实现
- Qt Quick之美图秀秀
- QT点菜系统
- C++实现mqtt协议
- C++ QT中 通过UDP广播获取网络中所有设
- QT 飞秋聊天工具 c++
- Qt编写的画图小程序c++语言
- Qt5实现的一个mvc的
- 基于QT的黑白棋游戏
评论
共有 条评论