资源简介
利用qt编写的图片浏览器,可以通过拖动滑动浏览,效果很炫
代码片段和文件信息
/*
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
相关资源
- 基于Qt的图像采集系统
- qt的小波分解程序
- 人脸识别在arm板上的实现
- qt日历控件
- Qt中用qwt实现动态绘制二维曲线
- Qt 模拟软键盘
- QT音乐播放器120395
- Qt界面多线程opencv调用摄像头
- QWebEngineView实现聊天窗
- QT 小游戏 加农炮 源码 +教程刚刚把源
- qt可以使用的AES加密的类
-
Qt/em
bedded的嵌入式导航电子地图实 - Qt静态库的生成及调用
- 智慧大棚QT界面设计
- QT水波进度条DEMO
- qt designer
- OpenCV 3和Qt5计算机视觉应用开发_源码
- Qt高仿网易云音乐界面源码
- 基于QWebEngineView浏览器-Qt5源码
- Qt读取PDF文档代码qt-poppler
- TCP聊天室,客户端,服务器
- Qt 图片缩放,支持滚轮和按键缩放
- 基于QT编写的GPS卫星定位上位机软件
- QtWifiTestDemo
- 端口扫描器
- Qt5.9c开发指南.pdf代码.zip
- QGLViewer_lib_dll
-
基于S3C2410和Qt_em
bedded的数码相框设 - Qt制作数字软件盘
- Qt编写的速度仪表盘
评论
共有 条评论