本文整理汇总了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;
}
示例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;
}
示例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();
}
}
示例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();
}
}
示例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();
}