summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.cpp2
-rw-r--r--share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.cpp12
-rw-r--r--share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.cpp2
-rw-r--r--share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp16
-rw-r--r--share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.cpp2
-rw-r--r--share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp48
-rw-r--r--share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.h6
-rw-r--r--share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.cpp2
-rw-r--r--share/qtcreator/qml/qmljsdebugger/editor/zoomtool.cpp4
-rw-r--r--share/qtcreator/qml/qmljsdebugger/include/qdeclarativeviewobserver.h2
-rw-r--r--share/qtcreator/qml/qmljsdebugger/qdeclarativeobserverservice.cpp6
-rw-r--r--share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp120
-rw-r--r--share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h4
-rw-r--r--src/plugins/qt4projectmanager/qtversionmanager.h3
14 files changed, 106 insertions, 123 deletions
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.cpp
index 037af0d07b..c742d04cd9 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.cpp
@@ -151,7 +151,7 @@ QList<QGraphicsObject*> AbstractLiveEditTool::toGraphicsObjectList(const QList<Q
&itemList)
{
QList<QGraphicsObject*> gfxObjects;
- foreach(QGraphicsItem *item, itemList) {
+ foreach (QGraphicsItem *item, itemList) {
QGraphicsObject *obj = item->toGraphicsObject();
if (obj)
gfxObjects << obj;
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.cpp b/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.cpp
index cc01ddd327..a812537ce9 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.cpp
@@ -106,7 +106,7 @@ void BoundingRectHighlighter::animTimeout()
qreal alpha = m_animFrame / float(AnimFrames);
- foreach(BoundingBox *box, m_boxes) {
+ foreach (BoundingBox *box, m_boxes) {
box->highlightPolygonEdge->setOpacity(alpha);
}
}
@@ -116,7 +116,7 @@ void BoundingRectHighlighter::clear()
if (m_boxes.length()) {
m_animTimer->stop();
- foreach(BoundingBox *box, m_boxes) {
+ foreach (BoundingBox *box, m_boxes) {
freeBoundingBox(box);
}
}
@@ -124,7 +124,7 @@ void BoundingRectHighlighter::clear()
BoundingBox *BoundingRectHighlighter::boxFor(QGraphicsObject *item) const
{
- foreach(BoundingBox *box, m_boxes) {
+ foreach (BoundingBox *box, m_boxes) {
if (box->highlightedObject.data() == item) {
return box;
}
@@ -140,7 +140,7 @@ void BoundingRectHighlighter::highlight(QList<QGraphicsObject*> items)
bool animate = false;
QList<BoundingBox *> newBoxes;
- foreach(QGraphicsObject *itemToHighlight, items) {
+ foreach (QGraphicsObject *itemToHighlight, items) {
BoundingBox *box = boxFor(itemToHighlight);
if (!box) {
box = createBoundingBox(itemToHighlight);
@@ -227,7 +227,7 @@ void BoundingRectHighlighter::freeBoundingBox(BoundingBox *box)
void BoundingRectHighlighter::itemDestroyed(QObject *obj)
{
- foreach(BoundingBox *box, m_boxes) {
+ foreach (BoundingBox *box, m_boxes) {
if (box->highlightedObject.data() == obj) {
freeBoundingBox(box);
break;
@@ -237,7 +237,7 @@ void BoundingRectHighlighter::itemDestroyed(QObject *obj)
void BoundingRectHighlighter::highlightAll(bool animate)
{
- foreach(BoundingBox *box, m_boxes) {
+ foreach (BoundingBox *box, m_boxes) {
if (box && box->highlightedObject.isNull()) {
// clear all highlights
clear();
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.cpp b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.cpp
index 11936ed9f1..d0ceb3d94d 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.cpp
@@ -93,7 +93,7 @@ QPolygonF LiveSelectionIndicator::addBoundingRectToPolygon(QGraphicsItem *item,
polygon = polygon.united(bounding);
}
- foreach(QGraphicsItem *child, item->childItems()) {
+ foreach (QGraphicsItem *child, item->childItems()) {
if (!QDeclarativeViewObserverPrivate::get(m_view)->isEditorItem(child))
addBoundingRectToPolygon(child, polygon);
}
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp
index cad84b07f0..d1816223c6 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp
@@ -96,11 +96,9 @@ bool LiveSelectionTool::alreadySelected(const QList<QGraphicsItem*> &itemList) c
if (selectedItems.isEmpty())
return false;
- foreach(QGraphicsItem *item, itemList) {
- if (selectedItems.contains(item)) {
+ foreach (QGraphicsItem *item, itemList)
+ if (selectedItems.contains(item))
return true;
- }
- }
return false;
}
@@ -143,7 +141,7 @@ void LiveSelectionTool::createContextMenu(QList<QGraphicsItem*> itemList, QPoint
bool addKeySequence = true;
int i = 0;
- foreach(QGraphicsItem * const item, itemList) {
+ foreach (QGraphicsItem * const item, itemList) {
QString itemTitle = titleForItem(item);
QAction *elementAction = contextMenu.addAction(itemTitle, this,
SLOT(contextMenuElementSelected()));
@@ -237,7 +235,7 @@ void LiveSelectionTool::hoverMoveEvent(QMouseEvent * event)
// QList<QGraphicsItem*> itemList = view()->items(event->pos());
// if (!itemList.isEmpty() && !m_rubberbandSelectionMode) {
//
-// foreach(QGraphicsItem *item, itemList) {
+// foreach (QGraphicsItem *item, itemList) {
// if (item->type() == Constants::ResizeHandleItemType) {
// ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(item);
// if (resizeHandle)
@@ -305,7 +303,6 @@ void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event)
void LiveSelectionTool::mouseDoubleClickEvent(QMouseEvent * /*event*/)
{
-
}
void LiveSelectionTool::keyPressEvent(QKeyEvent *event)
@@ -373,7 +370,6 @@ void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems)
void LiveSelectionTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/)
{
-
}
void LiveSelectionTool::clear()
@@ -387,7 +383,7 @@ void LiveSelectionTool::clear()
void LiveSelectionTool::selectedItemsChanged(const QList<QGraphicsItem*> &itemList)
{
- foreach(QWeakPointer<QGraphicsObject> obj, m_selectedItemList) {
+ foreach (QWeakPointer<QGraphicsObject> obj, m_selectedItemList) {
if (!obj.isNull()) {
disconnect(obj.data(), SIGNAL(xChanged()), this, SLOT(repaintBoundingRects()));
disconnect(obj.data(), SIGNAL(yChanged()), this, SLOT(repaintBoundingRects()));
@@ -400,7 +396,7 @@ void LiveSelectionTool::selectedItemsChanged(const QList<QGraphicsItem*> &itemLi
QList<QGraphicsObject*> objects = toGraphicsObjectList(itemList);
m_selectedItemList.clear();
- foreach(QGraphicsObject *obj, objects) {
+ foreach (QGraphicsObject *obj, objects) {
m_selectedItemList.append(obj);
connect(obj, SIGNAL(xChanged()), this, SLOT(repaintBoundingRects()));
connect(obj, SIGNAL(yChanged()), this, SLOT(repaintBoundingRects()));
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.cpp b/share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.cpp
index 12825902a1..5251de7fab 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.cpp
@@ -76,7 +76,7 @@ void LiveSingleSelectionManipulator::select(SelectionType selectionType,
{
QGraphicsItem *selectedItem = 0;
- foreach(QGraphicsItem* item, items)
+ foreach (QGraphicsItem* item, items)
{
//FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
if (item
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp
index bcc6673431..77940e9e9f 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp
@@ -43,7 +43,7 @@
namespace QmlJSDebugger {
-QmlToolbar::QmlToolbar(QWidget *parent)
+QmlToolBar::QmlToolBar(QWidget *parent)
: QToolBar(parent)
, m_emitSignals(true)
, m_isRunning(false)
@@ -150,40 +150,40 @@ QmlToolbar::QmlToolbar(QWidget *parent)
connect(ui->fromQml, SIGNAL(triggered()), SLOT(activateFromQml()));
}
-QmlToolbar::~QmlToolbar()
+QmlToolBar::~QmlToolBar()
{
delete ui;
}
-void QmlToolbar::activateColorPicker()
+void QmlToolBar::activateColorPicker()
{
m_emitSignals = false;
activateColorPickerOnClick();
m_emitSignals = true;
}
-void QmlToolbar::activateSelectTool()
+void QmlToolBar::activateSelectTool()
{
m_emitSignals = false;
activateSelectToolOnClick();
m_emitSignals = true;
}
-void QmlToolbar::activateMarqueeSelectTool()
+void QmlToolBar::activateMarqueeSelectTool()
{
m_emitSignals = false;
activateMarqueeSelectToolOnClick();
m_emitSignals = true;
}
-void QmlToolbar::activateZoom()
+void QmlToolBar::activateZoom()
{
m_emitSignals = false;
activateZoomOnClick();
m_emitSignals = true;
}
-void QmlToolbar::setAnimationSpeed(qreal slowdownFactor)
+void QmlToolBar::setAnimationSpeed(qreal slowdownFactor)
{
m_emitSignals = false;
if (slowdownFactor != 0) {
@@ -209,38 +209,38 @@ void QmlToolbar::setAnimationSpeed(qreal slowdownFactor)
m_emitSignals = true;
}
-void QmlToolbar::changeToDefaultAnimSpeed()
+void QmlToolBar::changeToDefaultAnimSpeed()
{
m_animationSpeed = 1.0f;
updatePlayAction();
}
-void QmlToolbar::changeToHalfAnimSpeed()
+void QmlToolBar::changeToHalfAnimSpeed()
{
m_animationSpeed = 2.0f;
updatePlayAction();
}
-void QmlToolbar::changeToFourthAnimSpeed()
+void QmlToolBar::changeToFourthAnimSpeed()
{
m_animationSpeed = 4.0f;
updatePlayAction();
}
-void QmlToolbar::changeToEighthAnimSpeed()
+void QmlToolBar::changeToEighthAnimSpeed()
{
m_animationSpeed = 8.0f;
updatePlayAction();
}
-void QmlToolbar::changeToTenthAnimSpeed()
+void QmlToolBar::changeToTenthAnimSpeed()
{
m_animationSpeed = 10.0f;
updatePlayAction();
}
-void QmlToolbar::setDesignModeBehavior(bool inDesignMode)
+void QmlToolBar::setDesignModeBehavior(bool inDesignMode)
{
m_emitSignals = false;
ui->designmode->setChecked(inDesignMode);
@@ -248,7 +248,7 @@ void QmlToolbar::setDesignModeBehavior(bool inDesignMode)
m_emitSignals = true;
}
-void QmlToolbar::setDesignModeBehaviorOnClick(bool checked)
+void QmlToolBar::setDesignModeBehaviorOnClick(bool checked)
{
ui->play->setEnabled(checked);
ui->select->setEnabled(checked);
@@ -262,12 +262,12 @@ void QmlToolbar::setDesignModeBehaviorOnClick(bool checked)
emit designModeBehaviorChanged(checked);
}
-void QmlToolbar::setColorBoxColor(const QColor &color)
+void QmlToolBar::setColorBoxColor(const QColor &color)
{
ui->colorBox->setColor(color);
}
-void QmlToolbar::activatePlayOnClick()
+void QmlToolBar::activatePlayOnClick()
{
if (m_isRunning) {
updatePauseAction();
@@ -276,7 +276,7 @@ void QmlToolbar::activatePlayOnClick()
}
}
-void QmlToolbar::updatePlayAction()
+void QmlToolBar::updatePlayAction()
{
m_isRunning = true;
ui->play->setIcon(ui->pauseIcon);
@@ -287,7 +287,7 @@ void QmlToolbar::updatePlayAction()
emit animationSpeedChanged(m_animationSpeed);
}
-void QmlToolbar::updatePauseAction()
+void QmlToolBar::updatePauseAction()
{
m_isRunning = false;
ui->play->setIcon(ui->playIcon);
@@ -295,7 +295,7 @@ void QmlToolbar::updatePauseAction()
emit animationSpeedChanged(0.0f);
}
-void QmlToolbar::activateColorPickerOnClick()
+void QmlToolBar::activateColorPickerOnClick()
{
ui->zoom->setChecked(false);
ui->select->setChecked(false);
@@ -309,7 +309,7 @@ void QmlToolbar::activateColorPickerOnClick()
}
}
-void QmlToolbar::activateSelectToolOnClick()
+void QmlToolBar::activateSelectToolOnClick()
{
ui->zoom->setChecked(false);
ui->selectMarquee->setChecked(false);
@@ -323,7 +323,7 @@ void QmlToolbar::activateSelectToolOnClick()
}
}
-void QmlToolbar::activateMarqueeSelectToolOnClick()
+void QmlToolBar::activateMarqueeSelectToolOnClick()
{
ui->zoom->setChecked(false);
ui->select->setChecked(false);
@@ -337,7 +337,7 @@ void QmlToolbar::activateMarqueeSelectToolOnClick()
}
}
-void QmlToolbar::activateZoomOnClick()
+void QmlToolBar::activateZoomOnClick()
{
ui->select->setChecked(false);
ui->selectMarquee->setChecked(false);
@@ -351,13 +351,13 @@ void QmlToolbar::activateZoomOnClick()
}
}
-void QmlToolbar::activateFromQml()
+void QmlToolBar::activateFromQml()
{
if (m_emitSignals)
emit applyChangesFromQmlFileSelected();
}
-void QmlToolbar::activateToQml()
+void QmlToolBar::activateToQml()
{
if (m_emitSignals)
emit applyChangesToQmlFileSelected();
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.h b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.h
index b06a812779..2eecc586e8 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.h
+++ b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.h
@@ -43,13 +43,13 @@ namespace QmlJSDebugger {
class ToolBarColorBox;
-class QmlToolbar : public QToolBar
+class QmlToolBar : public QToolBar
{
Q_OBJECT
public:
- explicit QmlToolbar(QWidget *parent = 0);
- ~QmlToolbar();
+ explicit QmlToolBar(QWidget *parent = 0);
+ ~QmlToolBar();
public slots:
void setDesignModeBehavior(bool inDesignMode);
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.cpp
index 45a482348f..e4fdc79113 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.cpp
@@ -182,7 +182,7 @@ void SubcomponentEditorTool::setCurrentItem(QGraphicsItem* contextItem)
//if (parentClassName.contains(QRegExp("_QMLTYPE_\\d+")))
bool containsSelectableItems = false;
- foreach(QGraphicsItem *item, gfxObject->childItems()) {
+ foreach (QGraphicsItem *item, gfxObject->childItems()) {
if (item->type() == Constants::EditorItemType
|| item->type() == Constants::ResizeHandleItemType)
{
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.cpp
index 67afa81371..10b05a2c4d 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.cpp
@@ -310,12 +310,12 @@ qreal ZoomTool::nextZoomScale(ZoomDirection direction) const
<< 48.0f;
if (direction == ZoomIn) {
- for(int i = 0; i < zoomScales.length(); ++i) {
+ for (int i = 0; i < zoomScales.length(); ++i) {
if (zoomScales[i] > m_currentScale || i == zoomScales.length() - 1)
return zoomScales[i];
}
} else {
- for(int i = zoomScales.length() - 1; i >= 0; --i) {
+ for (int i = zoomScales.length() - 1; i >= 0; --i) {
if (zoomScales[i] < m_currentScale || i == 0)
return zoomScales[i];
}
diff --git a/share/qtcreator/qml/qmljsdebugger/include/qdeclarativeviewobserver.h b/share/qtcreator/qml/qmljsdebugger/include/qdeclarativeviewobserver.h
index e086f512fc..de502948b4 100644
--- a/share/qtcreator/qml/qmljsdebugger/include/qdeclarativeviewobserver.h
+++ b/share/qtcreator/qml/qmljsdebugger/include/qdeclarativeviewobserver.h
@@ -62,7 +62,7 @@ public:
QDeclarativeView *declarativeView();
- QToolBar *toolbar() const;
+ QToolBar *toolBar() const;
static QString idStringForObject(QObject *obj);
QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
diff --git a/share/qtcreator/qml/qmljsdebugger/qdeclarativeobserverservice.cpp b/share/qtcreator/qml/qmljsdebugger/qdeclarativeobserverservice.cpp
index 28dd86bc59..2c93bfa806 100644
--- a/share/qtcreator/qml/qmljsdebugger/qdeclarativeobserverservice.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/qdeclarativeobserverservice.cpp
@@ -77,7 +77,7 @@ void QDeclarativeObserverService::messageReceived(const QByteArray &message)
ds >> itemCount;
QList<QObject*> selectedObjects;
- for(int i = 0; i < itemCount; ++i) {
+ for (int i = 0; i < itemCount; ++i) {
int debugId = -1;
ds >> debugId;
QObject *obj = objectForId(debugId);
@@ -134,7 +134,7 @@ void QDeclarativeObserverService::messageReceived(const QByteArray &message)
int itemCount;
ds >> itemCount;
m_stringIdForObjectId.clear();
- for(int i = 0; i < itemCount; ++i) {
+ for (int i = 0; i < itemCount; ++i) {
int itemDebugId;
QString itemIdString;
ds >> itemDebugId
@@ -170,7 +170,7 @@ void QDeclarativeObserverService::setCurrentObjects(QList<QObject*> objects)
ds << QByteArray("CURRENT_OBJECTS_CHANGED")
<< objects.length();
- foreach(QObject *object, objects) {
+ foreach (QObject *object, objects) {
int id = idForObject(object);
ds << id;
}
diff --git a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp
index 8f489f6be8..934706b440 100644
--- a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp
@@ -65,7 +65,7 @@ QDeclarativeViewObserverPrivate::QDeclarativeViewObserverPrivate(QDeclarativeVie
showAppOnTop(false),
executionPaused(false),
slowdownFactor(1.0f),
- toolbar(0)
+ toolBar(0)
{
}
@@ -145,9 +145,8 @@ void QDeclarativeViewObserver::setObserverContext(int contextIndex)
{
if (data->subcomponentEditorTool->contextIndex() != contextIndex) {
QGraphicsObject *object = data->subcomponentEditorTool->setContext(contextIndex);
- if (object) {
+ if (object)
setSelectedItems(QList<QGraphicsItem*>() << object);
- }
}
}
@@ -163,9 +162,9 @@ void QDeclarativeViewObserverPrivate::setViewport(QWidget *widget)
if (viewport.data() == widget)
return;
- if (viewport) {
+ if (viewport)
viewport.data()->removeEventFilter(q);
- }
+
viewport = widget;
if (viewport) {
// make sure we get mouse move events
@@ -192,7 +191,7 @@ bool QDeclarativeViewObserver::eventFilter(QObject *obj, QEvent *event)
return QObject::eventFilter(obj, event);
}
- //Event from viewport
+ // Event from viewport
switch (event->type()) {
case QEvent::Leave: {
if (leaveEvent(event))
@@ -297,18 +296,17 @@ bool QDeclarativeViewObserver::mouseReleaseEvent(QMouseEvent *event)
bool QDeclarativeViewObserver::keyPressEvent(QKeyEvent *event)
{
- if (!data->designModeBehavior) {
+ if (!data->designModeBehavior)
return false;
- }
+
data->currentTool->keyPressEvent(event);
return true;
}
bool QDeclarativeViewObserver::keyReleaseEvent(QKeyEvent *event)
{
- if (!data->designModeBehavior) {
+ if (!data->designModeBehavior)
return false;
- }
switch(event->key()) {
case Qt::Key_V:
@@ -352,7 +350,7 @@ void QDeclarativeViewObserverPrivate::_q_createQmlObject(const QString &qml, QOb
return;
QString imports;
- foreach(const QString &s, importList) {
+ foreach (const QString &s, importList) {
imports += s + "\n";
}
@@ -366,9 +364,8 @@ void QDeclarativeViewObserverPrivate::_q_createQmlObject(const QString &qml, QOb
newObject->setParent(parent);
QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent);
QDeclarativeItem *newItem = qobject_cast<QDeclarativeItem*>(newObject);
- if (parentItem && newItem) {
+ if (parentItem && newItem)
newItem->setParentItem(parentItem);
- }
}
}
@@ -380,9 +377,8 @@ void QDeclarativeViewObserverPrivate::_q_reparentQmlObject(QObject *object, QObj
object->setParent(newParent);
QDeclarativeItem *newParentItem = qobject_cast<QDeclarativeItem*>(newParent);
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(object);
- if (newParentItem && item) {
+ if (newParentItem && item)
item->setParentItem(newParentItem);
- }
}
void QDeclarativeViewObserverPrivate::_q_clearComponentCache()
@@ -393,9 +389,8 @@ void QDeclarativeViewObserverPrivate::_q_clearComponentCache()
void QDeclarativeViewObserverPrivate::_q_removeFromSelection(QObject *obj)
{
QList<QGraphicsItem*> items = selectedItems();
- if (QGraphicsItem *item = dynamic_cast<QGraphicsItem*>(obj)) {
+ if (QGraphicsItem *item = dynamic_cast<QGraphicsItem*>(obj))
items.removeOne(item);
- }
setSelectedItems(items);
}
@@ -430,10 +425,8 @@ bool QDeclarativeViewObserver::mouseDoubleClickEvent(QMouseEvent *event)
data->subcomponentEditorTool->mouseDoubleClickEvent(event);
if ((event->buttons() & Qt::LeftButton) && itemToEnter) {
- QGraphicsObject *objectToEnter = itemToEnter->toGraphicsObject();
- if (objectToEnter) {
+ if (QGraphicsObject *objectToEnter = itemToEnter->toGraphicsObject())
setSelectedItems(QList<QGraphicsItem*>() << objectToEnter);
- }
}
return true;
@@ -461,7 +454,7 @@ void QDeclarativeViewObserver::setDesignModeBehavior(bool value)
{
emit designModeBehaviorChanged(value);
- data->toolbar->setDesignModeBehavior(value);
+ data->toolBar->setDesignModeBehavior(value);
data->debugService->setDesignModeBehavior(value);
data->designModeBehavior = value;
@@ -495,11 +488,11 @@ void QDeclarativeViewObserver::setShowAppOnTop(bool appOnTop)
while (rootWidget->parentWidget())
rootWidget = rootWidget->parentWidget();
Qt::WindowFlags flags = rootWidget->windowFlags();
- if (appOnTop) {
+ if (appOnTop)
flags |= Qt::WindowStaysOnTopHint;
- } else {
+ else
flags &= ~Qt::WindowStaysOnTopHint;
- }
+
rootWidget->setWindowFlags(flags);
rootWidget->show();
}
@@ -538,8 +531,7 @@ void QDeclarativeViewObserverPrivate::setSelectedItemsForTools(QList<QGraphicsIt
foreach (QGraphicsItem *item, items) {
if (item) {
- QGraphicsObject *obj = item->toGraphicsObject();
- if (obj) {
+ if (QGraphicsObject *obj = item->toGraphicsObject()) {
QObject::connect(obj, SIGNAL(destroyed(QObject*)),
this, SLOT(_q_removeFromSelection(QObject*)));
currentSelection.append(obj);
@@ -568,7 +560,7 @@ void QDeclarativeViewObserverPrivate::setSelectedItems(QList<QGraphicsItem *> it
QList<QGraphicsItem *> QDeclarativeViewObserverPrivate::selectedItems()
{
QList<QGraphicsItem *> selection;
- foreach(const QWeakPointer<QGraphicsObject> &selectedObject, currentSelection) {
+ foreach (const QWeakPointer<QGraphicsObject> &selectedObject, currentSelection) {
if (selectedObject.data())
selection << selectedObject.data();
}
@@ -607,7 +599,7 @@ void QDeclarativeViewObserverPrivate::highlight(QList<QGraphicsObject *> items,
return;
QList<QGraphicsObject*> objectList;
- foreach(QGraphicsItem *item, items) {
+ foreach (QGraphicsItem *item, items) {
QGraphicsItem *child = item;
if (flags & ContextSensitive)
child = subcomponentEditorTool->firstChildOfContext(item);
@@ -714,11 +706,10 @@ void QDeclarativeViewObserver::changeAnimationSpeed(qreal slowdownFactor)
{
data->slowdownFactor = slowdownFactor;
- if (data->slowdownFactor != 0) {
+ if (data->slowdownFactor != 0)
continueExecution(data->slowdownFactor);
- } else {
+ else
pauseExecution();
- }
}
void QDeclarativeViewObserver::continueExecution(qreal slowdownFactor)
@@ -751,14 +742,13 @@ void QDeclarativeViewObserver::pauseExecution()
void QDeclarativeViewObserverPrivate::_q_applyChangesFromClient()
{
-
}
QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::filterForSelection(
QList<QGraphicsItem*> &itemlist) const
{
- foreach(QGraphicsItem *item, itemlist) {
+ foreach (QGraphicsItem *item, itemlist) {
if (isEditorItem(item) || !subcomponentEditorTool->isChildOfContext(item))
itemlist.removeOne(item);
}
@@ -769,7 +759,7 @@ QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::filterForSelection(
QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::filterForCurrentContext(
QList<QGraphicsItem*> &itemlist) const
{
- foreach(QGraphicsItem *item, itemlist) {
+ foreach (QGraphicsItem *item, itemlist) {
if (isEditorItem(item) || !subcomponentEditorTool->isDirectChildOfContext(item)) {
@@ -816,12 +806,11 @@ void QDeclarativeViewObserverPrivate::_q_onCurrentObjectsChanged(QList<QObject*>
{
QList<QGraphicsItem*> items;
QList<QGraphicsObject*> gfxObjects;
- foreach(QObject *obj, objects) {
+ foreach (QObject *obj, objects) {
QDeclarativeItem* declarativeItem = qobject_cast<QDeclarativeItem*>(obj);
if (declarativeItem) {
items << declarativeItem;
- QGraphicsObject *gfxObj = declarativeItem->toGraphicsObject();
- if (gfxObj)
+ if (QGraphicsObject *gfxObj = declarativeItem->toGraphicsObject())
gfxObjects << gfxObj;
}
}
@@ -842,71 +831,68 @@ QRectF QDeclarativeViewObserver::adjustToScreenBoundaries(const QRectF &bounding
{
int marginFromEdge = 1;
QRectF boundingRect(boundingRectInSceneSpace);
- if (qAbs(boundingRect.left()) - 1 < 2) {
+ if (qAbs(boundingRect.left()) - 1 < 2)
boundingRect.setLeft(marginFromEdge);
- }
QRect rect = data->view->rect();
- if (boundingRect.right() >= rect.right() ) {
+
+ if (boundingRect.right() >= rect.right())
boundingRect.setRight(rect.right() - marginFromEdge);
- }
- if (qAbs(boundingRect.top()) - 1 < 2) {
+ if (qAbs(boundingRect.top()) - 1 < 2)
boundingRect.setTop(marginFromEdge);
- }
- if (boundingRect.bottom() >= rect.bottom() ) {
+ if (boundingRect.bottom() >= rect.bottom())
boundingRect.setBottom(rect.bottom() - marginFromEdge);
- }
return boundingRect;
}
-QToolBar *QDeclarativeViewObserver::toolbar() const
+QToolBar *QDeclarativeViewObserver::toolBar() const
{
- return data->toolbar;
+ return data->toolBar;
}
void QDeclarativeViewObserverPrivate::createToolBox()
{
- toolbar = new QmlToolbar;
+ toolBar = new QmlToolBar;
QObject::connect(q, SIGNAL(selectedColorChanged(QColor)),
- toolbar, SLOT(setColorBoxColor(QColor)));
+ toolBar, SLOT(setColorBoxColor(QColor)));
QObject::connect(q, SIGNAL(designModeBehaviorChanged(bool)),
- toolbar, SLOT(setDesignModeBehavior(bool)));
+ toolBar, SLOT(setDesignModeBehavior(bool)));
- QObject::connect(toolbar, SIGNAL(designModeBehaviorChanged(bool)),
+ QObject::connect(toolBar, SIGNAL(designModeBehaviorChanged(bool)),
q, SLOT(setDesignModeBehavior(bool)));
- QObject::connect(toolbar, SIGNAL(animationSpeedChanged(qreal)),
+ QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)),
q, SLOT(changeAnimationSpeed(qreal)));
- QObject::connect(toolbar, SIGNAL(colorPickerSelected()), this, SLOT(_q_changeToColorPickerTool()));
- QObject::connect(toolbar, SIGNAL(zoomToolSelected()), this, SLOT(_q_changeToZoomTool()));
- QObject::connect(toolbar, SIGNAL(selectToolSelected()), this, SLOT(_q_changeToSingleSelectTool()));
- QObject::connect(toolbar, SIGNAL(marqueeSelectToolSelected()),
+ QObject::connect(toolBar, SIGNAL(colorPickerSelected()), this, SLOT(_q_changeToColorPickerTool()));
+ QObject::connect(toolBar, SIGNAL(zoomToolSelected()), this, SLOT(_q_changeToZoomTool()));
+ QObject::connect(toolBar, SIGNAL(selectToolSelected()), this, SLOT(_q_changeToSingleSelectTool()));
+ QObject::connect(toolBar, SIGNAL(marqueeSelectToolSelected()),
this, SLOT(_q_changeToMarqueeSelectTool()));
- QObject::connect(toolbar, SIGNAL(applyChangesFromQmlFileSelected()),
+ QObject::connect(toolBar, SIGNAL(applyChangesFromQmlFileSelected()),
this, SLOT(_q_applyChangesFromClient()));
- QObject::connect(q, SIGNAL(executionStarted(qreal)), toolbar, SLOT(setAnimationSpeed(qreal)));
- QObject::connect(q, SIGNAL(executionPaused()), toolbar, SLOT(setAnimationSpeed()));
+ QObject::connect(q, SIGNAL(executionStarted(qreal)), toolBar, SLOT(setAnimationSpeed(qreal)));
+ QObject::connect(q, SIGNAL(executionPaused()), toolBar, SLOT(setAnimationSpeed()));
- QObject::connect(q, SIGNAL(selectToolActivated()), toolbar, SLOT(activateSelectTool()));
+ QObject::connect(q, SIGNAL(selectToolActivated()), toolBar, SLOT(activateSelectTool()));
// disabled features
- //connect(d->m_toolbar, SIGNAL(applyChangesToQmlFileSelected()), SLOT(applyChangesToClient()));
- //connect(q, SIGNAL(resizeToolActivated()), d->m_toolbar, SLOT(activateSelectTool()));
- //connect(q, SIGNAL(moveToolActivated()), d->m_toolbar, SLOT(activateSelectTool()));
+ //connect(d->m_toolBar, SIGNAL(applyChangesToQmlFileSelected()), SLOT(applyChangesToClient()));
+ //connect(q, SIGNAL(resizeToolActivated()), d->m_toolBar, SLOT(activateSelectTool()));
+ //connect(q, SIGNAL(moveToolActivated()), d->m_toolBar, SLOT(activateSelectTool()));
- QObject::connect(q, SIGNAL(colorPickerActivated()), toolbar, SLOT(activateColorPicker()));
- QObject::connect(q, SIGNAL(zoomToolActivated()), toolbar, SLOT(activateZoom()));
+ QObject::connect(q, SIGNAL(colorPickerActivated()), toolBar, SLOT(activateColorPicker()));
+ QObject::connect(q, SIGNAL(zoomToolActivated()), toolBar, SLOT(activateZoom()));
QObject::connect(q, SIGNAL(marqueeSelectToolActivated()),
- toolbar, SLOT(activateMarqueeSelectTool()));
+ toolBar, SLOT(activateMarqueeSelectTool()));
QVBoxLayout *verticalLayout = new QVBoxLayout;
verticalLayout->setMargin(0);
- verticalLayout->addWidget(toolbar);
+ verticalLayout->addWidget(toolBar);
QWidget *toolBox = new QWidget(q->declarativeView(), Qt::Tool);
toolBox->setWindowFlags(toolBox->windowFlags() & ~Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint);
diff --git a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h
index 79b9064d30..a51039c0c5 100644
--- a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h
+++ b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h
@@ -50,7 +50,7 @@ class ColorPickerTool;
class LiveLayerItem;
class BoundingRectHighlighter;
class SubcomponentEditorTool;
-class QmlToolbar;
+class QmlToolBar;
class CrumblePath;
class AbstractLiveEditTool;
@@ -91,7 +91,7 @@ public:
bool executionPaused;
qreal slowdownFactor;
- QmlToolbar *toolbar;
+ QmlToolBar *toolBar;
void setViewport(QWidget *widget);
diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h
index aa6f896370..c79fe6ae19 100644
--- a/src/plugins/qt4projectmanager/qtversionmanager.h
+++ b/src/plugins/qt4projectmanager/qtversionmanager.h
@@ -313,7 +313,8 @@ private:
int getUniqueId();
void writeVersionsIntoSettings();
void addNewVersionsFromInstaller();
- void updateSystemVersion(); void updateDocumentation();
+ void updateSystemVersion();
+ void updateDocumentation();
static int indexOfVersionInList(const QtVersion * const version, const QList<QtVersion *> &list);
void updateUniqueIdToIndexMap();