1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* ============================================================
 *
 * This file is a part of digiKam project
 * https://www.digikam.org
 *
 * Date        : 2022-08-11
 * Description : a tool to generate HTML image galleries
 *
 * SPDX-FileCopyrightText: 2012-2025 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * ============================================================ */

#include "captionthemeparameter.h"

// Local includes

#include "dtextedit.h"

using namespace Digikam;

namespace DigikamGenericHtmlGalleryPlugin
{

QWidget* CaptionThemeParameter::createWidget(QWidget* parent, const QString& value) const
{
    DTextEdit* const edit = new DTextEdit(parent);
    edit->setLinesVisible(4);
    edit->setText(value);

    return edit;
}

QString CaptionThemeParameter::valueFromWidget(QWidget* widget) const
{
    Q_ASSERT(widget);

    DTextEdit* const edit = static_cast<DTextEdit*>(widget);<--- Variable 'edit' can be declared as pointer to const

    return edit->text();
}

} // namespace DigikamGenericHtmlGalleryPlugin