18 #include <QMouseEvent> 20 #if QT_VERSION < 0x050000 24 #if defined(HAVE_CONFIG_H) 33 QLabel(parent), contextMenu(0)
36 QAction *saveImageAction =
new QAction(tr(
"&Save Image..."),
this);
37 connect(saveImageAction, SIGNAL(triggered()),
this, SLOT(
saveImage()));
39 QAction *copyImageAction =
new QAction(tr(
"&Copy Image"),
this);
40 connect(copyImageAction, SIGNAL(triggered()),
this, SLOT(
copyImage()));
53 if(event->button() == Qt::LeftButton && pixmap())
56 QMimeData *mimeData =
new QMimeData;
59 QDrag *drag =
new QDrag(
this);
60 drag->setMimeData(mimeData);
63 QLabel::mousePressEvent(event);
117 connect(
model, SIGNAL(displayUnitChanged(
int)),
this, SLOT(
update()));
136 setWindowTitle(tr(
"Request payment to %1").arg(target));
141 html +=
"<html><font face='verdana, arial, helvetica, sans-serif'>";
142 html +=
"<b>"+tr(
"Payment information")+
"</b><br>";
143 html +=
"<b>"+tr(
"URI")+
"</b>: ";
152 html +=
"<b>"+tr(
"InstantSend")+
"</b>: " + (
info.
fUseInstantSend ? tr(
"Yes") : tr(
"No")) +
"<br>";
162 ui->
lblQRCode->setText(tr(
"Resulting URI too long, try to reduce the text for label / message."));
164 QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1);
167 ui->
lblQRCode->setText(tr(
"Error encoding URI into QR Code."));
170 QImage myImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32);
171 myImage.fill(0xffffff);
172 unsigned char *
p = code->data;
173 for (
int y = 0; y < code->width; y++)
175 for (
int x = 0; x < code->width; x++)
177 myImage.setPixel(x + 4, y + 4, ((*
p & 1) ? 0x0 : 0xffffff));
183 ui->
lblQRCode->setPixmap(QPixmap::fromImage(myImage).scaled(300, 300));
Ui::ReceiveRequestDialog * ui
void setupUi(QDialog *ReceiveRequestDialog)
void setInfo(const SendCoinsRecipient &info)
void setModel(OptionsModel *model)
ReceiveRequestDialog(QWidget *parent=0)
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit)
void setClipboard(const QString &str)
#define EXPORT_IMAGE_SIZE
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
QString HtmlEscape(const QString &str, bool fMultiLine)
QString formatBitcoinURI(const SendCoinsRecipient &info)
void on_btnCopyAddress_clicked()
QRImageWidget * lblQRCode
static const int MAX_URI_LENGTH
void on_btnCopyURI_clicked()