⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imageselector.cpp

📁 Trolltech公司发布的图形界面操作系统。可在qt-embedded-2.3.10平台上编译为嵌入式图形界面操作系统。
💻 CPP
📖 第 1 页 / 共 2 页
字号:
/*!  Return a list of images in the current category.*/QValueList<DocLnk> ImageSelector::fileList() const{    return d->fileList();}/*!  Return the number of images in the current category.    First availability: Qtopia 2.1*/int ImageSelector::fileCount() const{    return d->fileCount();}#ifdef QTOPIA_PHONE/*!  Return the context menu.*/ContextMenu* ImageSelector::menu() const{    return d->menu();}#endif/*! \internal */QSize ImageSelector::sizeHint() const{    return QSize(width(), qApp->desktop()->height());}/*! \obsolete */void ImageSelector::showImageView( bool show, bool ){    // If show, set view mode to Single    if( show ) d->setViewMode( Single );    // Otherwise, set view mode to Thumbnail    else d->setViewMode( Thumbnail );    // Full screen no longer supported}/*! \obsolete */bool ImageSelector::imageViewVisible() const{    // If view mode is Single, return true    return d->viewMode() == Single;}/*! \fn void ImageSelector::selected( const DocLnk& image );    This signal is emitted when the user has selected an image from the   collection. A DocLnk to the selected image is given in \a image.*//*! \fn void ImageSelector::held( const DocLnk& image, const QPoint& pos );  This signal is emitted when the user has held down on an image. A DocLnk to  the image is given in \a image. The global position of the hold is given  in \a pos.    First availability: Qtopia 2.1*//*! \fn void ImageSelector::fileAdded( const DocLnk& image );  This signal is emitted when an image is added to the current category. A  DocLnk to the image is given in \a image.    First availability: Qtopia 2.1*//*! \fn void ImageSelector::fileUpdated( const DocLnk& image );  This signal is emitted when an image is updated in the current category. A  DocLnk to the image is given in \a image.    First availability: Qtopia 2.1*//*! \fn void ImageSelector::fileRemoved( const DocLnk& image );  This signal is emitted when an image is removed from the current category.  A DocLnk to the image is given in \a image.    First availability: Qtopia 2.1*//*! \fn void ImageSelector::categoryChanged();  This signal is emitted when the category has changed.    First availability: Qtopia 2.1*//*! \fn void ImageSelector::reloaded();  This signal is emitted when the collection has reloaded due to a disk mount  or unmount.    First availability: Qtopia 2.1    \sa StorageInfo::disksChanged()*//*!  \class ImageSelectorDialog imageselector.h  \brief The ImageSelectorDialog widget presents the ImageSelector widget as a   dialog. It allows the user to select from a collection of images.    This code snippet allows the user to select a wallpaper from the Qtopia directories:    \code    QStringList locations;    QStringList qtopiaPaths = Global::qtopiaPaths();    for( QStringList::Iterator it = qtopiaPaths.begin(); it != qtopiaPaths.end(); ++it )        locations.append( *it + "pics/wallpaper" );          ImageSelectorDialog dialog( locations, this );    if( QPEApplication::execDialog( &dialog ) ) {        // Accept    } else {        // Reject    }\endcode      You can retrieve the selected image with \c selectedDocument(),  \c selectedFilename() and \c selectedImage(). The \c selectedImage() function  returns a QPixmap containing a scaled copy of the selected image.  First availability: Qtopia 2.0  \ingroup qtopiaemb  \sa ImageSelector*//*!  Construct an ImageSelectorDialog called \a name with parent \a parent and   widget flags \a f.    The dialog is modal if \a modal is TRUE (default), otherwise the dialog is   modeless.    Images are taken from the Documents directory.    First availability: Qtopia 2.1*/ImageSelectorDialog::ImageSelectorDialog( QWidget* parent, const char* name,     bool modal, WFlags f )    : QDialog( parent, name, modal, f ){    setCaption( tr( "Select Image" ) );    QVBoxLayout *vb = new QVBoxLayout( this );        selector = new ImageSelector( this );    #ifdef QTOPIA_PHONE    // BCI: To overcome limitations in ImageSelectorDialog    selector->d->enableDialogMode();    connect( selector, SIGNAL( selected( const DocLnk& ) ),         this, SLOT( accept() ) );#else    connect( selector, SIGNAL( selected( const DocLnk& ) ),        this, SLOT( setViewSingle() ) );#endif    vb->addWidget( selector );    QPEApplication::setMenuLike( this, true );}/*!  Construct an ImageSelectorDialog called \a name with parent \a parent and   widget flags \a f.    The dialog is modal if \a modal is TRUE (default), otherwise the dialog is   modeless.    Images are taken from the directories given in \a source. If \a source is   empty images are taken from the Documents directory.    First availability: Qtopia 2.1*/ImageSelectorDialog::ImageSelectorDialog( const QStringList& source,     QWidget* parent, const char* name, bool modal, WFlags f )    : QDialog( parent, name, modal, f ){    setCaption( tr( "Select Image" ) );    QVBoxLayout *vb = new QVBoxLayout( this );        selector = new ImageSelector( source, this );    #ifdef QTOPIA_PHONE    // BCI: To overcome limitations in ImageSelectorDialog    selector->d->enableDialogMode();    connect( selector, SIGNAL( selected( const DocLnk& ) ),         this, SLOT( accept() ) );#else    connect( selector, SIGNAL( selected( const DocLnk& ) ),        this, SLOT( setViewSingle() ) );#endif    vb->addWidget( selector );    QPEApplication::setMenuLike( this, true );}/*! \obsolete */ImageSelectorDialog::ImageSelectorDialog( QWidget* parent, const char* name,    bool modal, const QString& srcdir, int wflags )    : QDialog( parent, name, modal, wflags ){    setCaption( tr( "Select Image" ) );    QVBoxLayout *vb = new QVBoxLayout( this );        if( !srcdir.isNull() ) selector = new ImageSelector( srcdir, this );    else selector = new ImageSelector( this );    #ifdef QTOPIA_PHONE    // BCI: To overcome limitations in ImageSelectorDialog    selector->d->enableDialogMode();    connect( selector, SIGNAL( selected( const DocLnk& ) ),         this, SLOT( accept() ) );#else    connect( selector, SIGNAL( selected( const DocLnk& ) ),        this, SLOT( setViewSingle() ) );#endif    vb->addWidget( selector );    QPEApplication::setMenuLike( this, true );}/*!  Destroy the widget.*/ImageSelectorDialog::~ImageSelectorDialog(){ }void ImageSelectorDialog::setViewSingle(){    selector->setViewMode( ImageSelector::Single );}/*! \fn QString ImageSelectorDialog::selectedFilename() const;    Return the file path of the currently selected image, or QString::null if  there is no current selection.*//*! \fn DocLnk ImageSelectorDialog::selectedDocument() const;  Return the \l DocLnk of the currently selected image, or invalid \l DocLnk if  there is no current selection.*//*! \fn QPixmap ImageSelectorDialog::selectedImage( const int width,   const int height ) const;    Return a QPixmap containing a scaled copy of the currently selected image, or  null QPixmap if there is no current selection.    The image will be scaled to fit within \a width and \a height while  maintaining the original width to height ratio.*//*! \fn QValueList<DocLnk> ImageSelectorDialog::fileList() const;  Return a list of images in the current category.*//*! \fn void ImageSelectorDialog::setThumbnailSize( const int maxSide )  Set the maximum side (in pixel units) of a thumbnail to \a maxSide. The  largest thumbnail will be no greater than \a maxSide x \a maxSide pixels.    \a maxSide must be greater than 0.    \sa thumbnailSize()*//*! \fn int ImageSelectorDialog::thumbnailSize() const;  Return the current maximum side (in pixel units) of a thumbnail.    \sa setThumbnailSize()*//*! \fn ContextMenu* ImageSelectorDialog::menu() const  Return the context menu.*//*! \obsolete \fn void ImageSelectorDialog::selected( const DocLnk& image ); */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -