资源简介
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处理图形
- c++ 画图(14Qt-XPS)
- QT CAN例程
- 使用Qt实现Excel读取工具
- Qt 通讯软件模块的开发
- Qt TCP聊天室demo
- Qt曲线
- qt样式表武林秘籍(73页)
- stm32 MQTT
- QT信号槽开发
- Wemos D1 mini阿里云MQTT例程
- QT 计算文件夹内所有代码行数
- qt写的记事本
- QT自定义皮肤例子56387
- qt上位机采集51单片机温湿度数据
- MQTT协议
- 五子棋C++(Qt版).zip
- Qt飞机大战小游戏源代码
- 基于qt的c++编写的贪吃蛇游戏
- 嵌入式Qt实战教程.
- QT5.9_c++开发指南——随书[源码]
- 基于Qt的智能停车场.rar
- QT实现视音频实时传输qml+C++
- QT开发多文档框架
- C++课程设计五子棋基于Qt4
- 简易防火墙使用C++与Qt4.5带源代码
- 数据库课程设计 - 汽车租借信息系统
- c++读取EXCEL表
-
minibl
ink c++ qt 浏览器
评论
共有 条评论