Running on Mac Os X 10.6.6.
The scene contains one item which is the base item (QGraphicsRectItem ) with any custom flags ( it has the default flags).
This base item has a child item (called GridItem which is a QGraphicsRectItem ) with this flags ( other than the default flags ):
setFlag(QGraphicsItem::ItemClipsChildrenToShape,true);
setFlag(QGraphicsItem::ItemIsFocusable,true);
To copy to clipboard, switch view to plain text mode
The gridItem has a child item ( called ImageItem which is QGraphicsObject ) with this flags ( other than the default flags ) :
setFlag(QGraphicsItem::ItemIsSelectable,false);
setFlag(QGraphicsItem::ItemIsFocusable,true);
To copy to clipboard, switch view to plain text mode
The ImageItem has a ChildItem which is the VideoItem ( QGraphicsObject) which has any flags other than the default flags.
The scene has not any custom settings.
{
painter
->setRenderHint
(QPainter::SmoothPixmapTransform,
false);
painter
->setRenderHint
(QPainter::HighQualityAntialiasing,
false);
painter
->setRenderHint
(QPainter::NonCosmeticDefaultPen,
false);
painter->drawImage(this->boundingRect(),currentImage());
}
/* QGraphicsView option */
_window(win),
_box(box)
{
setRenderHint
(QPainter::SmoothPixmapTransform,
false);
setRenderHint
(QPainter::HighQualityAntialiasing,
false);
setRenderHint
(QPainter::NonCosmeticDefaultPen,
true);
QRectF rect
= scene
->sceneRect
();
resize(rect.width() ,rect.height());
setAlignment(Qt::AlignLeft);
brush.setStyle(Qt::SolidPattern);
setBackgroundBrush(brush);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
void VideoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
painter->setRenderHint(QPainter::SmoothPixmapTransform,false);
painter->setRenderHint(QPainter::HighQualityAntialiasing,false);
painter->setRenderHint(QPainter::NonCosmeticDefaultPen,false);
painter->drawImage(this->boundingRect(),currentImage());
}
/* QGraphicsView option */
View::View(QGraphicsScene *scene, MPWindow * win, MPGridBoxItem * box, QWidget *parent)
:QGraphicsView(scene,parent),
_window(win),
_box(box)
{
setRenderHint(QPainter::SmoothPixmapTransform,false);
setRenderHint(QPainter::HighQualityAntialiasing,false);
setRenderHint(QPainter::NonCosmeticDefaultPen,true);
QRectF rect = scene->sceneRect();
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
resize(rect.width() ,rect.height());
setAlignment(Qt::AlignLeft);
QBrush brush(QColor(Qt::black));
brush.setStyle(Qt::SolidPattern);
setBackgroundBrush(brush);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
To copy to clipboard, switch view to plain text mode
Bookmarks