File indexing completed on 2024-06-02 05:27:07
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "gravatardownloadpixmapdialog.h" 0008 #include "gravatardownloadpixmapwidget.h" 0009 #include <QDialogButtonBox> 0010 #include <QVBoxLayout> 0011 0012 using namespace Gravatar; 0013 0014 GravatarDownloadPixmapDialog::GravatarDownloadPixmapDialog(QWidget *parent) 0015 : QDialog(parent) 0016 { 0017 auto mainLayout = new QVBoxLayout(this); 0018 mGravatarDownloadPixmapWidget = new Gravatar::GravatarDownloadPixmapWidget(this); 0019 mGravatarDownloadPixmapWidget->setObjectName(QLatin1StringView("gravatarwidget")); 0020 mainLayout->addWidget(mGravatarDownloadPixmapWidget); 0021 auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); 0022 buttonBox->setObjectName(QLatin1StringView("buttonbox")); 0023 connect(buttonBox, &QDialogButtonBox::accepted, this, &GravatarDownloadPixmapDialog::slotAccepted); 0024 connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); 0025 mainLayout->addWidget(buttonBox); 0026 } 0027 0028 GravatarDownloadPixmapDialog::~GravatarDownloadPixmapDialog() = default; 0029 0030 void GravatarDownloadPixmapDialog::slotAccepted() 0031 { 0032 accept(); 0033 } 0034 0035 QPixmap GravatarDownloadPixmapDialog::gravatarPixmap() const 0036 { 0037 return mGravatarDownloadPixmapWidget->gravatarPixmap(); 0038 } 0039 0040 #include "moc_gravatardownloadpixmapdialog.cpp"