Results 1 to 2 of 2

Thread: QPixmap imcomplete rendering for QDrag and QCursor for Win XP 32 bit

  1. #1
    Join Date
    Jun 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QPixmap imcomplete rendering for QDrag and QCursor for Win XP 32 bit

    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();
    }
    }
    Last edited by welsper84; 14th June 2010 at 08:40. Reason: Typo error

  2. #2
    Join Date
    Feb 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QPixmap imcomplete rendering for QDrag and QCursor for Win XP 32 bit

    Hi!

    have u managed to get it working? I'm having the same problem under Windows XP. in Mac works as expected, but in windows, if I set the pixmap scaled to some size bigger than the original, only a quarter of the image will show.

Similar Threads

  1. Replies: 8
    Last Post: 7th November 2012, 19:20
  2. Rendering QGraphicsScene to QPixmap to save
    By Rooster in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2009, 05:24
  3. QDrag : memory allocation
    By kghose in forum Qt Programming
    Replies: 1
    Last Post: 14th August 2008, 22:57
  4. Does QDrag support QBitmap?
    By alfa_wu in forum Qt Programming
    Replies: 8
    Last Post: 9th May 2007, 02:56
  5. Changing QDrag's pixmap
    By Gopala Krishna in forum Qt Programming
    Replies: 2
    Last Post: 13th January 2007, 05:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.