Hi, I just encountered this problem that seems prevalent in Win Xp 32 bit: the pixmaps that I created for for QDrag events are at least 180 pixels wide, but for some reason, the rendering is always shown to be cropped to 50 by 50 pixels. I have already set break points to check the size which is correct, but the rendering always show otherwise
I do not have this prob on Win 7 64 bit. Win Vista 64 bit and Win XP 64 bit
the drag Function:
void Test:erformDrag()
{
QDrag* drag=new QDrag(this);
renderSelectedLayers();
QMimeData *mimeData=new QMimeData;
drag->setMimeData(mimeData);
drag->setPixmap(*m_map);
int test=drag->pixmap().width();
drag->exec(Qt::MoveAction);
}
Rendering Function
void Test::renderSelectedLayers()
{
//Double check the number of layers
int numberOfLayers=0;
for(size_t i=0; i<m_controller->getSelectedLayers().size(); ++i)
{
if(m_controller->getSelectedLayers()[i]->getType() == TimelineItem::kCel || m_controller->getSelectedLayers()[i]->getType() == TimelineItem::kCut
|| m_controller->getSelectedLayers()[i]->getParent() != m_controller->getActiveCelItem())
continue;
++numberOfLayers;
}
if(m_map)
delete m_map;
m_map=new QPixmap(width(), numberOfLayers*m_main_height);
m_map->fill(Qt::white);
QPainter painter(m_map);
painter.initFrom(this);
int count=0;
for(int i=0; i<static_cast<int>(m_controller->getSelectedLayers().size()); ++i)
{
if(m_controller->getSelectedLayers()[i]->getType() == TimelineItem::kCel || m_controller->getSelectedLayers()[i]->getType() == TimelineItem::kCut
|| m_controller->getSelectedLayers()[i]->getParent() != m_controller->getActiveCelItem())
continue;
painter.translate(0, count*m_main_height);
++count;
paintLayer(painter, m_controller->getSelectedLayers()[i], true);
painter.resetTransform();
}
}
Bookmarks