HAL
graphics_item.cpp
Go to the documentation of this file.
2 #include "gui/gui_globals.h"
5 
6 namespace hal
7 {
8  qreal GraphicsItem::sLod;
11 
13  {
14  sSelectionColor = QColor(240, 173, 0);
15  sHighlightColor = QColor(40, 200, 240);
16  }
17 
18  void GraphicsItem::setLod(const qreal lod)
19  {
20  sLod = lod;
21  }
22 
24  mItemType(type),
25  mHighlight(false),
26  mId(id),
27  mColor(255, 0, 255)
28  {
30  }
31 
33  {
34  return mItemType;
35  }
36 
38  {
39  return mId;
40  }
41 
43  {
44  if (hl==mHighlight) return; // nothing to do
45  mHighlight = hl;
46  update();
47  }
48 
50  {
51  if (mHighlight) return sHighlightColor;
52  return sSelectionColor;
53  }
54 
56  {
59  }
60 
61  QColor GraphicsItem::penColor(QStyle::State state, const QColor& colorHint) const
62  {
64  QColor gcol = groupingColor();
65  if (gcol.isValid()) return gcol;
66  if (colorHint.isValid()) return colorHint;
67  return mColor;
68  }
69 }
GroupingManagerWidget * getGroupingManagerWidget()
static QColor sSelectionColor
Definition: graphics_item.h:98
QColor selectionColor() const
static QColor sHighlightColor
static void setLod(const qreal lod)
QColor penColor(QStyle::State state, const QColor &colorHint=QColor()) const
ItemType itemType() const
void setHightlight(bool hl)
GraphicsItem(const ItemType type, const u32 id)
QColor groupingColor() const
static qreal sLod
Definition: graphics_item.h:93
static void loadSettings()
GroupingTableModel * getModel() const
QColor colorForItem(ItemType itemType, u32 itemId) const
ItemType
The ItemType enum provides the enum type to classify graphic items into Modules, Gates or Nets....
Definition: gui_def.h:45
ContentManager * gContentManager
Definition: plugin_gui.cpp:78
quint32 u32
PinType type
i32 id
bool isValid() const const
void setFlags(QGraphicsItem::GraphicsItemFlags flags)
void update(const QRectF &rect)
typedef State