Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35126

QPixmap transparency behaviour is different on Ubuntu and Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.1
    • 5.2.0 Beta1
    • None
    • Linux
    • 0712b4ff7139b5c2cc96fd40ea7bb77a9bb8fd1c, ab3603d2b5ed2cb6bc403643d82e97015449546b

    Description

      I'm trying to set a Drag-Pixmap with the following code which works fine with Qt 4.X. Looks like it broke with Qt5.

      TreeView is derived from QTreeView.

      void TreeView::startDrag(Qt::DropActions supportedActions) {
         QPixmap pixDrag(250,24);
         pixDrag.fill(Qt::transparent);
      
         QPainter painter(&pixDrag);
         // ... drawing something on it using painter
       	
         QDrag* drag = new QDrag(this);
         drag->setPixmap(pixDrag);
         drag->setMimeData(mimeData);
         drag->exec(supportedActions);
      }
      

      On Windows everything is fine and the pixmap is transparent. On Ubuntu (12.04. LTS and 13.04) we only get a pixmap filled with black but when saving this pixmap, it is okay. Gimp, Paint etc. will show it correctly.

      Please don't pay much attention to the drawn icons. Images are just added to show my point.

      Attachments

        1. drag_ubuntu.png
          drag_ubuntu.png
          7 kB
        2. drag_windows.png
          drag_windows.png
          2 kB
        3. dragtest.zip
          6 kB
        4. saved_ubuntu.png
          saved_ubuntu.png
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            rico Rico Huber
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes