Qt 4.8
Public Slots | Signals | Public Functions | Protected Functions | Private Slots | Private Functions | Properties | List of all members
QmlJSDebugger::AbstractViewInspector Class Referenceabstract

#include <abstractviewinspector.h>

Inheritance diagram for QmlJSDebugger::AbstractViewInspector:
QObject QmlJSDebugger::QDeclarativeViewInspector

Public Slots

void changeToColorPickerTool ()
 
void changeToMarqueeSelectTool ()
 
void changeToSingleSelectTool ()
 
void changeToZoomTool ()
 
void sendColorChanged (const QColor &color)
 
void sendDesignModeBehavior (bool inDesignMode)
 
void setAnimationPaused (bool paused)
 
void setAnimationSpeed (qreal factor)
 
virtual void setDesignModeBehavior (bool value)
 
void setShowAppOnTop (bool appOnTop)
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 

Signals

void animationPausedChanged (bool paused)
 
void animationSpeedChanged (qreal factor)
 
void colorPickerActivated ()
 
void designModeBehaviorChanged (bool inDesignMode)
 
void marqueeSelectToolActivated ()
 
void reloadRequested ()
 
void selectedColorChanged (const QColor &color)
 
void selectToolActivated ()
 
void showAppOnTopChanged (bool showAppOnTop)
 
void zoomToolActivated ()
 
- 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

 AbstractViewInspector (QObject *parent=0)
 
bool animationPaused () const
 
virtual void changeCurrentObjects (const QList< QObject *> &objects)=0
 
virtual void changeTool (InspectorProtocol::Tool tool)=0
 
void clearComponentCache ()
 
void createQmlObject (const QString &qml, QObject *parent, const QStringList &importList, const QString &filename=QString())
 
virtual QDeclarativeEnginedeclarativeEngine () const =0
 
bool designModeBehavior () const
 
QString idStringForObject (QObject *obj) const
 
virtual void reloadView ()=0
 
virtual void reparentQmlObject (QObject *object, QObject *newParent)=0
 
void sendAnimationPaused (bool paused)
 
void sendAnimationSpeed (qreal slowDownFactor)
 
void sendCurrentObjects (const QList< QObject *> &)
 
void sendCurrentTool (Constants::DesignTool toolId)
 
void sendReloaded ()
 
void sendShowAppOnTop (bool showAppOnTop)
 
bool showAppOnTop () const
 
qreal slowDownFactor () const
 
virtual QWidgetviewWidget () const =0
 
- 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...
 
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...
 

Protected Functions

AbstractToolcurrentTool () const
 
bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
virtual bool keyPressEvent (QKeyEvent *event)
 
virtual bool keyReleaseEvent (QKeyEvent *keyEvent)
 
virtual bool leaveEvent (QEvent *)
 
virtual bool mouseDoubleClickEvent (QMouseEvent *event)
 
virtual bool mouseMoveEvent (QMouseEvent *event)
 
virtual bool mousePressEvent (QMouseEvent *event)
 
virtual bool mouseReleaseEvent (QMouseEvent *event)
 
void setCurrentTool (AbstractTool *tool)
 
virtual bool wheelEvent (QWheelEvent *event)
 
- 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...
 

Private Slots

void handleMessage (const QByteArray &message)
 

Private Functions

void animationPausedChangeRequested (bool paused)
 
void animationSpeedChangeRequested (qreal factor)
 

Properties

bool m_animationPaused
 
AbstractToolm_currentTool
 
QDeclarativeInspectorServicem_debugService
 
bool m_designModeBehavior
 
bool m_showAppOnTop
 
qreal m_slowDownFactor
 
QHash< int, QStringm_stringIdForObjectId
 

Additional Inherited Members

- 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 Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 68 of file abstractviewinspector.h.

Constructors and Destructors

◆ AbstractViewInspector()

QmlJSDebugger::AbstractViewInspector::AbstractViewInspector ( QObject parent = 0)
explicit

Definition at line 58 of file abstractviewinspector.cpp.

58  :
59  QObject(parent),
60  m_currentTool(0),
61  m_showAppOnTop(false),
62  m_designModeBehavior(false),
63  m_animationPaused(false),
64  m_slowDownFactor(1.0),
66 {
69  this, SLOT(handleMessage(QByteArray)));
70 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define SLOT(a)
Definition: qobjectdefs.h:226
static QDeclarativeInspectorService * instance()
#define SIGNAL(a)
Definition: qobjectdefs.h:227
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 rece...
Definition: qobject.cpp:2580
QDeclarativeInspectorService * m_debugService
void handleMessage(const QByteArray &message)
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753

Functions

◆ animationPaused()

bool QmlJSDebugger::AbstractViewInspector::animationPaused ( ) const
inline

Definition at line 96 of file abstractviewinspector.h.

Referenced by keyReleaseEvent().

◆ animationPausedChanged

void QmlJSDebugger::AbstractViewInspector::animationPausedChanged ( bool  paused)
signal

◆ animationPausedChangeRequested()

void QmlJSDebugger::AbstractViewInspector::animationPausedChangeRequested ( bool  paused)
private

Definition at line 140 of file abstractviewinspector.cpp.

Referenced by handleMessage(), setAnimationPaused(), and setCurrentTool().

141 {
142  if (m_animationPaused != paused) {
143  m_animationPaused = paused;
145  }
146 
147  const float effectiveFactor = paused ? 0 : m_slowDownFactor;
149 }
static void setAnimationSlowDownFactor(qreal factor)
void animationPausedChanged(bool paused)
#define emit
Definition: qobjectdefs.h:76

◆ animationSpeedChanged

void QmlJSDebugger::AbstractViewInspector::animationSpeedChanged ( qreal  factor)
signal

◆ animationSpeedChangeRequested()

void QmlJSDebugger::AbstractViewInspector::animationSpeedChangeRequested ( qreal  factor)
private

Definition at line 129 of file abstractviewinspector.cpp.

Referenced by handleMessage(), setAnimationSpeed(), and setCurrentTool().

130 {
131  if (m_slowDownFactor != factor) {
132  m_slowDownFactor = factor;
133  emit animationSpeedChanged(factor);
134  }
135 
136  const float effectiveFactor = m_animationPaused ? 0 : factor;
138 }
static void setAnimationSlowDownFactor(qreal factor)
#define emit
Definition: qobjectdefs.h:76
void animationSpeedChanged(qreal factor)

◆ changeCurrentObjects()

virtual void QmlJSDebugger::AbstractViewInspector::changeCurrentObjects ( const QList< QObject *> &  objects)
pure virtual

◆ changeToColorPickerTool

void QmlJSDebugger::AbstractViewInspector::changeToColorPickerTool ( )
slot

◆ changeToMarqueeSelectTool

void QmlJSDebugger::AbstractViewInspector::changeToMarqueeSelectTool ( )
slot

◆ changeTool()

virtual void QmlJSDebugger::AbstractViewInspector::changeTool ( InspectorProtocol::Tool  tool)
pure virtual

◆ changeToSingleSelectTool

void QmlJSDebugger::AbstractViewInspector::changeToSingleSelectTool ( )
slot

◆ changeToZoomTool

void QmlJSDebugger::AbstractViewInspector::changeToZoomTool ( )
slot

Definition at line 176 of file abstractviewinspector.cpp.

Referenced by slowDownFactor().

◆ clearComponentCache()

void QmlJSDebugger::AbstractViewInspector::clearComponentCache ( )

Definition at line 95 of file abstractviewinspector.cpp.

Referenced by handleMessage().

96 {
98 }
virtual QDeclarativeEngine * declarativeEngine() const =0
void clearComponentCache()
Clears the engine&#39;s internal component cache.

◆ colorPickerActivated

void QmlJSDebugger::AbstractViewInspector::colorPickerActivated ( )
signal

Referenced by slowDownFactor().

◆ createQmlObject()

void QmlJSDebugger::AbstractViewInspector::createQmlObject ( const QString qml,
QObject parent,
const QStringList importList,
const QString filename = QString() 
)

Definition at line 72 of file abstractviewinspector.cpp.

Referenced by handleMessage().

75 {
76  if (!parent)
77  return;
78 
79  QString imports;
80  foreach (const QString &s, importList) {
81  imports += s;
82  imports += QLatin1Char('\n');
83  }
84 
85  QDeclarativeContext *parentContext = declarativeEngine()->contextForObject(parent);
87  QByteArray constructedQml = QString(imports + qml).toLatin1();
88 
89  component.setData(constructedQml, QUrl::fromLocalFile(filename));
90  QObject *newObject = component.create(parentContext);
91  if (newObject)
92  reparentQmlObject(newObject, parent);
93 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
virtual void reparentQmlObject(QObject *object, QObject *newParent)=0
The QDeclarativeComponent class encapsulates a QML component definition.
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
static qreal component(const QPointF &point, unsigned int i)
The QDeclarativeContext class defines a context within a QML engine.
virtual QDeclarativeEngine * declarativeEngine() const =0
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
Definition: qurl.cpp:6374
static QDeclarativeContext * contextForObject(const QObject *)
Returns the QDeclarativeContext for the object, or 0 if no context has been set.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ currentTool()

AbstractTool* QmlJSDebugger::AbstractViewInspector::currentTool ( ) const
inlineprotected

◆ declarativeEngine()

virtual QDeclarativeEngine* QmlJSDebugger::AbstractViewInspector::declarativeEngine ( ) const
pure virtual

◆ designModeBehavior()

bool QmlJSDebugger::AbstractViewInspector::designModeBehavior ( ) const
inline

◆ designModeBehaviorChanged

void QmlJSDebugger::AbstractViewInspector::designModeBehaviorChanged ( bool  inDesignMode)
signal

◆ eventFilter()

bool QmlJSDebugger::AbstractViewInspector::eventFilter ( QObject ,
QEvent  
)
protectedvirtual

Filters events if this object has been installed as an event filter for the watched object.

In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.

Example:

class MainWindow : public QMainWindow
{
public:
MainWindow();
protected:
bool eventFilter(QObject *obj, QEvent *ev);
private:
QTextEdit *textEdit;
};
MainWindow::MainWindow()
{
textEdit = new QTextEdit;
setCentralWidget(textEdit);
textEdit->installEventFilter(this);
}
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
{
if (obj == textEdit) {
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
qDebug() << "Ate key press" << keyEvent->key();
return true;
} else {
return false;
}
} else {
// pass the event on to the parent class
return QMainWindow::eventFilter(obj, event);
}
}

Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.

Warning
If you delete the receiver object in this function, be sure to return true. Otherwise, Qt will forward the event to the deleted object and the program might crash.
See also
installEventFilter()

Reimplemented from QObject.

Reimplemented in QmlJSDebugger::QDeclarativeViewInspector.

Definition at line 191 of file abstractviewinspector.cpp.

Referenced by QmlJSDebugger::QDeclarativeViewInspector::eventFilter(), and slowDownFactor().

192 {
193  if (!designModeBehavior())
194  return QObject::eventFilter(obj, event);
195 
196  switch (event->type()) {
197  case QEvent::Leave:
198  if (leaveEvent(event))
199  return true;
200  break;
202  if (mousePressEvent(static_cast<QMouseEvent*>(event)))
203  return true;
204  break;
205  case QEvent::MouseMove:
206  if (mouseMoveEvent(static_cast<QMouseEvent*>(event)))
207  return true;
208  break;
210  if (mouseReleaseEvent(static_cast<QMouseEvent*>(event)))
211  return true;
212  break;
213  case QEvent::KeyPress:
214  if (keyPressEvent(static_cast<QKeyEvent*>(event)))
215  return true;
216  break;
217  case QEvent::KeyRelease:
218  if (keyReleaseEvent(static_cast<QKeyEvent*>(event)))
219  return true;
220  break;
222  if (mouseDoubleClickEvent(static_cast<QMouseEvent*>(event)))
223  return true;
224  break;
225  case QEvent::Wheel:
226  if (wheelEvent(static_cast<QWheelEvent*>(event)))
227  return true;
228  break;
229  default:
230  break;
231  }
232 
233  return QObject::eventFilter(obj, event);
234 }
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
virtual bool keyReleaseEvent(QKeyEvent *keyEvent)
virtual bool mousePressEvent(QMouseEvent *event)
virtual bool mouseMoveEvent(QMouseEvent *event)
virtual bool keyPressEvent(QKeyEvent *event)
virtual bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
Definition: qobject.cpp:1375
virtual bool mouseDoubleClickEvent(QMouseEvent *event)
virtual bool wheelEvent(QWheelEvent *event)
virtual bool mouseReleaseEvent(QMouseEvent *event)

◆ handleMessage

void QmlJSDebugger::AbstractViewInspector::handleMessage ( const QByteArray message)
privateslot

