Qt 4.8
Public Types | Public Functions | Public Variables | List of all members
AnchorVertex Struct Reference

#include <qgraphicsanchorlayout_p.h>

Inheritance diagram for AnchorVertex:
AnchorVertexPair

Public Types

enum  Type { Normal = 0, Pair }
 

Public Functions

 AnchorVertex (QGraphicsLayoutItem *item, Qt::AnchorPoint edge)
 
 AnchorVertex ()
 
QString toString () const
 

Public Variables

qreal distance
 
Qt::AnchorPoint m_edge
 
QGraphicsLayoutItemm_item
 
uint m_type: 1
 

Detailed Description

Warning
This function is not part of the public interface.

Represents a vertex (anchorage point) in the internal graph

Definition at line 80 of file qgraphicsanchorlayout_p.h.

Enumerations

◆ Type

Enumerator
Normal 
Pair 

Definition at line 81 of file qgraphicsanchorlayout_p.h.

Constructors and Destructors

◆ AnchorVertex() [1/2]

AnchorVertex::AnchorVertex ( QGraphicsLayoutItem item,
Qt::AnchorPoint  edge 
)
inline

Definition at line 86 of file qgraphicsanchorlayout_p.h.

◆ AnchorVertex() [2/2]

AnchorVertex::AnchorVertex ( )
inline

Functions

◆ toString()

QString AnchorVertex::toString ( ) const
inline

Definition at line 263 of file qgraphicsanchorlayout_p.h.

Referenced by QGraphicsAnchorLayoutPrivate::addAnchor_helper(), AnchorVertex(), createSequence(), GraphPath::GraphPath(), QGraphicsAnchorLayoutPrivate::replaceVertex(), SequentialAnchorData::SequentialAnchorData(), toString(), and AnchorData::updateChildrenSizes().

264 {
265  if (!this) {
266  return QLatin1String("NULL");
267  } else if (m_type == Pair) {
268  const AnchorVertexPair *vp = static_cast<const AnchorVertexPair *>(this);
269  return QString::fromAscii("(%1, %2)").arg(vp->m_first->toString()).arg(vp->m_second->toString());
270  } else if (!m_item) {
271  return QString::fromAscii("NULL_%1").arg(quintptr(this));
272  }
273  QString edge;
274  switch (m_edge) {
275  case Qt::AnchorLeft:
276  edge = QLatin1String("Left");
277  break;
279  edge = QLatin1String("HorizontalCenter");
280  break;
281  case Qt::AnchorRight:
282  edge = QLatin1String("Right");
283  break;
284  case Qt::AnchorTop:
285  edge = QLatin1String("Top");
286  break;
288  edge = QLatin1String("VerticalCenter");
289  break;
290  case Qt::AnchorBottom:
291  edge = QLatin1String("Bottom");
292  break;
293  default:
294  edge = QLatin1String("None");
295  break;
296  }
297  QString itemName;
298  if (m_item->isLayout()) {
299  itemName = QLatin1String("layout");
300  } else {
301  if (QGraphicsItem *item = m_item->graphicsItem()) {
302  itemName = item->data(0).toString();
303  }
304  }
305  edge.insert(0, QLatin1String("%1_"));
306  return edge.arg(itemName);
307 }
QIntegerForSizeof< void * >::Unsigned quintptr
Definition: qglobal.h:986
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
Definition: qstring.cpp:4276
QGraphicsItem * graphicsItem() const
Returns the QGraphicsItem that this layout item represents.
Qt::AnchorPoint m_edge
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
QChar * data()
Returns a pointer to the data stored in the QString.
Definition: qstring.h:710
QString toString() const
QGraphicsLayoutItem * m_item
bool isLayout() const
Returns true if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
QString & insert(int i, QChar c)
Definition: qstring.cpp:1671

Properties

◆ distance

qreal AnchorVertex::distance

◆ m_edge

Qt::AnchorPoint AnchorVertex::m_edge

◆ m_item

QGraphicsLayoutItem* AnchorVertex::m_item

◆ m_type

uint AnchorVertex::m_type

Definition at line 98 of file qgraphicsanchorlayout_p.h.

Referenced by AnchorVertexPair::AnchorVertexPair(), and toString().


The documentation for this struct was generated from the following file: