12#include <QFontDatabase>
18#include <bitcoin-build-config.h>
36 if (data.isEmpty())
return false;
40 setText(
tr(
"Resulting URI too long, try to reduce the text for label / message."));
47 setText(
tr(
"Error encoding URI into QR Code."));
53 unsigned char *
p = code->data;
54 for (
int y = 0; y < code->width; ++y) {
55 for (
int x = 0; x < code->width; ++x) {
56 qrImage.setPixel(x + 4, y + 4, ((*
p & 1) ? 0x0 : 0xffffff));
69 if (!text.isEmpty()) {
74 font.setStretch(QFont::SemiCondensed);
75 font.setLetterSpacing(QFont::AbsoluteSpacing, 1);
88 setText(
tr(
"QR code support not available."));
99 return this->pixmap(Qt::ReturnByValue).toImage();
113 QLabel::mousePressEvent(event);
136 QApplication::clipboard()->setImage(
exportImage());
QFont fixedPitchFont(bool use_embedded_font)
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when ...
bool HasPixmap(const QLabel *label)
Returns true if pixmap has been set.
qreal calculateIdealFontSize(int width, const QString &text, QFont font, qreal minPointSize, qreal font_size)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.