Definition at line 309 of file abstractviewinspector.cpp.

Referenced by AbstractViewInspector(), and setCurrentTool().

310 {
311  QDataStream ds(message);
312 
314  ds >> type;
315 
316  switch (type) {
318  int itemCount = 0;
319  ds >> itemCount;
320 
321  QList<QObject*> selectedObjects;
322  for (int i = 0; i < itemCount; ++i) {
323  int debugId = -1;
324  ds >> debugId;
326  selectedObjects << obj;
327  }
328 
329  changeCurrentObjects(selectedObjects);
330  break;
331  }
333  reloadView();
334  break;
335  }
337  qreal speed;
338  ds >> speed;
340  break;
341  }
343  bool paused;
344  ds >> paused;
346  break;
347  }
350  ds >> tool;
351  changeTool(tool);
352  break;
353  }
355  bool inDesignMode;
356  ds >> inDesignMode;
357  setDesignModeBehavior(inDesignMode);
358  break;
359  }
361  bool showOnTop;
362  ds >> showOnTop;
363  setShowAppOnTop(showOnTop);
364  break;
365  }
367  QString qml;
368  int parentId;
369  QString filename;
370  QStringList imports;
371  ds >> qml >> parentId >> imports >> filename;
373  imports, filename);
374  break;
375  }
377  int debugId;
378  ds >> debugId;
380  obj->deleteLater();
381  break;
382  }
384  int debugId, newParent;
385  ds >> debugId >> newParent;
388  break;
389  }
391  int itemCount;
392  ds >> itemCount;
394  for (int i = 0; i < itemCount; ++i) {
395  int itemDebugId;
396  QString itemIdString;
397  ds >> itemDebugId
398  >> itemIdString;
399 
400  m_stringIdForObjectId.insert(itemDebugId, itemIdString);
401  }
402  break;
403  }
406  break;
407  }
408  default:
409  qWarning() << "Warning: Not handling message:" << type;
410  }
411 }
int type
Definition: qmetatype.cpp:239
double qreal
Definition: qglobal.h:1193
static QObject * objectForId(int)
Returns the object for unique id.
void clear()
Removes all items from the hash.
Definition: qhash.h:574
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
virtual void reparentQmlObject(QObject *object, QObject *newParent)=0
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
void createQmlObject(const QString &qml, QObject *parent, const QStringList &importList, const QString &filename=QString())
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
Q_CORE_EXPORT void qWarning(const char *,...)
virtual void changeCurrentObjects(const QList< QObject *> &objects)=0
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71
virtual void changeTool(InspectorProtocol::Tool tool)=0
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ idStringForObject()

QString QmlJSDebugger::AbstractViewInspector::idStringForObject ( QObject obj) const

Definition at line 504 of file abstractviewinspector.cpp.

Referenced by slowDownFactor(), and QmlJSDebugger::AbstractLiveEditTool::titleForItem().

505 {
506  const int id = QDeclarativeDebugService::idForObject(obj);
507  return m_stringIdForObjectId.value(id);
508 }
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
static int idForObject(QObject *)
Returns a unique id for object.

◆ keyPressEvent()

bool QmlJSDebugger::AbstractViewInspector::keyPressEvent ( QKeyEvent event)
protectedvirtual

Definition at line 264 of file abstractviewinspector.cpp.

Referenced by eventFilter(), and slowDownFactor().

265 {
267  return true;
268 }
virtual void keyPressEvent(QKeyEvent *event)=0

◆ keyReleaseEvent()

bool QmlJSDebugger::AbstractViewInspector::keyReleaseEvent ( QKeyEvent keyEvent)
protectedvirtual

Definition at line 270 of file abstractviewinspector.cpp.

Referenced by eventFilter(), and slowDownFactor().

271 {
272  switch (event->key()) {
273  case Qt::Key_V:
275  break;
276 // disabled because multiselection does not do anything useful without design mode
277 // case Qt::Key_M:
278 // changeTool(InspectorProtocol::SelectMarqueeTool);
279 // break;
280  case Qt::Key_I:
282  break;
283  case Qt::Key_Z:
285  break;
286  case Qt::Key_Space:
288  break;
289  default:
290  break;
291  }
292 
294  return true;
295 }
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
virtual void changeTool(InspectorProtocol::Tool tool)=0
virtual void keyReleaseEvent(QKeyEvent *keyEvent)=0

