Changeset View
Changeset View
Standalone View
Standalone View
klipper/klipper.cpp
Show First 20 Lines • Show All 924 Lines • ▼ Show 20 Line(s) | 921 | { | |||
---|---|---|---|---|---|
925 | QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok, dlg); | 925 | QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok, dlg); | ||
926 | buttons->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL | Qt::Key_Return); | 926 | buttons->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL | Qt::Key_Return); | ||
927 | connect(buttons, &QDialogButtonBox::accepted, dlg.data(), &QDialog::accept); | 927 | connect(buttons, &QDialogButtonBox::accepted, dlg.data(), &QDialog::accept); | ||
928 | connect(dlg.data(), &QDialog::finished, dlg.data(), &QDialog::deleteLater); | 928 | connect(dlg.data(), &QDialog::finished, dlg.data(), &QDialog::deleteLater); | ||
929 | 929 | | |||
930 | QWidget* mw = new QWidget(dlg); | 930 | QWidget* mw = new QWidget(dlg); | ||
931 | QHBoxLayout* layout = new QHBoxLayout(mw); | 931 | QHBoxLayout* layout = new QHBoxLayout(mw); | ||
932 | 932 | | |||
933 | { | ||||
933 | AbstractBarcode *qrCode = createBarcode(QRCode); | 934 | AbstractBarcode *qrCode = createBarcode(QRCode); | ||
934 | AbstractBarcode *dataMatrix = createBarcode(DataMatrix); | 935 | if (qrCode) { | ||
935 | if (item) { | 936 | if(item) { | ||
936 | qrCode->setData(item->text()); | 937 | qrCode->setData(item->text()); | ||
937 | dataMatrix->setData(item->text()); | | |||
938 | } | 938 | } | ||
939 | BarcodeLabel *qrCodeLabel = new BarcodeLabel(qrCode, mw); | 939 | BarcodeLabel *qrCodeLabel = new BarcodeLabel(qrCode, mw); | ||
940 | BarcodeLabel *dataMatrixLabel = new BarcodeLabel(dataMatrix, mw); | | |||
941 | layout->addWidget(qrCodeLabel); | 940 | layout->addWidget(qrCodeLabel); | ||
941 | } | ||||
942 | } | ||||
943 | { | ||||
944 | AbstractBarcode *dataMatrix = createBarcode(DataMatrix); | ||||
945 | if (dataMatrix) { | ||||
946 | if (item) { | ||||
947 | dataMatrix->setData(item->text()); | ||||
948 | } | ||||
949 | BarcodeLabel *dataMatrixLabel = new BarcodeLabel(dataMatrix, mw); | ||||
942 | layout->addWidget(dataMatrixLabel); | 950 | layout->addWidget(dataMatrixLabel); | ||
951 | } | ||||
952 | } | ||||
943 | 953 | | |||
944 | mw->setFocus(); | 954 | mw->setFocus(); | ||
945 | QVBoxLayout *vBox = new QVBoxLayout(dlg); | 955 | QVBoxLayout *vBox = new QVBoxLayout(dlg); | ||
946 | vBox->addWidget(mw); | 956 | vBox->addWidget(mw); | ||
947 | vBox->addWidget(buttons); | 957 | vBox->addWidget(buttons); | ||
948 | dlg->adjustSize(); | 958 | dlg->adjustSize(); | ||
949 | 959 | | |||
950 | if (m_mode == KlipperMode::Standalone) { | 960 | if (m_mode == KlipperMode::Standalone) { | ||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |