2022-12-02 19:35:17 +01:00
|
|
|
/*
|
|
|
|
Copyright 2006-2022 The QElectroTech Team
|
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef TERMINALSTRIPDRAWER_H
|
|
|
|
#define TERMINALSTRIPDRAWER_H
|
|
|
|
|
|
|
|
#include <QPointer>
|
2023-01-04 22:40:18 +01:00
|
|
|
#include "properties/terminalstriplayoutpattern.h"
|
2022-12-02 19:35:17 +01:00
|
|
|
|
|
|
|
class QPainter;
|
|
|
|
class TerminalStrip;
|
|
|
|
|
|
|
|
class TerminalStripDrawer
|
|
|
|
{
|
|
|
|
public:
|
2023-01-04 22:40:18 +01:00
|
|
|
TerminalStripDrawer(QPointer<TerminalStrip> strip = QPointer<TerminalStrip>(),
|
|
|
|
QSharedPointer<TerminalStripLayoutPattern> layout = QSharedPointer<TerminalStripLayoutPattern>());
|
2022-12-02 19:35:17 +01:00
|
|
|
|
2022-12-21 19:18:49 +01:00
|
|
|
void setStrip(TerminalStrip *strip);
|
|
|
|
void paint(QPainter *painter);
|
2022-12-02 19:35:17 +01:00
|
|
|
QRectF boundingRect() const;
|
|
|
|
|
2023-01-04 22:40:18 +01:00
|
|
|
void setLayout(QSharedPointer<TerminalStripLayoutPattern> layout);
|
|
|
|
bool haveLayout() const;
|
|
|
|
|
2022-12-02 19:35:17 +01:00
|
|
|
private:
|
|
|
|
int height() const;
|
|
|
|
int width() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QPointer<TerminalStrip> m_strip;
|
2023-01-04 22:40:18 +01:00
|
|
|
QSharedPointer<TerminalStripLayoutPattern> m_pattern;
|
2023-02-21 21:44:28 +01:00
|
|
|
bool m_debug_draw { false };
|
2022-12-02 19:35:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TERMINALSTRIPDRAWER_H
|