Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QClipboard setImage alpha black
Forum Updated to NodeBB v4.3 + New Features

QClipboard setImage alpha black

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 968 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Talei
    wrote on 9 Oct 2014, 19:50 last edited by
    #1

    Hello,
    I stumbled upon a problem with QClipboard and image transparency.
    What I want to do is to set into clipboard transparent image and paste it into Paint application. After setting it up and pasting alpha channel is black.

    My test code:

    @ QImage img = QImage(QSize(640, 480), QImage::Format_ARGB32);
    img.fill( Qt::transparent);
    QPainter p(&img);
    p.fillRect( QRect( QPoint(10, 10), QSize(320, 240)), Qt::red);
    p.end();

    QApplication::clipboard()->setImage( img);@
    

    Qt 5.3.2 MinGW - Win8.0

    Any idea why alpha is black?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Talei
      wrote on 13 Oct 2014, 10:23 last edited by
      #2

      I tried with different combinations of mime etc. always alpha is black.
      Any idea how to correct this?

      1 Reply Last reply
      0

      2/2

      13 Oct 2014, 10:23

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved