Simon De Backer 32a90493bd TEST a Merge branch 'XMLProperties'
it gets built let's test it for bugs

 Conflicts:
	sources/ElementsCollection/fileelementcollectionitem.cpp
	sources/QetGraphicsItemModeler/qetgraphicshandleritem.h
	sources/borderproperties.cpp
	sources/conductorproperties.cpp
	sources/conductorproperties.h
	sources/diagram.cpp
	sources/diagram.h
	sources/diagramprintdialog.cpp
	sources/diagramprintdialog.h
	sources/editor/graphicspart/customelementgraphicpart.cpp
	sources/editor/graphicspart/partarc.cpp
	sources/editor/graphicspart/partdynamictextfield.cpp
	sources/editor/graphicspart/partdynamictextfield.h
	sources/editor/graphicspart/partellipse.cpp
	sources/editor/graphicspart/partline.cpp
	sources/editor/graphicspart/partpolygon.cpp
	sources/editor/graphicspart/partrectangle.cpp
	sources/editor/graphicspart/partterminal.cpp
	sources/editor/graphicspart/partterminal.h
	sources/editor/graphicspart/parttext.cpp
	sources/properties/propertiesinterface.cpp
	sources/properties/propertiesinterface.h
	sources/properties/terminaldata.cpp
	sources/properties/terminaldata.h
	sources/properties/xrefproperties.cpp
	sources/properties/xrefproperties.h
	sources/qetgraphicsitem/conductor.cpp
	sources/qetgraphicsitem/conductor.h
	sources/qetgraphicsitem/conductortextitem.h
	sources/qetgraphicsitem/dynamicelementtextitem.h
	sources/qetgraphicsitem/element.cpp
	sources/qetgraphicsitem/element.h
	sources/qetgraphicsitem/elementtextitemgroup.h
	sources/qetgraphicsitem/slaveelement.cpp
	sources/qetgraphicsitem/slaveelement.h
	sources/qetgraphicsitem/terminal.cpp
	sources/qetgraphicsitem/terminal.h
	sources/qetproject.cpp
	sources/titleblockproperties.cpp
2020-10-13 22:31:58 +02:00

69 lines
2.4 KiB
C++

/*
Copyright 2006-2020 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 TITLEBLOCK_SLASH_HELPER_CELL_H
#define TITLEBLOCK_SLASH_HELPER_CELL_H
#include <QtWidgets>
#include "qet.h"
/**
This class implements a helper widget for cells that indicate the length of
columns and rows.
*/
class HelperCell : public QGraphicsObject, public QGraphicsLayoutItem {
Q_OBJECT
Q_INTERFACES(QGraphicsLayoutItem)
// constructor, destructor
public:
HelperCell(QGraphicsItem * = nullptr);
~HelperCell() override;
private:
HelperCell(const HelperCell &);
// attributes
public:
QColor background_color{Qt::white}; ///< Background color when rendering this cell
QColor foreground_color{Qt::black}; ///< Text color when rendering this cell
QString label; ///< Label displayed in this cell
Qt::Orientation orientation{Qt::Horizontal}; ///< Orientation of this cell
int index{-1}; ///< Index of this cell
// methods
public:
void setGeometry(const QRectF &) override;
QSizeF sizeHint(Qt::SizeHint, const QSizeF & = QSizeF()) const override;
QRectF boundingRect() const override;
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr) override;
virtual void setType(QET::TitleBlockColumnLength);
virtual void setActions(const QList<QAction *> &);
virtual QList<QAction *> actions() const;
virtual void setLabel(const QString &text, bool = true);
protected:
void contextMenuEvent(QGraphicsSceneContextMenuEvent *) override;
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *) override;
signals:
void contextMenuTriggered(HelperCell *);
void doubleClicked(HelperCell *);
private:
QList<QAction *> actions_; ///< List of actions displayed by the context menu
};
#endif