19 #include <QMouseEvent> 21 #if QT_VERSION < 0x050000 25 #if defined(HAVE_CONFIG_H) 34 QLabel(parent), contextMenu(0)
37 QAction *saveImageAction =
new QAction(tr(
"&Save Image..."),
this);
38 connect(saveImageAction, SIGNAL(triggered()),
this, SLOT(
saveImage()));
40 QAction *copyImageAction =
new QAction(tr(
"&Copy Image"),
this);
41 connect(copyImageAction, SIGNAL(triggered()),
this, SLOT(
copyImage()));
49 return pixmap()->toImage();
54 if(event->button() == Qt::LeftButton && pixmap())
57 QMimeData *mimeData =
new QMimeData;
60 QDrag *drag =
new QDrag(
this);
61 drag->setMimeData(mimeData);
64 QLabel::mousePressEvent(event);
119 this->
model = _model;
122 connect(_model, SIGNAL(displayUnitChanged(
int)),
this, SLOT(
update()));
142 if (uri.length() > MAX_URI_LENGTH)
144 label->setText(tr(
"Resulting URI too long, try to reduce the text for label / message."));
146 QRcode *
code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1);
149 label->setText(tr(
"Error encoding URI into QR Code."));
152 QImage qrImage = QImage(code->width + 8, code->width + 8, QImage::Format_ARGB32);
153 qrImage.fill(qRgba(0, 0, 0, 0));
154 unsigned char *p = code->data;
155 for (
int y = 0; y < code->width; y++)
157 for (
int x = 0;
x < code->width;
x++)
159 qrImage.setPixel(
x + 4, y + 4, ((*p & 1) ? qRgba(0, 0, 0, 255) : qRgba(255, 255, 255, 255)));
166 qrAddrImage.fill(qRgba(0, 0, 0, 0));
167 QPainter painter(&qrAddrImage);
173 font.setPixelSize(12);
174 painter.setFont(font);
175 QRect paddedRect = qrAddrImage.rect();
177 painter.drawText(paddedRect, Qt::AlignBottom|Qt::AlignCenter, _info.
address);
181 label->setPixmap(QPixmap::fromImage(qrAddrImage));
199 setWindowTitle(tr(
"Request payment to %1").arg(target));
204 html +=
"<html><font face='verdana, arial, helvetica, sans-serif'>";
205 html +=
"<font color='#ffffff'>" + tr(
"PAYMENT INFORMATION")+
"</font><br><br>";
206 html += tr(
"URI")+
": ";
QPushButton * btnCopyAddress
#define SetObjectStyleSheet(object, name)
Ui::ReceiveRequestDialog * ui
QString HtmlEscape(const QString &str, bool fMultiLine)
void setupUi(QDialog *ReceiveRequestDialog)
ReceiveRequestDialog(QWidget *parent=0)
void on_btnCopyAddress_clicked()
void setClipboard(const QString &str)
void setInfo(const SendCoinsRecipient &info)
static bool createQRCode(QLabel *label, SendCoinsRecipient info, bool showAddress=false)
QRImageWidget * lblQRCode
QString formatFabcoinURI(const SendCoinsRecipient &info)
Interface from Qt to configuration data structure for Fabcoin 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 ...
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit)
void setModel(OptionsModel *model)
void on_btnCopyURI_clicked()