本文整理汇总了C++中QCanvasItemList::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ QCanvasItemList::isEmpty方法的具体用法?C++ QCanvasItemList::isEmpty怎么用?C++ QCanvasItemList::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCanvasItemList
的用法示例。
在下文中一共展示了QCanvasItemList::isEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: contentsMousePressEvent
void SkeletonCanvasView::contentsMousePressEvent( QMouseEvent *e )
{
// a list of all items underneath the mouse when it was pressed
QCanvasItemList list = canvas()->collisions(e->pos());
// the RTTI of a QCanvasSprite is 1...
if ( !list.isEmpty() && list.first()->rtti() == 1 )
{
// ...which means we can safely cast to a Bone pointer.
Bone *sphere = (Bone*)list.first();
// hit() will return false it we hit the transparent corners
// of the planet image.
if ( sphere->hit( e->pos() ) )
{
Moving = sphere;
canvas()->setAdvancePeriod( -1 ); // stops the animation when dragging
MovingStart = e->pos();
Moving->setZ( 2 ); // raises the current item above other items when dragging.
// (This in not really necessary here, since we have just one item.)
Timer->start( 10, false ); // start the timer
}
}
}