Skip to content

Instantly share code, notes, and snippets.

@ordovician
Created January 9, 2019 11:37
Show Gist options
  • Save ordovician/d93f7580f6884b2fb972226d0cf68c52 to your computer and use it in GitHub Desktop.
Save ordovician/d93f7580f6884b2fb972226d0cf68c52 to your computer and use it in GitHub Desktop.
[Dump QPixmap to File] This is to help debug code where pixmaps are created #qt
#include <QtCore/QFile>
#include <QtCore/QDir>
/// Store pixmap in home directory as .png file
static void
DumpPixmapToFile(const QPixmap &pixmap) {
QString filepath = QDir::home().filePath("debug-pattern.png");
pixmap.save(filepath, "PNG");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment