2010-04-18 17:59:54 +00:00
|
|
|
/*
|
2025-01-04 13:37:40 +01:00
|
|
|
Copyright 2006-2025 The QElectroTech Team
|
2010-04-18 17:59:54 +00:00
|
|
|
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 INDEPENDENT_TEXT_ITEM_H
|
|
|
|
#define INDEPENDENT_TEXT_ITEM_H
|
2014-07-21 20:44:32 +00:00
|
|
|
|
2010-04-18 17:59:54 +00:00
|
|
|
#include "diagramtextitem.h"
|
2014-07-21 20:44:32 +00:00
|
|
|
|
2010-04-18 17:59:54 +00:00
|
|
|
/**
|
2012-11-09 21:09:24 +00:00
|
|
|
This class represents an independent text field on a particular diagram.
|
|
|
|
It may be moved, edited, and rotated.
|
2010-04-18 17:59:54 +00:00
|
|
|
*/
|
2019-02-19 16:42:07 +00:00
|
|
|
class IndependentTextItem : public DiagramTextItem
|
|
|
|
{
|
2010-04-18 17:59:54 +00:00
|
|
|
Q_OBJECT
|
2019-02-19 16:42:07 +00:00
|
|
|
|
|
|
|
// constructors, destructor
|
2010-04-18 17:59:54 +00:00
|
|
|
public:
|
2019-02-19 16:42:07 +00:00
|
|
|
IndependentTextItem();
|
|
|
|
IndependentTextItem(const QString &);
|
|
|
|
~IndependentTextItem() override;
|
2010-04-18 17:59:54 +00:00
|
|
|
|
2019-02-19 16:42:07 +00:00
|
|
|
// attributes
|
2010-04-18 17:59:54 +00:00
|
|
|
public:
|
2019-02-19 16:42:07 +00:00
|
|
|
enum { Type = UserType + 1005 };
|
|
|
|
int type() const override { return Type; }
|
|
|
|
|
|
|
|
void fromXml(const QDomElement &) override;
|
2021-03-11 19:52:50 +01:00
|
|
|
QDomElement toXml(QDomDocument &) const override;
|
2019-02-19 16:42:07 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void focusOutEvent(QFocusEvent *event) override;
|
|
|
|
|
2010-04-18 17:59:54 +00:00
|
|
|
};
|
|
|
|
#endif
|