File indexing completed on 2025-01-05 03:52:04

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2022-08-11
0007  * Description : a tool to generate HTML image galleries
0008  *
0009  * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #include "captionthemeparameter.h"
0016 
0017 // Local includes
0018 
0019 #include "dtextedit.h"
0020 
0021 using namespace Digikam;
0022 
0023 namespace DigikamGenericHtmlGalleryPlugin
0024 {
0025 
0026 QWidget* CaptionThemeParameter::createWidget(QWidget* parent, const QString& value) const
0027 {
0028     DTextEdit* const edit = new DTextEdit(parent);
0029     edit->setLinesVisible(4);
0030     edit->setText(value);
0031 
0032     return edit;
0033 }
0034 
0035 QString CaptionThemeParameter::valueFromWidget(QWidget* widget) const
0036 {
0037     Q_ASSERT(widget);
0038     DTextEdit* const edit = static_cast<DTextEdit*>(widget);
0039 
0040     return edit->text();
0041 }
0042 
0043 } // namespace DigikamGenericHtmlGalleryPlugin