17 #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>: ";
161 ui->
lblQRCode->setText(tr(
"Resulting URI too long, try to reduce the text for label / message."));
163 QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1);
166 ui->
lblQRCode->setText(tr(
"Error encoding URI into QR Code."));
169 QImage myImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32);
170 myImage.fill(0xffffff);
171 unsigned char *p = code->data;
172 for (
int y = 0; y < code->width; y++)
174 for (
int x = 0; x < code->width; x++)
176 myImage.setPixel(x + 4, y + 4, ((*p & 1) ? 0x0 : 0xffffff));
182 ui->
lblQRCode->setPixmap(QPixmap::fromImage(myImage).scaled(300, 300));
static QString formatWithUnit(int unit, qint64 amount, bool plussign=false)
Format as string (with unit)
Ui::ReceiveRequestDialog * ui
QString HtmlEscape(const QString &str, bool fMultiLine)
QString formatBitcoinURI(const SendCoinsRecipient &info)
void setupUi(QDialog *ReceiveRequestDialog)
ReceiveRequestDialog(QWidget *parent=0)
void on_btnCopyAddress_clicked()
#define EXPORT_IMAGE_SIZE
void setClipboard(const QString &str)
void setInfo(const SendCoinsRecipient &info)
QRImageWidget * lblQRCode
Interface from Qt to configuration data structure for Bitcoin client.
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 ...
void setModel(OptionsModel *model)
void on_btnCopyURI_clicked()
static const int MAX_URI_LENGTH