File indexing completed on 2024-04-14 15:52:54

0001 /*
0002     This file is part of the Okteta Gui library, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2003, 2008, 2019 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "charbytearraycolumnrenderer_p.hpp"
0010 
0011 // Qt
0012 #include <QPainter>
0013 
0014 namespace Okteta {
0015 
0016 void CharByteArrayColumnRendererPrivate::renderByteText(QPainter* painter, Byte byte, Character byteChar, const QColor& color) const
0017 {
0018     Q_UNUSED(byte)
0019 
0020     // turn into a drawable String
0021     const QString text(byteChar.isUndefined() ?                       Okteta::Character(mUndefinedChar) :
0022                        !(mShowingNonprinting || byteChar.isPrint()) ? Okteta::Character(mSubstituteChar) :
0023                                                                       byteChar);
0024 
0025     painter->setPen(color);
0026     painter->drawText(0, mDigitBaseLine, text);
0027 }
0028 
0029 }