Commit f84e0e22 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve widget

parent 375cafab
......@@ -18,14 +18,28 @@
*/
#include "snippetcustomfileattachmentnamedialog.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include "snippetcustomfileattachmentnamewidget.h"
using namespace MailCommon;
SnippetCustomFileAttachmentNameDialog::SnippetCustomFileAttachmentNameDialog(QWidget *parent)
: QDialog(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mCustomWidget = new SnippetCustomFileAttachmentNameWidget(this);
mCustomWidget->setObjectName(QStringLiteral("mCustomWidget"));
mainLayout->addWidget(mCustomWidget);
}
SnippetCustomFileAttachmentNameDialog::~SnippetCustomFileAttachmentNameDialog()
{
}
QString SnippetCustomFileAttachmentNameDialog::result() const
{
return mCustomWidget->result();
}
......@@ -27,12 +27,18 @@
class QLineEdit;
namespace MailCommon {
class SnippetCustomFileAttachmentNameWidget;
class MAILCOMMON_TESTS_EXPORT SnippetCustomFileAttachmentNameDialog : public QDialog
{
Q_OBJECT
public:
explicit SnippetCustomFileAttachmentNameDialog(QWidget *parent = nullptr);
~SnippetCustomFileAttachmentNameDialog();
Q_REQUIRED_RESULT QString result() const;
private:
SnippetCustomFileAttachmentNameWidget *mCustomWidget = nullptr;
};
}
#endif // SNIPPETCUSTOMFILEATTACHMENTNAMEDIALOG_H
......@@ -18,14 +18,29 @@
*/
#include "snippetcustomfileattachmentnamewidget.h"
#include <QHBoxLayout>
#include <KLocalizedString>
#include <QLineEdit>
using namespace MailCommon;
SnippetCustomFileAttachmentNameWidget::SnippetCustomFileAttachmentNameWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mLineEdit = new QLineEdit(this);
mLineEdit->setObjectName(QStringLiteral("mLineEdit"));
mainLayout->addWidget(mLineEdit);
}
SnippetCustomFileAttachmentNameWidget::~SnippetCustomFileAttachmentNameWidget()
{
}
QString SnippetCustomFileAttachmentNameWidget::result() const
{
return mLineEdit->text();
}
......@@ -32,6 +32,9 @@ class MAILCOMMON_TESTS_EXPORT SnippetCustomFileAttachmentNameWidget : public QWi
public:
explicit SnippetCustomFileAttachmentNameWidget(QWidget *parent = nullptr);
~SnippetCustomFileAttachmentNameWidget();
Q_REQUIRED_RESULT QString result() const;
private:
QLineEdit *mLineEdit = nullptr;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment