Qt 4.8
Public Types | Signals | Public Functions | Properties | Friends | List of all members
QDeclarativeAnchors Class Reference

#include <qdeclarativeanchors_p.h>

Inheritance diagram for QDeclarativeAnchors:
QObject

Public Types

enum  Anchor {
  LeftAnchor = 0x01, RightAnchor = 0x02, TopAnchor = 0x04, BottomAnchor = 0x08,
  HCenterAnchor = 0x10, VCenterAnchor = 0x20, BaselineAnchor = 0x40, Horizontal_Mask = LeftAnchor | RightAnchor | HCenterAnchor,
  Vertical_Mask = TopAnchor | BottomAnchor | VCenterAnchor | BaselineAnchor
}
 

Signals

void baselineChanged ()
 
void baselineOffsetChanged ()
 
void bottomChanged ()
 
void bottomMarginChanged ()
 
void centerInChanged ()
 
void fillChanged ()
 
void horizontalCenterChanged ()
 
void horizontalCenterOffsetChanged ()
 
void leftChanged ()
 
void leftMarginChanged ()
 
void marginsChanged ()
 
void rightChanged ()
 
void rightMarginChanged ()
 
void topChanged ()
 
void topMarginChanged ()
 
void verticalCenterChanged ()
 
void verticalCenterOffsetChanged ()
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

QDeclarativeAnchorLine baseline () const
 
qreal baselineOffset () const
 
QDeclarativeAnchorLine bottom () const
 
qreal bottomMargin () const
 
QGraphicsObjectcenterIn () const
 
void classBegin ()
 
void componentComplete ()
 
QGraphicsObjectfill () const
 
QDeclarativeAnchorLine horizontalCenter () const
 
qreal horizontalCenterOffset () const
 
QDeclarativeAnchorLine left () const
 
qreal leftMargin () const
 
qreal margins () const
 
bool mirrored ()
 
 QDeclarativeAnchors (QObject *parent=0)
 
 QDeclarativeAnchors (QGraphicsObject *item, QObject *parent=0)
 
void resetBaseline ()
 
void resetBottom ()
 
void resetCenterIn ()
 
void resetFill ()
 
void resetHorizontalCenter ()
 
void resetLeft ()
 
void resetRight ()
 
void resetTop ()
 
void resetVerticalCenter ()
 
QDeclarativeAnchorLine right () const
 
qreal rightMargin () const
 
void setBaseline (const QDeclarativeAnchorLine &edge)
 
void setBaselineOffset (qreal)
 
void setBottom (const QDeclarativeAnchorLine &edge)
 
void setBottomMargin (qreal)
 
void setCenterIn (QGraphicsObject *)
 
void setFill (QGraphicsObject *)
 
void setHorizontalCenter (const QDeclarativeAnchorLine &edge)
 
void setHorizontalCenterOffset (qreal)
 
void setLeft (const QDeclarativeAnchorLine &edge)
 
void setLeftMargin (qreal)
 
void setMargins (qreal)
 
void setRight (const QDeclarativeAnchorLine &edge)
 
void setRightMargin (qreal)
 
void setTop (const QDeclarativeAnchorLine &edge)
 
void setTopMargin (qreal)
 
void setVerticalCenter (const QDeclarativeAnchorLine &edge)
 
void setVerticalCenterOffset (qreal)
 
QDeclarativeAnchorLine top () const
 
qreal topMargin () const
 
Anchors usedAnchors () const
 
QDeclarativeAnchorLine verticalCenter () const
 
qreal verticalCenterOffset () const
 
virtual ~QDeclarativeAnchors ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Properties

QDeclarativeAnchorLine baseline
 
qreal baselineOffset
 
QDeclarativeAnchorLine bottom
 
qreal bottomMargin
 
QGraphicsObjectcenterIn
 
QGraphicsObjectfill
 
QDeclarativeAnchorLine horizontalCenter
 
qreal horizontalCenterOffset
 
QDeclarativeAnchorLine left
 
qreal leftMargin
 
qreal margins
 
QDeclarativeAnchorLine right
 
qreal rightMargin
 
QDeclarativeAnchorLine top
 
qreal topMargin
 
QDeclarativeAnchorLine verticalCenter
 
qreal verticalCenterOffset
 

Friends

class QDeclarativeGraphicsWidget
 
class QDeclarativeItem
 
class QDeclarativeItemPrivate
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 61 of file qdeclarativeanchors_p.h.

Enumerations

◆ Anchor

Constructors and Destructors

◆ QDeclarativeAnchors() [1/2]

QDeclarativeAnchors::QDeclarativeAnchors ( QObject parent = 0)

Definition at line 151 of file qdeclarativeanchors.cpp.

152  : QObject(*new QDeclarativeAnchorsPrivate(0), parent)
153 {
154  qFatal("QDeclarativeAnchors::QDeclarativeAnchors(QObject*) called");
155 }
Q_CORE_EXPORT void qFatal(const char *,...)
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753

◆ QDeclarativeAnchors() [2/2]

QDeclarativeAnchors::QDeclarativeAnchors ( QGraphicsObject item,
QObject parent = 0 
)

Definition at line 157 of file qdeclarativeanchors.cpp.

158  : QObject(*new QDeclarativeAnchorsPrivate(item), parent)
159 {
160 }
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753

◆ ~QDeclarativeAnchors()

QDeclarativeAnchors::~QDeclarativeAnchors ( )
virtual

Definition at line 162 of file qdeclarativeanchors.cpp.

Referenced by QDeclarativeAnchorsPrivate::clearItem().

163 {
165  d->remDepend(d->fill);
166  d->remDepend(d->centerIn);
167  d->remDepend(d->left.item);
168  d->remDepend(d->right.item);
169  d->remDepend(d->top.item);
170  d->remDepend(d->bottom.item);
171  d->remDepend(d->vCenter.item);
172  d->remDepend(d->hCenter.item);
173  d->remDepend(d->baseline.item);
174 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

Functions

◆ baseline()

QDeclarativeAnchorLine QDeclarativeAnchors::baseline ( ) const

◆ baselineChanged

void QDeclarativeAnchors::baselineChanged ( )
signal

Referenced by resetBaseline(), and setBaseline().

◆ baselineOffset()

qreal QDeclarativeAnchors::baselineOffset ( ) const

◆ baselineOffsetChanged

void QDeclarativeAnchors::baselineOffsetChanged ( )
signal

Referenced by setBaselineOffset().

◆ bottom()

QDeclarativeAnchorLine QDeclarativeAnchors::bottom ( ) const

◆ bottomChanged

void QDeclarativeAnchors::bottomChanged ( )
signal

Referenced by resetBottom(), and setBottom().

◆ bottomMargin()

qreal QDeclarativeAnchors::bottomMargin ( ) const

◆ bottomMarginChanged

void QDeclarativeAnchors::bottomMarginChanged ( )
signal

Referenced by setBottomMargin().

◆ centerIn()

QGraphicsObject* QDeclarativeAnchors::centerIn ( ) const

◆ centerInChanged

void QDeclarativeAnchors::centerInChanged ( )
signal

◆ classBegin()

void QDeclarativeAnchors::classBegin ( )

Definition at line 308 of file qdeclarativeanchors.cpp.

309 {
311  d->componentComplete = false;
312 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ componentComplete()

void QDeclarativeAnchors::componentComplete ( )

Definition at line 314 of file qdeclarativeanchors.cpp.

Referenced by QDeclarativeAnchorsPrivate::isItemComplete().

315 {
317  d->componentComplete = true;
318 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ fill()

QGraphicsObject* QDeclarativeAnchors::fill ( ) const

◆ fillChanged

void QDeclarativeAnchors::fillChanged ( )
signal

◆ horizontalCenter()

QDeclarativeAnchorLine QDeclarativeAnchors::horizontalCenter ( ) const

Referenced by resetRight().

◆ horizontalCenterChanged

void QDeclarativeAnchors::horizontalCenterChanged ( )
signal

◆ horizontalCenterOffset()

qreal QDeclarativeAnchors::horizontalCenterOffset ( ) const

Referenced by setMargins().

◆ horizontalCenterOffsetChanged

void QDeclarativeAnchors::horizontalCenterOffsetChanged ( )
signal

◆ left()

QDeclarativeAnchorLine QDeclarativeAnchors::left ( ) const

◆ leftChanged

void QDeclarativeAnchors::leftChanged ( )
signal

Referenced by resetLeft(), and setLeft().

◆ leftMargin()

qreal QDeclarativeAnchors::leftMargin ( ) const

◆ leftMarginChanged

void QDeclarativeAnchors::leftMarginChanged ( )
signal

Referenced by setLeftMargin().

◆ margins()

qreal QDeclarativeAnchors::margins ( ) const

Referenced by setRightMargin().

◆ marginsChanged

void QDeclarativeAnchors::marginsChanged ( )
signal

Referenced by setMargins().

◆ mirrored()

bool QDeclarativeAnchors::mirrored ( )

Definition at line 320 of file qdeclarativeanchors.cpp.

321 {
323  QGraphicsItemPrivate * itemPrivate = QGraphicsItemPrivate::get(d->item);
324  return itemPrivate->isDeclarativeItem ? static_cast<QDeclarativeItemPrivate *>(itemPrivate)->effectiveLayoutMirror : false;
325 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)

◆ resetBaseline()

void QDeclarativeAnchors::resetBaseline ( )

Definition at line 815 of file qdeclarativeanchors.cpp.

Referenced by QDeclarativeAnchorChanges::clearBindings(), QDeclarativeAnchorChanges::execute(), and QDeclarativeAnchorChanges::reverse().

816 {
818  d->usedAnchors &= ~BaselineAnchor;
819  d->remDepend(d->baseline.item);
820  d->baseline = QDeclarativeAnchorLine();
822  d->updateVerticalAnchors();
823 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ resetBottom()

void QDeclarativeAnchors::resetBottom ( )

Definition at line 743 of file qdeclarativeanchors.cpp.

Referenced by QDeclarativeAnchorChanges::clearBindings(), QDeclarativeAnchorChanges::execute(), and QDeclarativeAnchorChanges::reverse().

744 {
746  d->usedAnchors &= ~BottomAnchor;
747  d->remDepend(d->bottom.item);
748  d->bottom = QDeclarativeAnchorLine();
750  d->updateVerticalAnchors();
751 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ resetCenterIn()

void QDeclarativeAnchors::resetCenterIn ( )

Definition at line 480 of file qdeclarativeanchors.cpp.

481 {
482  setCenterIn(0);
483 }
void setCenterIn(QGraphicsObject *)

◆ resetFill()

void QDeclarativeAnchors::resetFill ( )

Definition at line 445 of file qdeclarativeanchors.cpp.

446 {
447  setFill(0);
448 }
void setFill(QGraphicsObject *)

◆ resetHorizontalCenter()

void QDeclarativeAnchors::resetHorizontalCenter ( )

Definition at line 923 of file qdeclarativeanchors.cpp.

Referenced by QDeclarativeAnchorChanges::clearBindings(), QDeclarativeAnchorChanges::execute(), and QDeclarativeAnchorChanges::reverse().

924 {
926  d->usedAnchors &= ~HCenterAnchor;
927  d->remDepend(d->hCenter.item);
928  d->hCenter = QDeclarativeAnchorLine();
930  d->updateHorizontalAnchors();
931 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void horizontalCenterChanged()

◆ resetLeft()

void QDeclarativeAnchors::resetLeft ( )

Definition at line 851 of file qdeclarativeanchors.cpp.

Referenced by QDeclarativeAnchorChanges::clearBindings(), QDeclarativeAnchorChanges::execute(), and QDeclarativeAnchorChanges::reverse().

852 {
854  d->usedAnchors &= ~LeftAnchor;
855  d->remDepend(d->left.item);
856  d->left = QDeclarativeAnchorLine();
857  emit leftChanged();
858  d->updateHorizontalAnchors();
859 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ resetRight()

void QDeclarativeAnchors::resetRight ( )

Definition at line 887 of file qdeclarativeanchors.cpp.

Referenced by QDeclarativeAnchorChanges::clearBindings(), QDeclarativeAnchorChanges::execute(), and QDeclarativeAnchorChanges::reverse().

888 {
890  d->usedAnchors &= ~RightAnchor;
891  d->remDepend(d->right.item);
892  d->right = QDeclarativeAnchorLine();
893  emit rightChanged();
894  d->updateHorizontalAnchors();
895 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ resetTop()

void QDeclarativeAnchors::resetTop ( )

Definition at line 707 of file qdeclarativeanchors.cpp.

Referenced by QDeclarativeAnchorChanges::clearBindings(), QDeclarativeAnchorChanges::execute(), and QDeclarativeAnchorChanges::reverse().

708 {
710  d->usedAnchors &= ~TopAnchor;
711  d->remDepend(d->top.item);
712  d->top = QDeclarativeAnchorLine();
713  emit topChanged();
714  d->updateVerticalAnchors();
715 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ resetVerticalCenter()

void QDeclarativeAnchors::resetVerticalCenter ( )

Definition at line 779 of file qdeclarativeanchors.cpp.

Referenced by QDeclarativeAnchorChanges::clearBindings(), QDeclarativeAnchorChanges::execute(), and QDeclarativeAnchorChanges::reverse().

780 {
782  d->usedAnchors &= ~VCenterAnchor;
783  d->remDepend(d->vCenter.item);
784  d->vCenter = QDeclarativeAnchorLine();
786  d->updateVerticalAnchors();
787 }
double d
Definition: qnumeric_p.h:62
void verticalCenterChanged()
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ right()

QDeclarativeAnchorLine QDeclarativeAnchors::right ( ) const

◆ rightChanged

void QDeclarativeAnchors::rightChanged ( )
signal

Referenced by resetRight(), and setRight().

◆ rightMargin()

qreal QDeclarativeAnchors::rightMargin ( ) const

◆ rightMarginChanged

void QDeclarativeAnchors::rightMarginChanged ( )
signal

Referenced by setRightMargin().

◆ setBaseline()

void QDeclarativeAnchors::setBaseline ( const QDeclarativeAnchorLine edge)

Definition at line 795 of file qdeclarativeanchors.cpp.

796 {
798  if (!d->checkVAnchorValid(edge) || d->baseline == edge)
799  return;
800 
801  d->usedAnchors |= BaselineAnchor;
802 
803  if (!d->checkVValid()) {
804  d->usedAnchors &= ~BaselineAnchor;
805  return;
806  }
807 
808  d->remDepend(d->baseline.item);
809  d->baseline = edge;
810  d->addDepend(d->baseline.item);
812  d->updateVerticalAnchors();
813 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setBaselineOffset()

void QDeclarativeAnchors::setBaselineOffset ( qreal  offset)

Definition at line 1078 of file qdeclarativeanchors.cpp.

1079 {
1081  if (d->baselineOffset == offset)
1082  return;
1083  d->baselineOffset = offset;
1084  d->updateVerticalAnchors();
1086 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void baselineOffsetChanged()

◆ setBottom()

void QDeclarativeAnchors::setBottom ( const QDeclarativeAnchorLine edge)

Definition at line 723 of file qdeclarativeanchors.cpp.

724 {
726  if (!d->checkVAnchorValid(edge) || d->bottom == edge)
727  return;
728 
729  d->usedAnchors |= BottomAnchor;
730 
731  if (!d->checkVValid()) {
732  d->usedAnchors &= ~BottomAnchor;
733  return;
734  }
735 
736  d->remDepend(d->bottom.item);
737  d->bottom = edge;
738  d->addDepend(d->bottom.item);
740  d->updateVerticalAnchors();
741 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setBottomMargin()

void QDeclarativeAnchors::setBottomMargin ( qreal  offset)

Definition at line 1040 of file qdeclarativeanchors.cpp.

Referenced by setMargins().

1041 {
1043  if (d->bottomMargin == offset)
1044  return;
1045  d->bottomMargin = offset;
1046  if(d->fill)
1047  d->fillChanged();
1048  else
1049  d->updateVerticalAnchors();
1051 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setCenterIn()

void QDeclarativeAnchors::setCenterIn ( QGraphicsObject c)

Definition at line 456 of file qdeclarativeanchors.cpp.

Referenced by resetCenterIn().

457 {
459  if (d->centerIn == c)
460  return;
461 
462  if (!c) {
463  d->remDepend(d->centerIn);
464  d->centerIn = c;
466  return;
467  }
468  if (c != d->item->parentItem() && c->parentItem() != d->item->parentItem()){
469  qmlInfo(d->item) << tr("Cannot anchor to an item that isn't a parent or sibling.");
470  return;
471  }
472 
473  d->remDepend(d->centerIn);
474  d->centerIn = c;
475  d->addDepend(d->centerIn);
477  d->centerInChanged();
478 }
double d
Definition: qnumeric_p.h:62
unsigned char c[8]
Definition: qnumeric_p.h:62
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
QGraphicsItem * parentItem() const
Returns a pointer to this item&#39;s parent item.
QDeclarativeInfo qmlInfo(const QObject *me)

◆ setFill()

void QDeclarativeAnchors::setFill ( QGraphicsObject f)

Definition at line 422 of file qdeclarativeanchors.cpp.

Referenced by resetFill().

423 {
425  if (d->fill == f)
426  return;
427 
428  if (!f) {
429  d->remDepend(d->fill);
430  d->fill = f;
431  emit fillChanged();
432  return;
433  }
434  if (f != d->item->parentItem() && f->parentItem() != d->item->parentItem()){
435  qmlInfo(d->item) << tr("Cannot anchor to an item that isn't a parent or sibling.");
436  return;
437  }
438  d->remDepend(d->fill);
439  d->fill = f;
440  d->addDepend(d->fill);
441  emit fillChanged();
442  d->fillChanged();
443 }
double d
Definition: qnumeric_p.h:62
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
QGraphicsItem * parentItem() const
Returns a pointer to this item&#39;s parent item.
QDeclarativeInfo qmlInfo(const QObject *me)

◆ setHorizontalCenter()

void QDeclarativeAnchors::setHorizontalCenter ( const QDeclarativeAnchorLine edge)

Definition at line 903 of file qdeclarativeanchors.cpp.

904 {
906  if (!d->checkHAnchorValid(edge) || d->hCenter == edge)
907  return;
908 
909  d->usedAnchors |= HCenterAnchor;
910 
911  if (!d->checkHValid()) {
912  d->usedAnchors &= ~HCenterAnchor;
913  return;
914  }
915 
916  d->remDepend(d->hCenter.item);
917  d->hCenter = edge;
918  d->addDepend(d->hCenter.item);
920  d->updateHorizontalAnchors();
921 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void horizontalCenterChanged()

◆ setHorizontalCenterOffset()

void QDeclarativeAnchors::setHorizontalCenterOffset ( qreal  offset)

Definition at line 1002 of file qdeclarativeanchors.cpp.

1003 {
1005  if (d->hCenterOffset == offset)
1006  return;
1007  d->hCenterOffset = offset;
1008  if(d->centerIn)
1009  d->centerInChanged();
1010  else
1011  d->updateHorizontalAnchors();
1013 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void horizontalCenterOffsetChanged()

◆ setLeft()

void QDeclarativeAnchors::setLeft ( const QDeclarativeAnchorLine edge)

Definition at line 831 of file qdeclarativeanchors.cpp.

832 {
834  if (!d->checkHAnchorValid(edge) || d->left == edge)
835  return;
836 
837  d->usedAnchors |= LeftAnchor;
838 
839  if (!d->checkHValid()) {
840  d->usedAnchors &= ~LeftAnchor;
841  return;
842  }
843 
844  d->remDepend(d->left.item);
845  d->left = edge;
846  d->addDepend(d->left.item);
847  emit leftChanged();
848  d->updateHorizontalAnchors();
849 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setLeftMargin()

void QDeclarativeAnchors::setLeftMargin ( qreal  offset)

Definition at line 939 of file qdeclarativeanchors.cpp.

Referenced by setMargins().

940 {
942  if (d->leftMargin == offset)
943  return;
944  d->leftMargin = offset;
945  if(d->fill)
946  d->fillChanged();
947  else
948  d->updateHorizontalAnchors();
950 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setMargins()

void QDeclarativeAnchors::setMargins ( qreal  offset)

Definition at line 977 of file qdeclarativeanchors.cpp.

978 {
980  if (d->margins == offset)
981  return;
982  //###Is it significantly faster to set them directly so we can call fillChanged only once?
983  if(!d->rightMargin || d->rightMargin == d->margins)
984  setRightMargin(offset);
985  if(!d->leftMargin || d->leftMargin == d->margins)
986  setLeftMargin(offset);
987  if(!d->topMargin || d->topMargin == d->margins)
988  setTopMargin(offset);
989  if(!d->bottomMargin || d->bottomMargin == d->margins)
990  setBottomMargin(offset);
991  d->margins = offset;
993 
994 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setRight()

void QDeclarativeAnchors::setRight ( const QDeclarativeAnchorLine edge)

Definition at line 867 of file qdeclarativeanchors.cpp.

868 {
870  if (!d->checkHAnchorValid(edge) || d->right == edge)
871  return;
872 
873  d->usedAnchors |= RightAnchor;
874 
875  if (!d->checkHValid()) {
876  d->usedAnchors &= ~RightAnchor;
877  return;
878  }
879 
880  d->remDepend(d->right.item);
881  d->right = edge;
882  d->addDepend(d->right.item);
883  emit rightChanged();
884  d->updateHorizontalAnchors();
885 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setRightMargin()

void QDeclarativeAnchors::setRightMargin ( qreal  offset)

Definition at line 958 of file qdeclarativeanchors.cpp.

Referenced by setMargins().

959 {
961  if (d->rightMargin == offset)
962  return;
963  d->rightMargin = offset;
964  if(d->fill)
965  d->fillChanged();
966  else
967  d->updateHorizontalAnchors();
969 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setTop()

void QDeclarativeAnchors::setTop ( const QDeclarativeAnchorLine edge)

Definition at line 687 of file qdeclarativeanchors.cpp.

688 {
690  if (!d->checkVAnchorValid(edge) || d->top == edge)
691  return;
692 
693  d->usedAnchors |= TopAnchor;
694 
695  if (!d->checkVValid()) {
696  d->usedAnchors &= ~TopAnchor;
697  return;
698  }
699 
700  d->remDepend(d->top.item);
701  d->top = edge;
702  d->addDepend(d->top.item);
703  emit topChanged();
704  d->updateVerticalAnchors();
705 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setTopMargin()

void QDeclarativeAnchors::setTopMargin ( qreal  offset)

Definition at line 1021 of file qdeclarativeanchors.cpp.

Referenced by setMargins().

1022 {
1024  if (d->topMargin == offset)
1025  return;
1026  d->topMargin = offset;
1027  if(d->fill)
1028  d->fillChanged();
1029  else
1030  d->updateVerticalAnchors();
1032 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setVerticalCenter()

void QDeclarativeAnchors::setVerticalCenter ( const QDeclarativeAnchorLine edge)

Definition at line 759 of file qdeclarativeanchors.cpp.

760 {
762  if (!d->checkVAnchorValid(edge) || d->vCenter == edge)
763  return;
764 
765  d->usedAnchors |= VCenterAnchor;
766 
767  if (!d->checkVValid()) {
768  d->usedAnchors &= ~VCenterAnchor;
769  return;
770  }
771 
772  d->remDepend(d->vCenter.item);
773  d->vCenter = edge;
774  d->addDepend(d->vCenter.item);
776  d->updateVerticalAnchors();
777 }
double d
Definition: qnumeric_p.h:62
void verticalCenterChanged()
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setVerticalCenterOffset()

void QDeclarativeAnchors::setVerticalCenterOffset ( qreal  offset)

Definition at line 1059 of file qdeclarativeanchors.cpp.

1060 {
1062  if (d->vCenterOffset == offset)
1063  return;
1064  d->vCenterOffset = offset;
1065  if(d->centerIn)
1066  d->centerInChanged();
1067  else
1068  d->updateVerticalAnchors();
1070 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void verticalCenterOffsetChanged()

◆ top()

QDeclarativeAnchorLine QDeclarativeAnchors::top ( ) const

◆ topChanged

void QDeclarativeAnchors::topChanged ( )
signal

Referenced by resetTop(), and setTop().

◆ topMargin()

qreal QDeclarativeAnchors::topMargin ( ) const

◆ topMarginChanged

void QDeclarativeAnchors::topMarginChanged ( )
signal

Referenced by setTopMargin().

◆ usedAnchors()

QDeclarativeAnchors::Anchors QDeclarativeAnchors::usedAnchors ( ) const

◆ verticalCenter()

QDeclarativeAnchorLine QDeclarativeAnchors::verticalCenter ( ) const

Referenced by resetBottom().

◆ verticalCenterChanged

void QDeclarativeAnchors::verticalCenterChanged ( )
signal

◆ verticalCenterOffset()

qreal QDeclarativeAnchors::verticalCenterOffset ( ) const

Referenced by setBottomMargin().

◆ verticalCenterOffsetChanged

void QDeclarativeAnchors::verticalCenterOffsetChanged ( )
signal

Referenced by setVerticalCenterOffset().

Friends and Related Functions

◆ QDeclarativeGraphicsWidget

Definition at line 190 of file qdeclarativeanchors_p.h.

◆ QDeclarativeItem

friend class QDeclarativeItem
friend

Definition at line 188 of file qdeclarativeanchors_p.h.

◆ QDeclarativeItemPrivate

Definition at line 189 of file qdeclarativeanchors_p.h.

Properties

◆ baseline

QDeclarativeAnchorLine QDeclarativeAnchors::baseline
private

◆ baselineOffset

qreal QDeclarativeAnchors::baselineOffset
private

Definition at line 79 of file qdeclarativeanchors_p.h.

◆ bottom

QDeclarativeAnchorLine QDeclarativeAnchors::bottom
private

◆ bottomMargin

qreal QDeclarativeAnchors::bottomMargin
private

Definition at line 77 of file qdeclarativeanchors_p.h.

◆ centerIn

QGraphicsObject * QDeclarativeAnchors::centerIn
private

◆ fill

QGraphicsObject * QDeclarativeAnchors::fill
private

◆ horizontalCenter

QDeclarativeAnchorLine QDeclarativeAnchors::horizontalCenter
private

◆ horizontalCenterOffset

qreal QDeclarativeAnchors::horizontalCenterOffset
private

Definition at line 75 of file qdeclarativeanchors_p.h.

◆ left

QDeclarativeAnchorLine QDeclarativeAnchors::left
private

◆ leftMargin

qreal QDeclarativeAnchors::leftMargin
private

Definition at line 73 of file qdeclarativeanchors_p.h.

◆ margins

qreal QDeclarativeAnchors::margins
private

Definition at line 72 of file qdeclarativeanchors_p.h.

◆ right

QDeclarativeAnchorLine QDeclarativeAnchors::right
private

◆ rightMargin

qreal QDeclarativeAnchors::rightMargin
private

Definition at line 74 of file qdeclarativeanchors_p.h.

◆ top

QDeclarativeAnchorLine QDeclarativeAnchors::top
private

◆ topMargin

qreal QDeclarativeAnchors::topMargin
private

Definition at line 76 of file qdeclarativeanchors_p.h.

◆ verticalCenter

QDeclarativeAnchorLine QDeclarativeAnchors::verticalCenter
private

◆ verticalCenterOffset

qreal QDeclarativeAnchors::verticalCenterOffset
private

Definition at line 78 of file qdeclarativeanchors_p.h.


The documentation for this class was generated from the following files: