Some size changes for comp name on poster
This commit is contained in:
parent
45fd7add57
commit
9c979d43ab
3 changed files with 21 additions and 11 deletions
|
@ -58,6 +58,7 @@ private:
|
|||
#endif
|
||||
const QStringList _validBaseDomains = {"digitalrock.de", "bluerock.dev"};
|
||||
bool _pendingIntentsChecked;
|
||||
|
||||
signals:
|
||||
Q_INVOKABLE void openedViaUrl(QString url, QString scheme);
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ Window {
|
|||
//app.openAthlete() // dorian: 53139 , rustam: 6933 , helen: 53300
|
||||
//openWidget({nation:'GER'})
|
||||
//mainStack.push("Pages/AthleteSearchPage.qml")
|
||||
openWidget({comp: 11651, cat: 26})
|
||||
//openWidget({comp: 11651, cat: 26})
|
||||
//openWidget({person: 6623})
|
||||
//console.log(JSON.stringify(serverConn.getParamsFromUrl("")))
|
||||
//openWidgetFromUrl("https://l.bluerock.dev/?comp=11601&type=starters")
|
||||
|
@ -563,8 +563,8 @@ Window {
|
|||
|
||||
Product {
|
||||
id: speedFlowChartProduct
|
||||
//identifier: "speed_flowchart"
|
||||
identifier: "android.test.purchased"
|
||||
identifier: "speed_flowchart"
|
||||
//identifier: "android.test.purchased"
|
||||
//identifier: "android.test.canceled"
|
||||
//identifier: "android.test.refunded"
|
||||
|
||||
|
|
|
@ -123,6 +123,19 @@ void BlueRockBackend::shareResultsAsPoster(QString url, QString compName) {
|
|||
return;
|
||||
}
|
||||
|
||||
// dimensions
|
||||
QRect qrCodeRect = QRect(276, 276, 1100, 1100);
|
||||
|
||||
int compNameTextLineHeight = 44;
|
||||
QFont compNameTextFont("OpenSans-Light");
|
||||
compNameTextFont.setPixelSize(compNameTextLineHeight);
|
||||
QRect compNameTextRect = QRect(
|
||||
216,
|
||||
1670,
|
||||
1220,
|
||||
100
|
||||
);
|
||||
|
||||
QPdfWriter writer(&file);
|
||||
writer.setPageSize(QPageSize(QSizeF(70.02, 99.02), QPageSize::Millimeter));
|
||||
writer.setPageMargins(QMargins(0, 0, 0, 0));
|
||||
|
@ -133,17 +146,13 @@ void BlueRockBackend::shareResultsAsPoster(QString url, QString compName) {
|
|||
painter.drawPixmap(0,0, writer.width(), writer.height(), background);
|
||||
|
||||
QPixmap barcode;
|
||||
int size = 1100;
|
||||
QZXingEncoderConfig encoderConfig(QZXing::EncoderFormat_QR_CODE, QSize(size, size), QZXing::EncodeErrorCorrectionLevel_H, false, false);
|
||||
QZXingEncoderConfig encoderConfig(QZXing::EncoderFormat_QR_CODE, qrCodeRect.size(), QZXing::EncodeErrorCorrectionLevel_H, false, false);
|
||||
barcode.convertFromImage(QZXing::encodeData(url, encoderConfig));
|
||||
painter.drawPixmap(276, 276, size, size, barcode);
|
||||
painter.drawPixmap(qrCodeRect, barcode);
|
||||
|
||||
QFont font("OpenSans-Light");
|
||||
font.setPixelSize(44);
|
||||
painter.setFont(font);
|
||||
painter.setFont(compNameTextFont);
|
||||
painter.setPen(Qt::black);
|
||||
// QFontMetrics(painter.font()).size(Qt::TextSingleLine, "One ").width()
|
||||
painter.drawText(QRect(216, 1670, 1220, 100), Qt::AlignLeft|Qt::AlignTop|Qt::TextWordWrap, rawCompName);
|
||||
painter.drawText(compNameTextRect, Qt::AlignLeft|Qt::AlignBottom|Qt::TextWordWrap, rawCompName);
|
||||
|
||||
painter.end();
|
||||
file.close();
|
||||
|
|
Loading…
Reference in a new issue