42 #ifndef QDECLARATIVEITEM_P_H 43 #define QDECLARATIVEITEM_P_H 58 #include "private/qdeclarativeanchors_p.h" 59 #include "private/qdeclarativeanchors_p_p.h" 60 #include "private/qdeclarativeitemchangelistener_p.h" 61 #include <private/qpodvector_p.h> 63 #include <private/qdeclarativestate_p.h> 64 #include <private/qdeclarativenullablevalue_p_p.h> 65 #include <private/qdeclarativenotifier_p.h> 66 #include <private/qdeclarativeglobal_p.h> 71 #include <QtCore/qlist.h> 72 #include <QtCore/qdebug.h> 74 #include <private/qgraphicsitem_p.h> 123 : _anchors(0), _contents(0),
127 widthValid(false), heightValid(false),
128 componentComplete(true), keepMouse(false),
129 smooth(false), transformOriginDirty(true), doneEventPreHandler(false),
130 inheritedLayoutMirror(false), effectiveLayoutMirror(false), isMirrorImplicit(true),
131 inheritMirrorFromParent(false), inheritMirrorFromItem(false), hadFocus(false), hadActiveFocus(false), keyHandler(0),
132 mWidth(0), mHeight(0), mImplicitWidth(0), mImplicitHeight(0), attachedLayoutDirection(0)
135 isDeclarativeItem = 1;
147 q->setParentItem(parent);
151 baselineOffset.invalidate();
152 mouseSetsFocus =
false;
156 return effectiveLayoutMirror;
161 void setWidth(
qreal);
164 qreal height()
const;
165 void setHeight(
qreal);
168 virtual qreal implicitWidth()
const;
169 virtual qreal implicitHeight()
const;
170 virtual void implicitWidthChanged();
171 virtual void implicitHeightChanged();
173 void resolveLayoutMirror();
174 void setImplicitLayoutMirror(
bool mirror,
bool inherit);
175 void setLayoutMirror(
bool mirror);
184 void setState(
const QString &);
214 return item->d_func();
225 if (!componentComplete)
226 _anchors->classBegin();
248 if (!_anchorLines) _anchorLines =
249 new AnchorLines(const_cast<QDeclarativeItem *>(q));
266 QDeclarativeItemPrivate::ChangeTypes
types;
305 QPointF computeTransformOrigin()
const;
310 QRectF oldGeometry(this->pos.
x(), this->pos.
y(), mWidth, mHeight);
312 q->geometryChanged(
QRectF(this->pos.
x(), this->pos.
y(), mWidth, mHeight), oldGeometry);
318 if (hadFocus != isSubFocusItem) {
319 hadFocus = isSubFocusItem;
320 emit q_func()->focusChanged(isSubFocusItem);
328 for(
int ii = 0; ii < changeListeners.
count(); ++ii) {
337 virtual void transformChanged();
339 virtual void focusChanged(
bool);
343 static qint64 consistentTime;
344 static void setConsistentTime(
qint64 t);
363 virtual void keyReleased(
QKeyEvent *event,
bool post);
366 virtual void componentComplete();
408 QDeclarativeItem *right() const;
409 void setRight(QDeclarativeItem *);
410 QDeclarativeItem *up() const;
411 void setUp(QDeclarativeItem *);
412 QDeclarativeItem *down() const;
413 void setDown(QDeclarativeItem *);
414 QDeclarativeItem *tab() const;
415 void setTab(QDeclarativeItem *);
416 QDeclarativeItem *backtab() const;
417 void setBacktab(QDeclarativeItem *);
431 void backtabChanged();
432 void priorityChanged();
436 virtual void keyReleased(
QKeyEvent *event,
bool post);
450 void setEnabled(
bool);
453 bool childrenInherit()
const;
454 void setChildrenInherit(
bool);
458 void enabledChanged();
459 void childrenInheritChanged();
470 , inIM(false),
enabled(true), imeItem(0), item(0)
513 if (enabled !=
d->enabled) {
515 emit enabledChanged();
528 virtual void componentComplete();
533 void enabledChanged();
534 void priorityChanged();
579 virtual void keyPressed(
QKeyEvent *event,
bool post);
580 virtual void keyReleased(
QKeyEvent *event,
bool post);
587 keySignal =
"digit0Pressed";
591 while (sigMap[i].key && sigMap[i].key != key)
593 keySignal = sigMap[i].sig;
617 #endif // QDECLARATIVEITEM_P_H The QVariant class acts like a union for the most common Qt data types.
const T & at(int idx) const
QDeclarativeAnchorLine right
QGraphicsItem * finalFocusProxy(QGraphicsItem *item) const
The QKeyEvent class describes a key event.
QDeclarativeAnchorLine top
static double elapsed(qint64 after, qint64 before)
#define QT_END_NAMESPACE
This macro expands to.
void calcHeight(QDeclarativeItem *changed=0)
QDeclarativeItemKeyFilter * m_next
#define QML_DECLARE_TYPE(TYPE)
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
bool inheritedLayoutMirror
virtual void siblingOrderChange()
Subclasses can reimplement this function to be notified when its siblingIndex order is changed...
QDeclarativeAnchors * anchors()
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
The QByteArray class provides an array of bytes.
The QPointF class defines a point in the plane using floating point precision.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QDeclarativeItem * m_item
QDeclarativeListProperty< QDeclarativeItem > forwardTo()
bool inheritMirrorFromParent
QGraphicsItem * focusProxy() const
Returns this item's focus proxy, or 0 if this item has no focus proxy.
void childAdded(QDeclarativeItem *item)
QDeclarativeAnchorLine left
The QString class provides a Unicode character string.
QDeclarativeItemPrivate * itemPrivate
QDeclarativeItemPrivate()
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
The QElapsedTimer class provides a fast way to calculate elapsed times.
virtual void setPosHelper(const QPointF &pos)
Sets the position pos.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void init(QDeclarativeItem *parent)
QDeclarativeContents(QDeclarativeItem *item)
qreal x() const
Returns the x-coordinate of this point.
quint32 acceptedMouseButtons
bool inheritMirrorFromItem
QList< QDeclarativeItem * > targets
QDeclarativeAnchors * _anchors
#define QML_DECLARE_TYPEINFO(TYPE, FLAGS)
virtual void itemSiblingOrderChanged(QDeclarativeItem *)
QDeclarativeItem * backtab
#define QT_BEGIN_NAMESPACE
This macro expands to.
QDeclarativeItemPrivate::ChangeTypes types
The QRectF class defines a rectangle in the plane using floating point precision. ...
bool operator==(const ChangeListener &other) const
The QDeclarativeItem class provides the most basic of all visual items in QML.
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
void calcWidth(QDeclarativeItem *changed=0)
static QDeclarativeItemPrivate * get(QDeclarativeItem *item)
QDeclarativeAnchorLine vCenter
static const char * data(const QByteArray &arr)
void childRemoved(QDeclarativeItem *item)
QDeclarativeLayoutMirroringAttached * attachedLayoutDirection
void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry)
AnchorLines * _anchorLines
QDeclarativeAnchorLine baseline
QDeclarativeItem::TransformOrigin origin
QDeclarativeAnchorLine hCenter
virtual void mirrorChange()
bool effectiveLayoutMirror
QPODVector< ChangeListener, 4 > changeListeners
#define Q_DECLARATIVE_EXPORT
TransformOrigin
Controls the point about which simple transforms like scale apply.
#define Q_DECLARE_PUBLIC(Class)
QDeclarativeKeyNavigationAttachedPrivate()
QDeclarativeNullableValue< qreal > baselineOffset
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
QObject * parent() const
Returns a pointer to the parent object.
QDeclarativeNotifier parentNotifier
ChangeListener(QDeclarativeItemChangeListener *l, QDeclarativeItemPrivate::ChangeTypes t)
QDeclarativeAnchorLine bottom
AnchorLines * anchorLines() const
qreal y() const
Returns the y-coordinate of this point.
QDeclarativeItemKeyFilter * keyHandler
void setEnabled(bool enabled)
QDeclarativeKeysAttachedPrivate()
virtual void focusScopeItemChange(bool isSubFocusItem)
Subclasses can reimplement this function to be notified when an item becomes a focusScopeItem (or is ...
#define Q_DECLARE_PRIVATE(Class)
QDeclarativeStateGroup * _stateGroup
static QNSListener * listener
Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeItemPrivate::ChangeTypes)
const QByteArray keyToSignal(int key)
The QGraphicsObject class provides a base class for all graphics items that require signals...
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
void itemDestroyed(QDeclarativeItem *item)
QDeclarativeItemChangeListener * listener
virtual void setPosHelper(const QPointF &pos)
Sets the position pos.
The QList class is a template class that provides lists.
bool transformOriginDirty
QDeclarativeContents * _contents