◆ leaveEvent()

bool QmlJSDebugger::AbstractViewInspector::leaveEvent ( QEvent event)
protectedvirtual

Reimplemented in QmlJSDebugger::QDeclarativeViewInspector.

Definition at line 236 of file abstractviewinspector.cpp.

Referenced by eventFilter(), QmlJSDebugger::QDeclarativeViewInspector::leaveEvent(), and slowDownFactor().

237 {
238  m_currentTool->leaveEvent(event);
239  return true;
240 }
virtual void leaveEvent(QEvent *event)=0

◆ marqueeSelectToolActivated

void QmlJSDebugger::AbstractViewInspector::marqueeSelectToolActivated ( )
signal

Referenced by slowDownFactor().

◆ mouseDoubleClickEvent()

bool QmlJSDebugger::AbstractViewInspector::mouseDoubleClickEvent ( QMouseEvent event)
protectedvirtual

Definition at line 297 of file abstractviewinspector.cpp.

Referenced by eventFilter(), and slowDownFactor().

298 {
300  return true;
301 }
virtual void mouseDoubleClickEvent(QMouseEvent *event)=0

◆ mouseMoveEvent()

bool QmlJSDebugger::AbstractViewInspector::mouseMoveEvent ( QMouseEvent event)
protectedvirtual

Reimplemented in QmlJSDebugger::QDeclarativeViewInspector.

Definition at line 248 of file abstractviewinspector.cpp.

Referenced by eventFilter(), QmlJSDebugger::QDeclarativeViewInspector::mouseMoveEvent(), and slowDownFactor().

249 {
250  if (event->buttons()) {
252  } else {
254  }
255  return true;
256 }
virtual void mouseMoveEvent(QMouseEvent *event)=0
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
Definition: qevent.h:102
virtual void hoverMoveEvent(QMouseEvent *event)=0

◆ mousePressEvent()

bool QmlJSDebugger::AbstractViewInspector::mousePressEvent ( QMouseEvent event)
protectedvirtual

Definition at line 242 of file abstractviewinspector.cpp.

Referenced by eventFilter(), and slowDownFactor().

243 {
245  return true;
246 }
virtual void mousePressEvent(QMouseEvent *event)=0

◆ mouseReleaseEvent()

bool QmlJSDebugger::AbstractViewInspector::mouseReleaseEvent ( QMouseEvent event)
protectedvirtual

Definition at line 258 of file abstractviewinspector.cpp.

Referenced by eventFilter(), and slowDownFactor().

259 {
261  return true;
262 }
virtual void mouseReleaseEvent(QMouseEvent *event)=0

◆ reloadRequested

void QmlJSDebugger::AbstractViewInspector::reloadRequested ( )
signal

◆ reloadView()

virtual void QmlJSDebugger::AbstractViewInspector::reloadView ( )
pure virtual

◆ reparentQmlObject()

virtual void QmlJSDebugger::AbstractViewInspector::reparentQmlObject ( QObject object,
QObject newParent 
)
pure virtual

◆ selectedColorChanged

void QmlJSDebugger::AbstractViewInspector::selectedColorChanged ( const QColor color)
signal

◆ selectToolActivated

void QmlJSDebugger::AbstractViewInspector::selectToolActivated ( )
signal

Referenced by slowDownFactor().

◆ sendAnimationPaused()

void QmlJSDebugger::AbstractViewInspector::sendAnimationPaused ( bool  paused)

Definition at line 462 of file abstractviewinspector.cpp.

Referenced by setAnimationPaused(), and slowDownFactor().

