PictureFlow - listing images in PyQt4

Check out the new site at https://rkblog.dev.

PictureFlow is a Qt4 (and PyQt4) widget that allows "awesome" listing of images. PyQt4 bindings are only available in the SVN code (download tar.gz snapshot) that you can get from:
svn export http://pictureflow.googlecode.com/svn/trunk/ pictureflow
To compile and install PictureFlow use:
  • Go to pictureflow-qt folder and execute: qmake, make and make install
  • Go to pyqt folder and execute: python configure.py, make, make install
After installing the widget you can test it with this example script:
import sys
from os import listdir

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from pictureflow import *

app = QApplication(sys.argv)

w = PictureFlow()

images = listdir('/path/to/folder/with/images/')
for i in images:
	if i.endswith('jpg'):
		w.addSlide(QPixmap('/path/to/folder/with/images/%s' % i))

Here is sample result:

PictureFlow class

Below is the PictureFlow class definition for SIP:

  enum ReflectionEffect

  PictureFlow(QWidget *parent /TransferThis/ = 0);
  QColor backgroundColor() const;
  void setBackgroundColor(const QColor& c);
  QSize slideSize() const;
  void setSlideSize(QSize size);
  int slideCount() const;
  QImage slide(int index) const;
  int centerIndex() const;
  ReflectionEffect reflectionEffect() const;
  void setReflectionEffect(ReflectionEffect effect);

public slots:
  void addSlide(const QImage& image);
  void addSlide(const QPixmap& pixmap);
  void setSlide(int index, const QImage& image);
  void setSlide(int index, const QPixmap& pixmap);
  void setCenterIndex(int index);
  void clear();
  void showPrevious();
  void showNext();
  void showSlide(int index);
  void render();
  void triggerRender();

  void centerIndexChanged(int index);

  void paintEvent(QPaintEvent *event);
  void keyPressEvent(QKeyEvent* event);
  void mousePressEvent(QMouseEvent* event);
  void resizeEvent(QResizeEvent* event);

PyQt and GUI, 17 April 2009

Check out the new site at https://rkblog.dev.
Comment article
Comment article RkBlog main page Search RSS Contact