本文整理汇总了C++中Album::type方法的典型用法代码示例。如果您正苦于以下问题:C++ Album::type方法的具体用法?C++ Album::type怎么用?C++ Album::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: viewHeaderText
void ImageCategoryDrawer::viewHeaderText(const QModelIndex& index, QString* header, QString* subLine) const
{
ImageModel* sourceModel = index.data(ImageModel::ImageModelPointerRole).value<ImageModel*>();
if (!sourceModel)
{
return;
}
int count = d->view->categoryRange(index).height();
// Add here further model subclasses in use with ImageCategoryDrawer.
// Note you need a Q_OBJECT in the class's header for this to work.
ImageAlbumModel* albumModel = qobject_cast<ImageAlbumModel*>(sourceModel);
if (albumModel)
{
Album* album = albumModel->currentAlbum();
if (!album)
{
return;
}
switch (album->type())
{
case Album::PHYSICAL:
textForPAlbum(static_cast<PAlbum*>(album), albumModel->isRecursingAlbums(), count, header, subLine);
break;
case Album::TAG:
textForTAlbum(static_cast<TAlbum*>(album), albumModel->isRecursingTags(), count, header, subLine);
break;
case Album::DATE:
textForDAlbum(static_cast<DAlbum*>(album), count, header, subLine);
break;
case Album::SEARCH:
textForSAlbum(static_cast<SAlbum*>(album), count, header, subLine);
break;
case Album::FACE:
default:
break;
}
}
}