463 {
464  QByteArray message;
465  QDataStream ds(&message, QIODevice::WriteOnly);
466 
468  << paused;
469 
470  m_debugService->sendMessage(message);
471 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void sendMessage(const QByteArray &message)
QDeclarativeInspectorService * m_debugService
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ sendAnimationSpeed()

void QmlJSDebugger::AbstractViewInspector::sendAnimationSpeed ( qreal  slowDownFactor)

Definition at line 451 of file abstractviewinspector.cpp.

Referenced by setAnimationSpeed(), and slowDownFactor().

452 {
453  QByteArray message;
454  QDataStream ds(&message, QIODevice::WriteOnly);
455 
457  << slowDownFactor;
458 
459  m_debugService->sendMessage(message);
460 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void sendMessage(const QByteArray &message)
QDeclarativeInspectorService * m_debugService
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ sendColorChanged

void QmlJSDebugger::AbstractViewInspector::sendColorChanged ( const QColor color)
slot

Definition at line 493 of file abstractviewinspector.cpp.

Referenced by QmlJSDebugger::QDeclarativeViewInspector::QDeclarativeViewInspector(), and slowDownFactor().

494 {
495  QByteArray message;
496  QDataStream ds(&message, QIODevice::WriteOnly);
497 
499  << color;
500 
501  m_debugService->sendMessage(message);
502 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void sendMessage(const QByteArray &message)
QDeclarativeInspectorService * m_debugService
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ sendCurrentObjects()

void QmlJSDebugger::AbstractViewInspector::sendCurrentObjects ( const QList< QObject *> &  objects)

Definition at line 424 of file abstractviewinspector.cpp.

Referenced by slowDownFactor().

425 {
426  QByteArray message;
427  QDataStream ds(&message, QIODevice::WriteOnly);
428 
430  << objects.length();
431 
432  foreach (QObject *object, objects) {
433  int id = QDeclarativeDebugService::idForObject(object);
434  ds << id;
435  }
436 
437  m_debugService->sendMessage(message);
438 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void sendMessage(const QByteArray &message)
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
QDeclarativeInspectorService * m_debugService
static int idForObject(QObject *)
Returns a unique id for object.
int length() const
This function is identical to count().
Definition: qlist.h:281
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ sendCurrentTool()

void QmlJSDebugger::AbstractViewInspector::sendCurrentTool ( Constants::DesignTool  toolId)

Definition at line 440 of file abstractviewinspector.cpp.

Referenced by slowDownFactor().

441 {
442  QByteArray message;
443  QDataStream ds(&message, QIODevice::WriteOnly);
444 
446  << toolId;
447 
448  m_debugService->sendMessage(message);
449 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void sendMessage(const QByteArray &message)
QDeclarativeInspectorService * m_debugService
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ sendDesignModeBehavior

void QmlJSDebugger::AbstractViewInspector::sendDesignModeBehavior ( bool  inDesignMode)
slot

Definition at line 413 of file abstractviewinspector.cpp.

Referenced by setDesignModeBehavior(), and slowDownFactor().

414 {
415  QByteArray message;
416  QDataStream ds(&message, QIODevice::WriteOnly);
417 
419  << inDesignMode;
420 
421  m_debugService->sendMessage(message);
422 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void sendMessage(const QByteArray &message)
QDeclarativeInspectorService * m_debugService
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ sendReloaded()

void QmlJSDebugger::AbstractViewInspector::sendReloaded ( )

Definition at line 473 of file abstractviewinspector.cpp.

Referenced by slowDownFactor().

474 {
475  QByteArray message;
476  QDataStream ds(&message, QIODevice::WriteOnly);
477 
479 
480  m_debugService->sendMessage(message);
481 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void sendMessage(const QByteArray &message)
QDeclarativeInspectorService * m_debugService
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ sendShowAppOnTop()

void QmlJSDebugger::AbstractViewInspector::sendShowAppOnTop ( bool  showAppOnTop)

Definition at line 483 of file abstractviewinspector.cpp.

Referenced by setShowAppOnTop(), and slowDownFactor().

484 {
485  QByteArray message;
486  QDataStream ds(&message, QIODevice::WriteOnly);
487 
489 
490  m_debugService->sendMessage(message);
491 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void sendMessage(const QByteArray &message)
QDeclarativeInspectorService * m_debugService
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ setAnimationPaused

void QmlJSDebugger::AbstractViewInspector::setAnimationPaused ( bool  paused)
slot

Definition at line 120 of file abstractviewinspector.cpp.

Referenced by keyReleaseEvent(), and slowDownFactor().

121 {
122  if (m_animationPaused == paused)
123  return;
124 
126  sendAnimationPaused(paused);
127 }

◆ setAnimationSpeed

void QmlJSDebugger::AbstractViewInspector::setAnimationSpeed ( qreal  factor)
slot

Definition at line 110 of file abstractviewinspector.cpp.

Referenced by slowDownFactor().

◆ setCurrentTool()

void QmlJSDebugger::AbstractViewInspector::setCurrentTool ( AbstractTool tool)
inlineprotected

◆ setDesignModeBehavior

void QmlJSDebugger::AbstractViewInspector::setDesignModeBehavior ( bool  value)
virtualslot

Definition at line 100 of file abstractviewinspector.cpp.

Referenced by handleMessage(), and slowDownFactor().

101 {
102  if (m_designModeBehavior == value)
103  return;
104 
105  m_designModeBehavior = value;
107  sendDesignModeBehavior(value);
108 }
#define emit
Definition: qobjectdefs.h:76
void designModeBehaviorChanged(bool inDesignMode)

◆ setShowAppOnTop

void QmlJSDebugger::AbstractViewInspector::setShowAppOnTop ( bool  appOnTop)
slot

Definition at line 151 of file abstractviewinspector.cpp.

Referenced by handleMessage(), and slowDownFactor().

152 {
153  if (viewWidget()) {
155  Qt::WindowFlags flags = window->windowFlags();
156  if (appOnTop)
157  flags |= Qt::WindowStaysOnTopHint;
158  else
159  flags &= ~Qt::WindowStaysOnTopHint;
160 
161  window->setWindowFlags(flags);
162  window->show();
163  }
164 
165  m_showAppOnTop = appOnTop;
166  sendShowAppOnTop(appOnTop);
167 
168  emit showAppOnTopChanged(appOnTop);
169 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
NSWindow * window
#define emit
Definition: qobjectdefs.h:76
void setWindowFlags(Qt::WindowFlags type)
Definition: qwidget.cpp:10399
virtual QWidget * viewWidget() const =0
void show()
Shows the widget and its child widgets.
Definition: qnamespace.h:54
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
void showAppOnTopChanged(bool showAppOnTop)
Qt::WindowFlags windowFlags() const
Window flags are a combination of a type (e.
Definition: qwidget.h:939

◆ showAppOnTop()

bool QmlJSDebugger::AbstractViewInspector::showAppOnTop ( ) const
inline

◆ showAppOnTopChanged

void QmlJSDebugger::AbstractViewInspector::showAppOnTopChanged ( bool  showAppOnTop)
signal

Referenced by setShowAppOnTop(), and slowDownFactor().

◆ slowDownFactor()

qreal QmlJSDebugger::AbstractViewInspector::slowDownFactor ( ) const
inline

Definition at line 97 of file abstractviewinspector.h.

Referenced by sendAnimationSpeed().

◆ viewWidget()

virtual QWidget* QmlJSDebugger::AbstractViewInspector::viewWidget ( ) const
pure virtual

◆ wheelEvent()

bool QmlJSDebugger::AbstractViewInspector::wheelEvent ( QWheelEvent event)
protectedvirtual

Definition at line 303 of file abstractviewinspector.cpp.

Referenced by eventFilter(), and slowDownFactor().

304 {
305  m_currentTool->wheelEvent(event);
306  return true;
307 }
virtual void wheelEvent(QWheelEvent *event)=0

◆ zoomToolActivated

void QmlJSDebugger::AbstractViewInspector::zoomToolActivated ( )
signal

Referenced by slowDownFactor().

Properties

◆ m_animationPaused

bool QmlJSDebugger::AbstractViewInspector::m_animationPaused
private

◆ m_currentTool

AbstractTool* QmlJSDebugger::AbstractViewInspector::m_currentTool
private

◆ m_debugService

QDeclarativeInspectorService* QmlJSDebugger::AbstractViewInspector::m_debugService
private

◆ m_designModeBehavior

bool QmlJSDebugger::AbstractViewInspector::m_designModeBehavior
private

Definition at line 162 of file abstractviewinspector.h.

Referenced by designModeBehavior(), and setDesignModeBehavior().

◆ m_showAppOnTop

bool QmlJSDebugger::AbstractViewInspector::m_showAppOnTop
private

Definition at line 161 of file abstractviewinspector.h.

Referenced by setShowAppOnTop(), and showAppOnTop().

◆ m_slowDownFactor

qreal QmlJSDebugger::AbstractViewInspector::m_slowDownFactor
private

◆ m_stringIdForObjectId

QHash<int, QString> QmlJSDebugger::AbstractViewInspector::m_stringIdForObjectId
private

Definition at line 167 of file abstractviewinspector.h.

Referenced by handleMessage(), and idStringForObject().


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