Baloo Widgets

keditcommentdialog.cpp
1/*
2 SPDX-FileCopyrightText: 2014 Felix Eisele
3
4 SPDX-License-Identifier: LGPL-2.0-only
5*/
6
7#include "keditcommentdialog.h"
8
9#include <QDialogButtonBox>
10#include <QLabel>
11#include <QLayout>
12#include <QPushButton>
13#include <QTextEdit>
14#include <QWidget>
15
16#include <KLocalizedString>
17
18KEditCommentDialog::KEditCommentDialog(QWidget *parent, const QString &commentText, const QString &captionText)
19 : QDialog(parent)
20 , m_editor(new QTextEdit(this))
21{
22 setWindowTitle(captionText);
23
24 auto layout = new QVBoxLayout(this);
25
26 m_editor->setText(commentText);
27
28 layout->addWidget(m_editor);
29
30 auto buttonBox = new QDialogButtonBox(this);
31 layout->addWidget(buttonBox);
32
33 buttonBox->addButton(i18n("Save"), QDialogButtonBox::AcceptRole);
34 buttonBox->addButton(QDialogButtonBox::Cancel);
35
38
39 resize(sizeHint());
40}
41
42KEditCommentDialog::~KEditCommentDialog() = default;
43
44QString KEditCommentDialog::getCommentText() const
45{
46 return m_editor->toPlainText();
47}
48
49#include "moc_keditcommentdialog.cpp"
QString i18n(const char *text, const TYPE &arg...)
virtual void accept()
virtual void reject()
QString toPlainText() const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:15 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.