本文整理汇总了C++中ThumbItem::GetRotationAngle方法的典型用法代码示例。如果您正苦于以下问题:C++ ThumbItem::GetRotationAngle方法的具体用法?C++ ThumbItem::GetRotationAngle怎么用?C++ ThumbItem::GetRotationAngle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThumbItem
的用法示例。
在下文中一共展示了ThumbItem::GetRotationAngle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleRotateCCW
void IconView::HandleRotateCCW(void)
{
ThumbItem *thumbitem = GetCurrentThumb();
if (!thumbitem || thumbitem->IsDir())
return;
int rotAngle = thumbitem->GetRotationAngle();
rotAngle -= 90;
if (rotAngle >= 360)
rotAngle -= 360;
if (rotAngle < 0)
rotAngle += 360;
thumbitem->SetRotationAngle(rotAngle);
}
示例2: customEvent
void IconView::customEvent(QEvent *event)
{
if (event->type() == ThumbGenEvent::kEventType)
{
ThumbGenEvent *tge = dynamic_cast<ThumbGenEvent *>(event);
if (!tge)
return;
ThumbData *td = tge->thumbData;
if (!td)
return;
ThumbItem *thumbitem = m_itemHash.value(td->fileName);
if (thumbitem)
{
int rotateAngle = thumbitem->GetRotationAngle();
if (rotateAngle)
{
QMatrix matrix;
matrix.rotate(rotateAngle);
td->thumb = td->thumb.transformed(
matrix, Qt::SmoothTransformation);
}
int pos = m_itemList.indexOf(thumbitem);
LoadThumbnail(thumbitem);
MythUIButtonListItem *item = m_imageList->GetItemAt(pos);
if (QFile(thumbitem->GetImageFilename()).exists())
item->SetImage(thumbitem->GetImageFilename());
if (m_imageList->GetCurrentPos() == pos)
UpdateImage(item);
}
delete td;
}
else if (event->type() == ChildCountEvent::kEventType)
{
ChildCountEvent *cce = dynamic_cast<ChildCountEvent *>(event);
if (!cce)
return;
ChildCountData *ccd = cce->childCountData;
if (!ccd)
return;
ThumbItem *thumbitem = m_itemHash.value(ccd->fileName);
if (thumbitem)
{
int pos = m_itemList.indexOf(thumbitem);
MythUIButtonListItem *item = m_imageList->GetItemAt(pos);
if (item)
item->SetText(QString("%1").arg(ccd->count), "childcount");
}
delete ccd;
}
else if (event->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
QString resultid = dce->GetId();
int resultdata = dce->GetData().toInt();
if (resultid == "mainmenu")
{
switch (resultdata)
{
case 0:
HandleSlideShow();
break;
case 1:
HandleRandomShow();
break;
case 2:
break;
case 3:
break;
case 4:
HandleSubMenuFilter();
break;
case 5:
break;
case 6:
HandleSettings();
break;
case 7:
HandleSeasonalShow();
break;
}
}
else if (resultid == "metadatamenu")
{
switch (resultdata)
{
case 0:
HandleRotateCW();
//.........这里部分代码省略.........