Qtopia Home - Classes - Annotated - Functions - Qt Embedded

ImageSelector Class Reference

The ImageSelector widget provides a means of selecting an image from a list of thumbnails. More...

#include <qtopia/imageselector.h>

List of all member functions.

Public Members

Signals


Detailed Description

The ImageSelector widget provides a means of selecting an image from a list of thumbnails.

This class presents a dialog of thumbnail view of available images. Thumbnails are stored in the calling applications' pixmap cache. To retrieve the image directly from the cache, append "_tv" to the filename returned via selectedFilename() or the selected() signal.

First availability: Qtopia 2.0

See also Qtopia Classes.


Member Function Documentation

ImageSelector::ImageSelector ( QWidget * parent = 0, const char * name = 0, const QString & srcdir = QString::null, int wflags = 0 )

Constructs an ImageSelector widget.

parent, name, modal, and wflags are the standard Qt QDialog flags. srcdir refers to base directory where images may be located. By default, this is "Documents", referring to the Qtopia Documents area. If you require access to a particular directory, specify the path.

Example:

    QString directory = QPEApplication::qpeDir() + "pics/wallpaper";
    ImageSelector *is = new ImageSelector(this, "Wallpapers", TRUE, directory);
  

ImageSelector::~ImageSelector ( void )

Destroys the widget.

QValueList<DocLnk> ImageSelector::fileList () const

Returns a list of all documents.

DocLnk ImageSelector::selectedDocument ( void ) const

Returns the selected DocLnk, or a null DocLnk if no thumbnail is selected.

QString ImageSelector::selectedFilename ( void ) const

Returns the full path to the selected file.

QPixmap ImageSelector::selectedImage ( const int width, const int height ) const

Returns a copy of the selected image, scaled to width x height pixels. Aspect ratio is preserved.

void ImageSelector::setThumbnailSize ( const int pixels )

Sets the maximum size of the images in the view to pixels x pixels.

void ImageSelector::showImageView ( bool show, bool fullscreen = FALSE )

Shows the image view if show is TRUE. If fullscreen is TRUE the view will use the whole screen.

int ImageSelector::thumbnailSize ( void ) const

Returns the size of the images in the thumbnail view.

This file is part of the Qtopia platform, copyright © 1995-2004 Trolltech, all rights reserved.


Copyright © 2001-2004 Trolltech Trademarks
Qtopia version 2.0.1