Important: Please read the Qt Code of Conduct -

Qt5 and QClipboard in Windows 7

  • Hello.
    I have a problem with this code:
    @#include <QtWidgets/QtWidgets>

    int main( int argc, char *argv[] )
    QApplication a( argc, argv );

    QLabel *l = new QLabel();

    l->setPixmap( QPixmap::fromImage( QApplication::clipboard()->image() ) );

    return a.exec();

    When I use PrintScreen button, QPixmap is fully black. When I copy an image from another program (for example Ms Paint), QPixmap is discolored:

    Is it Qt bug or I do something wrong?

Log in to reply