当前位置: 首页>>代码示例>>C++>>正文


C++ QContent::id方法代码示例

本文整理汇总了C++中QContent::id方法的典型用法代码示例。如果您正苦于以下问题:C++ QContent::id方法的具体用法?C++ QContent::id怎么用?C++ QContent::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QContent的用法示例。


在下文中一共展示了QContent::id方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: catman

QContent *WheelBrowserScreen::readLauncherMenuItem(const QString &entry)
{
    QContent *applnk = 0;

    if (entry.right(8)==".desktop") {
        // There used to be a quick way to locate a .desktop file
        // Now we have to create a QContentSet and iterate over the items

        // The path to the apps folder (which only exists in the database)
        QString apps = Qtopia::qtopiaDir()+"apps/";
        // We need the full path to the entry to compare against the items we get from QContentSet
        QString entryPath = apps+entry;
        applnk = new QContent( entryPath, false );
        if ( applnk->id() == QContent::InvalidId ) {
            delete applnk;
            applnk = 0;
        }
    } else {
        QCategoryManager catman("Applications");
        if(catman.contains(entry))
        {
            applnk = new QContent();
            applnk->setName(catman.label(entry));
            applnk->setIcon(catman.iconFile(entry));
            applnk->setType("Folder/"+entry);
        }
        else
            applnk = NULL;
    }

    return applnk;
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:32,代码来源:wheelbrowser.cpp

示例2: execToContent

/*!
  Given an application binary name \a bin return the QContentId of the QContent record
  for that application.  If \a bin is the fully qualified path of an ordinary file the
  QContentId of that file will be returned.

  If \a bin does not refer to any application or file in the backing store then an
  InvalidId will be returned.

  Note that binary names are unique across Qtopia.
 */
QContentId QContent::execToContent( const QString& bin )
{
    QContent content = QContentStore::instance()->contentFromFileName( bin, QContentStore::Lookup );

    if( !content.isNull() )
        return content.id();
    else
        return QContent::InvalidId;
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:19,代码来源:qcontent.cpp

示例3: executableName

/*!
  Returns the name of the name of the application that will be launched if the QContent is executed.

  If the QContent is an application this is the name of the binary, if it is a document it is the
  executable name of the application associated with the document MIME type.

  If the content is not an application and there is no associated application associated with its
  MIME type then a null string will be returned.

  \sa execute()
 */
QString QContent::executableName() const
{
    if( role() == Application )
    {
        return d->fileName();
    }
    else
    {
        QContent app = d->mimeType().application();
        if ( app.id() != InvalidId )
            return app.executableName();
        else
            return QString();
    }
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:26,代码来源:qcontent.cpp

示例4: renderStateChanged

/*!
    \reimp
*/
void BSciContentLicense::renderStateChanged( const QContent &content, QDrmContent::RenderState state )
{
    if( content.id() != m_content.id() )
        return;

    switch( state )
    {
    case QDrmContent::Started:
        startConstraintUpdates();
        break;
    case QDrmContent::Paused:
        pauseConstraintUpdates();
        break;
    case QDrmContent::Stopped:
        stopConstraintUpdates();
    }
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:20,代码来源:bscidrmcontentplugin.cpp

示例5: loadThumbs

void CameraMainWindow::loadThumbs( bool resized )
{
    int i = 0;
    showWaitScreen();
    for (; i < nthumb && i < m_photoModel->rowCount(); ++i)
    {
        QContent content = m_photoModel->content(i);
        if (resized || picturefile[i].id() != content.id() || picturefile[i].lastUpdated() != content.lastUpdated()) {
            picturefile[i] = content;

            thumb[i]->setIcon(QThumbnail(picturefile[i].fileName()).pixmap(QSize(thumbw, thumbh)));
            thumb[i]->setEnabled(true);
        }
    }

    for (; i < nthumb; ++i) {
        picturefile[i] = QContent();
        thumb[i]->setIcon(QIcon());
        thumb[i]->setEnabled(false);
    }

    if ( cur_thumb >= 0 )
        selectThumb(cur_thumb);

    if ( !camera->videocaptureview->available() ) {
        if(settings)
            a_timer->setVisible(false);
        camera->photo->setEnabled(false);
        camera->video->setEnabled(false);
        if (m_photoModel->rowCount() == 0) {
            thumb[0]->setEnabled(false);
        } else {
            thumb[0]->setFocus();
            thumb[0]->setEnabled(true);
        }
    }

    if(settings)
        updateActions();
    hideWaitScreen();
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:41,代码来源:mainwindow.cpp


注:本文中的QContent::id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。