File indexing completed on 2024-04-28 04:21:26

0001 /* SPDX-FileCopyrightText: 2007-2020 The KPhotoAlbum Development Team
0002 
0003    SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #include "TextDisplay.h"
0007 
0008 #include "ImageDisplay.h"
0009 
0010 #include <DB/ImageDB.h>
0011 
0012 #include <QLabel>
0013 #include <QVBoxLayout>
0014 #include <qlabel.h>
0015 #include <qlayout.h>
0016 
0017 /**
0018  * Display a text instead of actual image/video data.
0019  */
0020 
0021 Viewer::TextDisplay::TextDisplay(QWidget *parent)
0022     : AbstractDisplay(parent)
0023 {
0024     QVBoxLayout *lay = new QVBoxLayout(this);
0025     m_text = new QLabel(this);
0026     lay->addWidget(m_text);
0027     m_text->setAlignment(Qt::AlignCenter);
0028 }
0029 
0030 bool Viewer::TextDisplay::setImageImpl(DB::ImageInfoPtr info, bool forward)
0031 {
0032     Q_UNUSED(info)
0033     Q_UNUSED(forward)
0034     return true;
0035 }
0036 
0037 void Viewer::TextDisplay::setText(const QString text)
0038 {
0039     m_text->setText(text);
0040 }
0041 
0042 // vi:expandtab:tabstop=4 shiftwidth=4:
0043 
0044 #include "moc_TextDisplay.cpp"