资源简介
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++语言
相关资源
- QT上位机
- qt媒体播放器
- QT5开发及源代码
- qt完整项目
- C++ mqtt 用法
- qt进度条(RoundProgressBar)
- Qt的纽带风格界面实现(Office Ribbon风
- qt 实现画板
- QT Hisi demo
- 基础qt数据库读取和显示
- Qt画图工具源码(qgraphics draw)
- Qt查询SQLite数据库
- QtWebApp
- Qt 实现心电图
- Qt实现 屏幕截图
- qt cmd实现ping
- QT实现USB摄像头拍照
- qt texteditor(富文本编辑器)
- qt 串口助手源码
- qt登录富文本编辑器和文档打印设计
- 使用QWT库实现接收串口数据,并根据
- QT SQLite封装
- QT半透明效果界面
- Qt5串口通信-windows
- 计算机远程唤醒和关机
- 使用wxWidgets进行跨平台程序开发
- QT 动态曲线
- QT视频播放器(基于FFmpeg)
- 嵌入式QtC++编程课件
- STM32连接EC20使用内置MQTT协议接入阿里
评论
共有 条评论