Merge remote-tracking branch 'origin/2.2'

Conflicts:
	src/plugins/debugger/debuggersourcepathmappingwidget.cpp
This commit is contained in:
Oswald Buddenhagen
2011-03-23 14:42:31 +01:00
64 changed files with 928 additions and 1038 deletions

6
dist/changes-2.2.0 vendored
View File

@@ -12,6 +12,8 @@ General
* Moved toolchain definitions out of Qt versions.
* You can now define toolchains in Tools->Options->ToolChains
* Creator now supports more than one instance of each kind of toolchain
* Support for MIME type customization through editing of patterns and
magic matchers.
Editing
* Add new Inkpot color scheme
@@ -23,6 +25,8 @@ Editing
- code completion
* Add 'expand/collapse all' context menu entry to Outline pane
* Support for user defined macros was contributed by Nicolas Arnaud-Cormos
* Snippet editor with syntax highlighting, indentation, and basic auto
completion for C++ and QML.
Project Support
* QMake project support should be more robust against syntax errors
@@ -36,6 +40,7 @@ Project Support
* CMake: Add Ui completion, changes in .ui files are picked up without
a rebuild.
* Syntax highlighting and completion for QMake project files
* Text editor behavior settings now avaiable on a per-project basis.
Debugging
* Rewrote debugging engine using the Microsoft Console Debugger (CDB)
@@ -89,7 +94,6 @@ C++ Support
* Fix indentation of labels
* Highlighting for virtual functions
* Navigate to correct overloaded function/method
* Snippets for class/struct/loops
QML/JS Support
* Add wizard for creating JavaScript files, QTCREATORBUG-3070

View File

@@ -977,7 +977,7 @@
Otherwise, instantiate a QDataStream object, \c in, set its version as
above and read the serialized data into hte \c contacts data structure. The
\c contacs object is emptied before data is read into it to simplify the
\c contacts object is emptied before data is read into it to simplify the
file reading process. A more advanced method would be to read the contacts
into a temporary QMap object, and copy over non-duplicate contacts into
\c contacts.

View File

@@ -7266,7 +7266,7 @@
\l{http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx}
or
\l{http://www.microsoft.com/whdc/devtools/debugging/install64bit.Mspx}
package (Version 6.11.1.404 for the 32-bit or the 64-bit version
package (Version 6.12 for the 32-bit or the 64-bit version
of Qt Creator, respectively),
which are freely available for download from the
\l{http://msdn.microsoft.com/en-us/default.aspx}{Microsoft Developer Network}.

View File

@@ -46,9 +46,8 @@ namespace QmlJSDebugger {
QmlToolBar::QmlToolBar(QWidget *parent)
: QToolBar(parent)
, m_emitSignals(true)
, m_isRunning(false)
, m_paused(false)
, m_animationSpeed(1.0f)
, m_previousAnimationSpeed(0.0f)
, ui(new Ui)
{
ui->playIcon = QIcon(QLatin1String(":/qml/images/play-24.png"));
@@ -99,40 +98,35 @@ QmlToolBar::QmlToolBar(QWidget *parent)
setWindowFlags(Qt::Tool);
QMenu *playSpeedMenu = new QMenu(this);
QActionGroup *playSpeedMenuActions = new QActionGroup(this);
playSpeedMenuActions->setExclusive(true);
playSpeedMenu->addAction(tr("Animation Speed"));
playSpeedMenu->addSeparator();
ui->defaultAnimSpeedAction = playSpeedMenu->addAction(tr("1x"), this,
SLOT(changeToDefaultAnimSpeed()));
ui->defaultAnimSpeedAction->setCheckable(true);
ui->defaultAnimSpeedAction->setChecked(true);
playSpeedMenuActions->addAction(ui->defaultAnimSpeedAction);
ui->playSpeedMenuActions = new QActionGroup(this);
ui->playSpeedMenuActions->setExclusive(true);
ui->halfAnimSpeedAction = playSpeedMenu->addAction(tr("0.5x"), this,
SLOT(changeToHalfAnimSpeed()));
ui->halfAnimSpeedAction->setCheckable(true);
playSpeedMenuActions->addAction(ui->halfAnimSpeedAction);
QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setChecked(true);
speedAction->setData(1.0f);
ui->playSpeedMenuActions->addAction(speedAction);
ui->fourthAnimSpeedAction = playSpeedMenu->addAction(tr("0.25x"), this,
SLOT(changeToFourthAnimSpeed()));
ui->fourthAnimSpeedAction->setCheckable(true);
playSpeedMenuActions->addAction(ui->fourthAnimSpeedAction);
speedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setData(2.0f);
ui->playSpeedMenuActions->addAction(speedAction);
ui->eighthAnimSpeedAction = playSpeedMenu->addAction(tr("0.125x"), this,
SLOT(changeToEighthAnimSpeed()));
ui->eighthAnimSpeedAction->setCheckable(true);
playSpeedMenuActions->addAction(ui->eighthAnimSpeedAction);
speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setData(4.0f);
ui->playSpeedMenuActions->addAction(speedAction);
ui->tenthAnimSpeedAction = playSpeedMenu->addAction(tr("0.1x"), this,
SLOT(changeToTenthAnimSpeed()));
ui->tenthAnimSpeedAction->setCheckable(true);
playSpeedMenuActions->addAction(ui->tenthAnimSpeedAction);
speedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setData(8.0f);
ui->playSpeedMenuActions->addAction(speedAction);
speedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setData(10.0f);
ui->playSpeedMenuActions->addAction(speedAction);
ui->menuPauseAction = playSpeedMenu->addAction(tr("Pause"), this, SLOT(updatePauseAction()));
ui->menuPauseAction->setCheckable(true);
ui->menuPauseAction->setIcon(ui->pauseIcon);
playSpeedMenuActions->addAction(ui->menuPauseAction);
ui->play->setMenu(playSpeedMenu);
connect(ui->designmode, SIGNAL(toggled(bool)), SLOT(setDesignModeBehaviorOnClick(bool)));
@@ -183,63 +177,40 @@ void QmlToolBar::activateZoom()
m_emitSignals = true;
}
void QmlToolBar::setAnimationSpeed(qreal slowdownFactor)
void QmlToolBar::setAnimationSpeed(qreal slowDownFactor)
{
m_emitSignals = false;
if (slowdownFactor != 0) {
m_animationSpeed = slowdownFactor;
if (m_animationSpeed == slowDownFactor)
return;
if (slowdownFactor == 1.0f) {
ui->defaultAnimSpeedAction->setChecked(true);
} else if (slowdownFactor == 2.0f) {
ui->halfAnimSpeedAction->setChecked(true);
} else if (slowdownFactor == 4.0f) {
ui->fourthAnimSpeedAction->setChecked(true);
} else if (slowdownFactor == 8.0f) {
ui->eighthAnimSpeedAction->setChecked(true);
} else if (slowdownFactor == 10.0f) {
ui->tenthAnimSpeedAction->setChecked(true);
m_emitSignals = false;
m_animationSpeed = slowDownFactor;
foreach (QAction *action, ui->playSpeedMenuActions->actions()) {
if (action->data().toReal() == slowDownFactor) {
action->setChecked(true);
break;
}
updatePlayAction();
} else {
ui->menuPauseAction->setChecked(true);
updatePauseAction();
}
m_emitSignals = true;
}
void QmlToolBar::changeToDefaultAnimSpeed()
void QmlToolBar::setAnimationPaused(bool paused)
{
m_animationSpeed = 1.0f;
if (m_paused == paused)
return;
m_paused = paused;
updatePlayAction();
}
void QmlToolBar::changeToHalfAnimSpeed()
void QmlToolBar::changeAnimationSpeed()
{
m_animationSpeed = 2.0f;
updatePlayAction();
QAction *action = qobject_cast<QAction*>(sender());
m_animationSpeed = action->data().toReal();
emit animationSpeedChanged(m_animationSpeed);
}
void QmlToolBar::changeToFourthAnimSpeed()
{
m_animationSpeed = 4.0f;
updatePlayAction();
}
void QmlToolBar::changeToEighthAnimSpeed()
{
m_animationSpeed = 8.0f;
updatePlayAction();
}
void QmlToolBar::changeToTenthAnimSpeed()
{
m_animationSpeed = 10.0f;
updatePlayAction();
}
void QmlToolBar::setDesignModeBehavior(bool inDesignMode)
{
m_emitSignals = false;
@@ -268,30 +239,14 @@ void QmlToolBar::setColorBoxColor(const QColor &color)
void QmlToolBar::activatePlayOnClick()
{
if (m_isRunning) {
updatePauseAction();
} else {
updatePlayAction();
}
m_paused = !m_paused;
emit animationPausedChanged(m_paused);
updatePlayAction();
}
void QmlToolBar::updatePlayAction()
{
m_isRunning = true;
ui->play->setIcon(ui->pauseIcon);
if (m_animationSpeed != m_previousAnimationSpeed)
m_previousAnimationSpeed = m_animationSpeed;
if (m_emitSignals)
emit animationSpeedChanged(m_animationSpeed);
}
void QmlToolBar::updatePauseAction()
{
m_isRunning = false;
ui->play->setIcon(ui->playIcon);
if (m_emitSignals)
emit animationSpeedChanged(0.0f);
ui->play->setIcon(m_paused ? ui->playIcon : ui->pauseIcon);
}
void QmlToolBar::activateColorPickerOnClick()

View File

@@ -39,6 +39,8 @@
#include "qmlobserverconstants.h"
QT_FORWARD_DECLARE_CLASS(QActionGroup)
namespace QmlJSDebugger {
class ToolBarColorBox;
@@ -58,10 +60,13 @@ public slots:
void activateSelectTool();
void activateMarqueeSelectTool();
void activateZoom();
void setAnimationSpeed(qreal slowdownFactor = 0.0f);
void setAnimationSpeed(qreal slowDownFactor);
void setAnimationPaused(bool paused);
signals:
void animationSpeedChanged(qreal slowdownFactor = 1.0f);
void animationSpeedChanged(qreal factor);
void animationPausedChanged(bool paused);
void designModeBehaviorChanged(bool inDesignMode);
void colorPickerSelected();
@@ -83,14 +88,9 @@ private slots:
void activateFromQml();
void activateToQml();
void changeToDefaultAnimSpeed();
void changeToHalfAnimSpeed();
void changeToFourthAnimSpeed();
void changeToEighthAnimSpeed();
void changeToTenthAnimSpeed();
void changeAnimationSpeed();
void updatePlayAction();
void updatePauseAction();
private:
class Ui {
@@ -107,18 +107,12 @@ private:
QIcon pauseIcon;
ToolBarColorBox *colorBox;
QAction *defaultAnimSpeedAction;
QAction *halfAnimSpeedAction;
QAction *fourthAnimSpeedAction;
QAction *eighthAnimSpeedAction;
QAction *tenthAnimSpeedAction;
QAction *menuPauseAction;
QActionGroup *playSpeedMenuActions;
};
bool m_emitSignals;
bool m_isRunning;
bool m_paused;
qreal m_animationSpeed;
qreal m_previousAnimationSpeed;
Constants::DesignTool m_activeTool;

View File

@@ -65,7 +65,8 @@ public:
void setDesignModeBehavior(bool inDesignMode);
void setCurrentObjects(QList<QObject*> items);
void setAnimationSpeed(qreal slowdownFactor);
void setAnimationSpeed(qreal slowDownFactor);
void setAnimationPaused(bool paused);
void setCurrentTool(QmlJSDebugger::Constants::DesignTool toolId);
void reloaded();
void setShowAppOnTop(bool showAppOnTop);
@@ -95,9 +96,9 @@ Q_SIGNALS:
void objectReparentRequested(QObject *object, QObject *newParent);
// 1 = normal speed,
// 0 = paused,
// 1 < x < 16 = slowdown by some factor
void animationSpeedChangeRequested(qreal speedFactor);
void executionPauseChangeRequested(bool paused);
void contextPathIndexChanged(int contextPathIndex);
void clearComponentCacheRequested();

View File

@@ -73,9 +73,8 @@ public Q_SLOTS:
void setShowAppOnTop(bool appOnTop);
void changeAnimationSpeed(qreal slowdownFactor);
void continueExecution(qreal slowdownFactor = 1.0f);
void pauseExecution();
void setAnimationSpeed(qreal factor);
void setAnimationPaused(bool paused);
void setObserverContext(int contextIndex);
@@ -89,8 +88,8 @@ Q_SIGNALS:
void colorPickerActivated();
void selectedColorChanged(const QColor &color);
void executionStarted(qreal slowdownFactor);
void executionPaused();
void animationSpeedChanged(qreal factor);
void animationPausedChanged(bool paused);
void inspectorContextCleared();
void inspectorContextPushed(const QString &contextTitle);
@@ -110,6 +109,10 @@ protected:
void setSelectedItemsForTools(QList<QGraphicsItem *> items);
private slots:
void animationSpeedChangeRequested(qreal factor);
void animationPausedChangeRequested(bool paused);
private:
Q_DISABLE_COPY(QDeclarativeViewObserver)

View File

@@ -48,24 +48,26 @@ class ObserverProtocol : public QObject
public:
enum Message {
AnimationSpeedChanged,
ChangeTool,
ClearComponentCache,
ColorChanged,
ContextPathUpdated,
CreateObject,
CurrentObjectsChanged,
DestroyObject,
MoveObject,
ObjectIdList,
Reload,
Reloaded,
SetAnimationSpeed,
SetContextPathIdx,
SetCurrentObjects,
SetDesignMode,
ShowAppOnTop,
ToolChanged
AnimationSpeedChanged = 0,
AnimationPausedChanged = 19, // highest value
ChangeTool = 1,
ClearComponentCache = 2,
ColorChanged = 3,
ContextPathUpdated = 4,
CreateObject = 5,
CurrentObjectsChanged = 6,
DestroyObject = 7,
MoveObject = 8,
ObjectIdList = 9,
Reload = 10,
Reloaded = 11,
SetAnimationSpeed = 12,
SetAnimationPaused = 18,
SetContextPathIdx = 13,
SetCurrentObjects = 14,
SetDesignMode = 15,
ShowAppOnTop = 16,
ToolChanged = 17
};
enum Tool {
@@ -77,12 +79,12 @@ public:
static inline QString toString(Message message)
{
return staticMetaObject.enumerator(0).key(message);
return staticMetaObject.enumerator(0).valueToKey(message);
}
static inline QString toString(Tool tool)
{
return staticMetaObject.enumerator(1).key(tool);
return staticMetaObject.enumerator(1).valueToKey(tool);
}
};

View File

@@ -100,6 +100,12 @@ void QDeclarativeObserverService::messageReceived(const QByteArray &message)
emit animationSpeedChangeRequested(speed);
break;
}
case ObserverProtocol::SetAnimationPaused: {
bool paused;
ds >> paused;
emit executionPauseChangeRequested(paused);
break;
}
case ObserverProtocol::ChangeTool: {
ObserverProtocol::Tool tool;
ds >> tool;
@@ -222,14 +228,24 @@ void QDeclarativeObserverService::setCurrentTool(QmlJSDebugger::Constants::Desig
sendMessage(message);
}
void QDeclarativeObserverService::setAnimationSpeed(qreal slowdownFactor)
void QDeclarativeObserverService::setAnimationSpeed(qreal slowDownFactor)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << ObserverProtocol::AnimationSpeedChanged
<< slowdownFactor;
<< slowDownFactor;
sendMessage(message);
}
void QDeclarativeObserverService::setAnimationPaused(bool paused)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << ObserverProtocol::AnimationPausedChanged
<< paused;
sendMessage(message);
}

View File

@@ -105,8 +105,8 @@ QDeclarativeViewObserverPrivate::QDeclarativeViewObserverPrivate(QDeclarativeVie
q(q),
designModeBehavior(false),
showAppOnTop(false),
executionPaused(false),
slowdownFactor(1.0f),
animationPaused(false),
slowDownFactor(1.0f),
toolBox(0)
{
}
@@ -147,7 +147,9 @@ QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view, QObje
connect(data->debugService, SIGNAL(currentObjectsChanged(QList<QObject*>)),
data.data(), SLOT(_q_onCurrentObjectsChanged(QList<QObject*>)));
connect(data->debugService, SIGNAL(animationSpeedChangeRequested(qreal)),
SLOT(changeAnimationSpeed(qreal)));
SLOT(animationSpeedChangeRequested(qreal)));
connect(data->debugService, SIGNAL(executionPauseChangeRequested(bool)),
SLOT(animationPausedChangeRequested(bool)));
connect(data->debugService, SIGNAL(colorPickerToolRequested()),
data.data(), SLOT(_q_changeToColorPickerTool()));
connect(data->debugService, SIGNAL(selectMarqueeToolRequested()),
@@ -384,11 +386,7 @@ bool QDeclarativeViewObserver::keyReleaseEvent(QKeyEvent *event)
data->subcomponentEditorTool->setCurrentItem(data->selectedItems().first());
break;
case Qt::Key_Space:
if (data->executionPaused) {
continueExecution(data->slowdownFactor);
} else {
pauseExecution();
}
setAnimationPaused(!data->animationPaused);
break;
default:
break;
@@ -757,44 +755,48 @@ void QDeclarativeViewObserverPrivate::_q_changeContextPathIndex(int index)
subcomponentEditorTool->setContext(index);
}
void QDeclarativeViewObserver::changeAnimationSpeed(qreal slowdownFactor)
void QDeclarativeViewObserver::setAnimationSpeed(qreal slowDownFactor)
{
data->slowdownFactor = slowdownFactor;
Q_ASSERT(slowDownFactor > 0);
if (data->slowDownFactor == slowDownFactor)
return;
if (data->slowdownFactor != 0)
continueExecution(data->slowdownFactor);
else
pauseExecution();
animationSpeedChangeRequested(slowDownFactor);
data->debugService->setAnimationSpeed(slowDownFactor);
}
void QDeclarativeViewObserver::continueExecution(qreal slowdownFactor)
void QDeclarativeViewObserver::setAnimationPaused(bool paused)
{
Q_ASSERT(slowdownFactor > 0);
if (data->animationPaused == paused)
return;
data->slowdownFactor = slowdownFactor;
static const qreal animSpeedSnapDelta = 0.01f;
animationPausedChangeRequested(paused);
data->debugService->setAnimationPaused(paused);
}
qreal slowDownFactor = data->slowdownFactor;
if (qAbs(1.0f - slowDownFactor) < animSpeedSnapDelta) {
slowDownFactor = 1.0f;
void QDeclarativeViewObserver::animationSpeedChangeRequested(qreal factor)
{
if (data->slowDownFactor != factor) {
data->slowDownFactor = factor;
emit animationSpeedChanged(factor);
}
QDeclarativeDebugHelper::setAnimationSlowDownFactor(slowDownFactor);
data->executionPaused = false;
emit executionStarted(data->slowdownFactor);
data->debugService->setAnimationSpeed(data->slowdownFactor);
const float effectiveFactor = data->animationPaused ? 0 : factor;
QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor);
}
void QDeclarativeViewObserver::pauseExecution()
void QDeclarativeViewObserver::animationPausedChangeRequested(bool paused)
{
QDeclarativeDebugHelper::setAnimationSlowDownFactor(0.0f);
data->executionPaused = true;
if (data->animationPaused != paused) {
data->animationPaused = paused;
emit animationPausedChanged(paused);
}
emit executionPaused();
data->debugService->setAnimationSpeed(0);
const float effectiveFactor = paused ? 0 : data->slowDownFactor;
QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor);
}
void QDeclarativeViewObserverPrivate::_q_applyChangesFromClient()
{
}
@@ -850,8 +852,6 @@ void QDeclarativeViewObserverPrivate::_q_onStatusChanged(QDeclarativeView::Statu
if (subcomponentEditorTool->contextIndex() != -1)
subcomponentEditorTool->clear();
subcomponentEditorTool->pushContext(view->rootObject());
emit q->executionStarted(1.0f);
}
debugService->reloaded();
}
@@ -917,8 +917,8 @@ void QDeclarativeViewObserverPrivate::createToolBox()
QObject::connect(toolBar, SIGNAL(designModeBehaviorChanged(bool)),
q, SLOT(setDesignModeBehavior(bool)));
QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)),
q, SLOT(changeAnimationSpeed(qreal)));
QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)), q, SLOT(setAnimationSpeed(qreal)));
QObject::connect(toolBar, SIGNAL(animationPausedChanged(bool)), q, SLOT(setAnimationPaused(bool)));
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()));
@@ -928,8 +928,8 @@ void QDeclarativeViewObserverPrivate::createToolBox()
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(animationSpeedChanged(qreal)), toolBar, SLOT(setAnimationSpeed(qreal)));
QObject::connect(q, SIGNAL(animationPausedChanged(bool)), toolBar, SLOT(setAnimationPaused(bool)));
QObject::connect(q, SIGNAL(selectToolActivated()), toolBar, SLOT(activateSelectTool()));

View File

@@ -88,8 +88,8 @@ public:
bool designModeBehavior;
bool showAppOnTop;
bool executionPaused;
qreal slowdownFactor;
bool animationPaused;
qreal slowDownFactor;
ToolBox *toolBox;

View File

@@ -50,3 +50,5 @@ SOURCES += \
RESOURCES += $$PWD/editor/editor.qrc
OTHER_FILES += $$PWD/qmljsdebugger.pri
DEFINES += QMLJSDEBUGGER

View File

@@ -114,7 +114,6 @@
#include <qdeclarativetester.h>
#include <qt_private/qdeclarativedebughelper_p.h>
#include "jsdebuggeragent.h"
QT_BEGIN_NAMESPACE
@@ -759,13 +758,12 @@ void QDeclarativeViewer::createMenu()
connect(recordOptions, SIGNAL(triggered()), this, SLOT(chooseRecordingOptions()));
QMenu *playSpeedMenu = new QMenu(tr("Animation Speed"), this);
QActionGroup *playSpeedMenuActions = new QActionGroup(this);
playSpeedMenuActions = new QActionGroup(this);
playSpeedMenuActions->setExclusive(true);
QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setChecked(true);
animationSpeed = 1.0f;
speedAction->setData(1.0f);
playSpeedMenuActions->addAction(speedAction);
@@ -776,7 +774,6 @@ void QDeclarativeViewer::createMenu()
speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setCheckable(true);
speedAction->setData(4.0f);
playSpeedMenuActions->addAction(speedAction);
@@ -790,7 +787,7 @@ void QDeclarativeViewer::createMenu()
speedAction->setData(10.0f);
playSpeedMenuActions->addAction(speedAction);
pauseAnimationsAction = playSpeedMenu->addAction(tr("Pause"), this, SLOT(setAnimationsPaused(bool)));
pauseAnimationsAction = playSpeedMenu->addAction(tr("Pause"), observer, SLOT(setAnimationPaused(bool)));
pauseAnimationsAction->setCheckable(true);
pauseAnimationsAction->setShortcut(QKeySequence("Ctrl+."));
@@ -803,6 +800,9 @@ void QDeclarativeViewer::createMenu()
QAction *playSpeedAction = new QAction(tr("Animations"), this);
playSpeedAction->setMenu(playSpeedMenu);
connect(observer, SIGNAL(animationSpeedChanged(qreal)), SLOT(animationSpeedChanged(qreal)));
connect(observer, SIGNAL(animationPausedChanged(bool)), pauseAnimationsAction, SLOT(setChecked(bool)));
showWarningsWindow = new QAction(tr("Show Warnings"), this);
showWarningsWindow->setCheckable((true));
showWarningsWindow->setChecked(loggerWindow->isVisible());
@@ -1078,24 +1078,15 @@ void QDeclarativeViewer::toggleRecording()
#endif
}
void QDeclarativeViewer::setAnimationsPaused(bool enable)
void QDeclarativeViewer::pauseAnimations()
{
if (enable) {
setAnimationSpeed(0.0);
} else {
setAnimationSpeed(animationSpeed);
}
}
void QDeclarativeViewer::pauseAnimations() {
pauseAnimationsAction->setChecked(true);
setAnimationsPaused(true);
observer->setAnimationPaused(true);
}
void QDeclarativeViewer::stepAnimations()
{
setAnimationSpeed(1.0);
QTimer::singleShot(m_stepSize, this, SLOT(pauseAnimations()));
observer->setAnimationPaused(false);
QTimer::singleShot(m_stepSize, this, SLOT(pauseAnimations()));
}
void QDeclarativeViewer::setAnimationStep()
@@ -1108,13 +1099,8 @@ void QDeclarativeViewer::setAnimationStep()
void QDeclarativeViewer::changeAnimationSpeed()
{
QAction *action = qobject_cast<QAction*>(sender());
if (action) {
float f = action->data().toFloat();
animationSpeed = f;
if (!pauseAnimationsAction->isChecked())
setAnimationSpeed(animationSpeed);
}
if (QAction *action = qobject_cast<QAction*>(sender()))
observer->setAnimationSpeed(action->data().toFloat());
}
void QDeclarativeViewer::addLibraryPath(const QString& lib)
@@ -1574,6 +1560,16 @@ void QDeclarativeViewer::orientationChanged()
updateSizeHints();
}
void QDeclarativeViewer::animationSpeedChanged(qreal factor)
{
foreach (QAction *action, playSpeedMenuActions->actions()) {
if (action->data().toFloat() == factor) {
action->setChecked(true);
break;
}
}
}
void QDeclarativeViewer::setDeviceKeys(bool on)
{
devicemode = on;
@@ -1625,11 +1621,6 @@ void QDeclarativeViewer::setStayOnTop(bool stayOnTop)
appOnTopAction->setChecked(stayOnTop);
}
void QDeclarativeViewer::setAnimationSpeed(float f)
{
QDeclarativeDebugHelper::setAnimationSlowDownFactor(f);
}
void QDeclarativeViewer::updateSizeHints(bool initial)
{
static bool isRecursive = false;

View File

@@ -130,7 +130,6 @@ public slots:
void proxySettingsChanged ();
void rotateOrientation();
void statusChanged();
void setAnimationsPaused(bool);
void pauseAnimations();
void stepAnimations();
void setAnimationStep();
@@ -154,12 +153,13 @@ private slots:
void changeOrientation(QAction*);
void orientationChanged();
void animationSpeedChanged(qreal factor);
void showWarnings(bool show);
void warningsWidgetOpened();
void warningsWidgetClosed();
private:
void setAnimationSpeed(float f);
void updateSizeHints(bool initial = false);
QString getVideoFileName();
@@ -192,8 +192,8 @@ private:
bool ffmpegAvailable;
bool convertAvailable;
float animationSpeed;
int m_stepSize;
QActionGroup *playSpeedMenuActions;
QAction *pauseAnimationsAction;
QAction *animationStepAction;
QAction *animationSetStepAction;

File diff suppressed because it is too large Load Diff

View File

@@ -2,16 +2,14 @@
# in case MS VS compilers are used.
CDB_PATH=""
win32 {
contains(QMAKE_CXX, cl) {
CDB_PATH="$$(CDB_PATH)"
isEmpty(CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x86)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x64)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows 64-bit/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x86)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x64)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows 64-bit/sdk"
!exists($$CDB_PATH)::CDB_PATH=""
}
win32-msvc* {
CDB_PATH="$$(CDB_PATH)"
isEmpty(CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x86)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x64)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows 64-bit/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x86)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x64)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows 64-bit/sdk"
!exists($$CDB_PATH)::CDB_PATH=""
}

View File

@@ -89,14 +89,37 @@ bool SymbolGroupValue::isValid() const
return m_node != 0 && m_context.dataspaces != 0;
}
// Debug helper
static void formatNodeError(const AbstractSymbolGroupNode *n, std::ostream &os)
{
const AbstractSymbolGroupNode::AbstractSymbolGroupNodePtrVector &children = n->children();
const VectorIndexType size = children.size();
if (const SymbolGroupNode *sn = n->asSymbolGroupNode()) {
os << "type: " << sn->type() << ", raw value: \"" << wStringToString(sn->symbolGroupRawValue())
<< "\", 0x" << std::hex << sn->address() << ", " << std::dec;
}
if (size) {
os << "children (" << size << "): [";
for (VectorIndexType i = 0; i < size; i++)
os << ' ' << children.at(i)->name();
os << ']';
} else {
os << "No children";
}
}
SymbolGroupValue SymbolGroupValue::operator[](unsigned index) const
{
if (ensureExpanded())
if (index < m_node->children().size())
if (SymbolGroupNode *n = m_node->childAt(index)->asSymbolGroupNode())
return SymbolGroupValue(n, m_context);
if (isValid() && SymbolGroupValue::verbose)
DebugPrint() << name() << "::operator[" << index << "](const char*) failed.";
if (isValid() && SymbolGroupValue::verbose) {
DebugPrint dp;
dp << name() << "::operator[](#" << index << ") failed. ";
if (m_node)
formatNodeError(m_node, dp);
}
return SymbolGroupValue(m_errorMessage);
}
@@ -125,8 +148,12 @@ SymbolGroupValue SymbolGroupValue::operator[](const char *name) const
if (AbstractSymbolGroupNode *child = m_node->childByIName(name))
if (SymbolGroupNode *n = child->asSymbolGroupNode())
return SymbolGroupValue(n, m_context);
if (isValid() && SymbolGroupValue::verbose) // Do not report subsequent errors
DebugPrint() << this->name() << "::operator[](" << name << ") failed.";
if (isValid() && SymbolGroupValue::verbose) { // Do not report subsequent errors
DebugPrint dp;
dp << this->name() << "::operator[](\"" << name << "\") failed. ";
if (m_node)
formatNodeError(m_node, dp);
}
return SymbolGroupValue(m_errorMessage);
}
@@ -1217,7 +1244,7 @@ static inline bool dumpQString(const SymbolGroupValue &v, std::wostream &str)
if (const SymbolGroupValue sizeValue = d["size"]) {
const int size = sizeValue.intValue();
if (size >= 0) {
str << d["data"].wcharPointerData(size);
str << L'"' << d["data"].wcharPointerData(size) << L'"';
return true;
}
}
@@ -1434,9 +1461,7 @@ static inline bool dumpQWidget(const SymbolGroupValue &v, std::wostream &str, vo
return false;
if (specialInfoIn)
*specialInfoIn = qwPrivate.node();
str << L'"';
dumpQString(oName, str);
str << L'"';
return true;
}
@@ -1448,9 +1473,7 @@ static inline bool dumpQObject(const SymbolGroupValue &v, std::wostream &str, vo
if (SymbolGroupValue oName = qoPrivate["objectName"]) {
if (specialInfoIn)
*specialInfoIn = qoPrivate.node();
str << L'"';
dumpQString(oName, str);
str << L'"';
return true;
}
}
@@ -1573,10 +1596,9 @@ static bool dumpQVariant(const SymbolGroupValue &v, std::wostream &str, void **s
}
break;
case 10: // String
str << L"(QString) \"";
str << L"(QString) ";
if (const SymbolGroupValue sv = dataV.typeCast(qtInfo.prependQtCoreModule("QString *").c_str())) {
dumpQString(sv, str);
str << L'"';
}
break;
case 11: //StringList: Dump container size

View File

@@ -132,67 +132,35 @@ QTCREATOR_UTILS_EXPORT QString winGetDLLVersion(WinDLLVersionType t,
return rc;
}
QTCREATOR_UTILS_EXPORT QString getShortPathName(const QString &name, QString *errorMessage)
QTCREATOR_UTILS_EXPORT QString getShortPathName(const QString &name)
{
typedef DWORD (APIENTRY *GetShortPathNameProtoType)(LPCTSTR, LPTSTR, DWORD);
if (name.isEmpty())
return name;
const char *kernel32DLLC = "kernel32.dll";
QLibrary kernel32Lib(kernel32DLLC, 0);
if (!kernel32Lib.isLoaded() && !kernel32Lib.load()) {
*errorMessage = msgCannotLoad(kernel32DLLC, kernel32Lib.errorString());
return QString();
}
// MinGW requires old-style casts
GetShortPathNameProtoType getShortPathNameW = (GetShortPathNameProtoType)(kernel32Lib.resolve("GetShortPathNameW"));
if (!getShortPathNameW) {
*errorMessage = msgCannotResolve(kernel32DLLC);
return QString();
}
// Determine length, then convert.
const LPCTSTR nameC = reinterpret_cast<LPCTSTR>(name.utf16()); // MinGW
const DWORD length = (*getShortPathNameW)(nameC, NULL, 0);
const DWORD length = GetShortPathNameW(nameC, NULL, 0);
if (length == 0)
return name;
QScopedArrayPointer<TCHAR> buffer(new TCHAR[length]);
(*getShortPathNameW)(nameC, buffer.data(), length);
const QString rc = QString::fromUtf16(reinterpret_cast<const ushort *>(buffer.data()), length);
GetShortPathNameW(nameC, buffer.data(), length);
const QString rc = QString::fromUtf16(reinterpret_cast<const ushort *>(buffer.data()), length - 1);
return rc;
}
QTCREATOR_UTILS_EXPORT QString getLongPathName(const QString &name, QString *errorMessage)
QTCREATOR_UTILS_EXPORT QString getLongPathName(const QString &name)
{
typedef DWORD (APIENTRY *GetLongPathNameProtoType)(LPCTSTR, LPTSTR, DWORD);
if (name.isEmpty())
return name;
const char *kernel32DLLC = "kernel32.dll";
QLibrary kernel32Lib(kernel32DLLC, 0);
if (!kernel32Lib.isLoaded() && !kernel32Lib.load()) {
*errorMessage = msgCannotLoad(kernel32DLLC, kernel32Lib.errorString());
return QString();
}
// MinGW requires old-style casts
GetLongPathNameProtoType getLongPathNameW = (GetLongPathNameProtoType)(kernel32Lib.resolve("GetLongPathNameW"));
if (!getLongPathNameW) {
*errorMessage = msgCannotResolve(kernel32DLLC);
return QString();
}
// Determine length, then convert.
const LPCTSTR nameC = reinterpret_cast<LPCTSTR>(name.utf16()); // MinGW
const DWORD length = (*getLongPathNameW)(nameC, NULL, 0);
const DWORD length = GetLongPathNameW(nameC, NULL, 0);
if (length == 0)
return name;
QScopedArrayPointer<TCHAR> buffer(new TCHAR[length]);
(*getLongPathNameW)(nameC, buffer.data(), length);
const QString rc = QString::fromUtf16(reinterpret_cast<const ushort *>(buffer.data()), length);
GetLongPathNameW(nameC, buffer.data(), length);
const QString rc = QString::fromUtf16(reinterpret_cast<const ushort *>(buffer.data()), length - 1);
return rc;
}

View File

@@ -55,12 +55,10 @@ QTCREATOR_UTILS_EXPORT QString winGetDLLVersion(WinDLLVersionType t,
QString *errorMessage);
// Return the short (8.3) file name
QTCREATOR_UTILS_EXPORT QString getShortPathName(const QString &name,
QString *errorMessage);
QTCREATOR_UTILS_EXPORT QString getShortPathName(const QString &name);
// Returns long name
QTCREATOR_UTILS_EXPORT QString getLongPathName(const QString &name,
QString *errorMessage);
QTCREATOR_UTILS_EXPORT QString getLongPathName(const QString &name);
QTCREATOR_UTILS_EXPORT unsigned long winQPidToPid(const Q_PID qpid);

View File

@@ -64,7 +64,7 @@ QString CloneWizard::description() const
QString CloneWizard::displayName() const
{
return tr("Bazaar Clone (or branch)");
return tr("Bazaar Clone (Or Branch)");
}
QList<QWizardPage*> CloneWizard::createParameterPages(const QString &path)

View File

@@ -17,13 +17,13 @@
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Branch location</string>
<string>Branch Location</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QRadioButton" name="defaultButton">
<property name="text">
<string>Default Location</string>
<string>Default location</string>
</property>
<property name="checked">
<bool>true</bool>
@@ -50,7 +50,7 @@
<string>for example https://[user[:pass]@]host[:port]/[path]</string>
</property>
<property name="text">
<string>Specify Url:</string>
<string>Specify URL:</string>
</property>
</widget>
</item>

View File

@@ -418,7 +418,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
ActionContainer *medit = am->actionContainer(Constants::M_EDIT);
ActionContainer *advancedMenu = am->createMenu(Constants::M_EDIT_ADVANCED);
medit->addMenu(advancedMenu, Constants::G_EDIT_ADVANCED);
advancedMenu->menu()->setTitle(tr("&Advanced"));
advancedMenu->menu()->setTitle(tr("Ad&vanced"));
advancedMenu->appendGroup(Constants::G_EDIT_FORMAT);
advancedMenu->appendGroup(Constants::G_EDIT_COLLAPSING);
advancedMenu->appendGroup(Constants::G_EDIT_BLOCKS);

View File

@@ -529,7 +529,8 @@ bool ExternalTool::operator==(const ExternalTool &other) const
ExternalToolRunner::ExternalToolRunner(const ExternalTool *tool)
: m_tool(new ExternalTool(tool)),
m_process(0),
m_outputCodec(QTextCodec::codecForLocale())
m_outputCodec(QTextCodec::codecForLocale()),
m_hasError(false)
{
run();
}
@@ -540,6 +541,16 @@ ExternalToolRunner::~ExternalToolRunner()
delete m_tool;
}
bool ExternalToolRunner::hasError() const
{
return m_hasError;
}
QString ExternalToolRunner::errorString() const
{
return m_errorString;
}
bool ExternalToolRunner::resolve()
{
if (!m_tool)
@@ -548,14 +559,27 @@ bool ExternalToolRunner::resolve()
m_resolvedArguments.clear();
m_resolvedWorkingDirectory.clear();
{ // executable
QStringList expandedExecutables; /* for error message */
foreach (const QString &executable, m_tool->executables()) {
QString resolved = Utils::expandMacros(executable,
QString expanded = Utils::expandMacros(executable,
Core::VariableManager::instance()->macroExpander());
expandedExecutables << expanded;
m_resolvedExecutable =
Utils::Environment::systemEnvironment().searchInPath(resolved);
Utils::Environment::systemEnvironment().searchInPath(expanded);
if (!m_resolvedExecutable.isEmpty())
break;
}
if (m_resolvedExecutable.isEmpty())
if (m_resolvedExecutable.isEmpty()) {
m_hasError = true;
for (int i = 0; i < expandedExecutables.size(); ++i) {
m_errorString += tr("Could not find executable for '%1' (expanded '%2')\n")
.arg(m_tool->executables().at(i))
.arg(expandedExecutables.at(i));
}
if (!m_errorString.isEmpty())
m_errorString.chop(1);
return false;
}
}
{ // arguments
m_resolvedArguments = Utils::QtcProcess::expandMacros(m_tool->arguments(),
@@ -759,7 +783,10 @@ void ExternalToolManager::menuActivated()
QTC_ASSERT(action, return);
ExternalTool *tool = m_tools.value(action->data().toString());
QTC_ASSERT(tool, return);
new ExternalToolRunner(tool);
ExternalToolRunner *runner = new ExternalToolRunner(tool);
if (runner->hasError()) {
ICore::instance()->messageManager()->printToOutputPane(runner->errorString(), true);
}
}
QMap<QString, QList<Internal::ExternalTool *> > ExternalToolManager::toolsByCategory() const

View File

@@ -135,6 +135,9 @@ public:
ExternalToolRunner(const ExternalTool *tool);
~ExternalToolRunner();
bool hasError() const;
QString errorString() const;
private slots:
void started();
void finished(int exitCode, QProcess::ExitStatus status);
@@ -157,6 +160,8 @@ private:
QTextCodec::ConverterState m_errorCodecState;
QString m_processOutput;
QString m_expectedFileName;
bool m_hasError;
QString m_errorString;
};
} // Internal

View File

@@ -703,7 +703,7 @@ void MainWindow::registerDefaultActions()
// Select All
icon = QIcon::fromTheme(QLatin1String("edit-select-all"));
tmpaction = new QAction(icon, tr("&Select All"), this);
tmpaction = new QAction(icon, tr("Select &All"), this);
cmd = am->registerAction(tmpaction, Constants::SELECTALL, globalContext);
cmd->setDefaultKeySequence(QKeySequence::SelectAll);
medit->addAction(cmd, Constants::G_EDIT_SELECTALL);

View File

@@ -17,7 +17,7 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<dependency name=\"ProjectExplorer\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"Find\" version=\"$$QTCREATOR_VERSION\"/>
<!-- Debugger plugin adds items to the editor's context menu -->
<!-- Debugger plugin adds items to the editor\'s context menu -->
<dependency name=\"CppEditor\" version=\"$$QTCREATOR_VERSION\" type=\"optional\"/>
</dependencyList>
<argumentList>

View File

@@ -91,25 +91,25 @@ QString BreakpointParameters::toString() const
QTextStream ts(&result);
ts << "Type: " << type;
switch (type) {
break;
case Debugger::Internal::BreakpointByFileAndLine:
case BreakpointByFileAndLine:
ts << " FileName: " << fileName << ':' << lineNumber
<< " PathUsage: " << pathUsage;
break;
case Debugger::Internal::BreakpointByFunction:
case BreakpointByFunction:
ts << " FunctionName: " << functionName;
break;
case Debugger::Internal::BreakpointByAddress:
case Debugger::Internal::Watchpoint:
case BreakpointByAddress:
case Watchpoint:
ts << " Address: " << address;
break;
case Debugger::Internal::BreakpointAtThrow:
case Debugger::Internal::BreakpointAtCatch:
case Debugger::Internal::BreakpointAtMain:
case Debugger::Internal::BreakpointAtFork:
case Debugger::Internal::BreakpointAtExec:
case Debugger::Internal::BreakpointAtVFork:
case Debugger::Internal::BreakpointAtSysCall:
case BreakpointAtThrow:
case BreakpointAtCatch:
case BreakpointAtMain:
case BreakpointAtFork:
case BreakpointAtExec:
case BreakpointAtVFork:
case BreakpointAtSysCall:
case UnknownType:
break;
}
ts << (enabled ? " [enabled]" : " [disabled]");

View File

@@ -907,7 +907,7 @@ void DebuggerEngine::notifyInferiorStopOk()
void DebuggerEngine::notifyInferiorSpontaneousStop()
{
showMessage(_("NOTE: INFERIOR SPONTANEOUES STOP"));
showMessage(_("NOTE: INFERIOR SPONTANEOUS STOP"));
QTC_ASSERT(state() == InferiorRunOk, qDebug() << this << state());
setState(InferiorStopOk);
}

View File

@@ -2455,34 +2455,44 @@ void DebuggerPluginPrivate::remoteCommand(const QStringList &options,
QString DebuggerPluginPrivate::debuggerForAbi(const Abi &abi, DebuggerEngineType et) const
{
enum { debug = 0 };
Abi searchAbi = abi;
QList<Abi> searchAbis;
searchAbis.push_back(abi);
// Pick the right tool chain in case cdb/gdb were started with other tool chains.
// Also, lldb should be preferred over gdb.
if (searchAbi.os() == ProjectExplorer::Abi::WindowsOS) {
if (abi.os() == ProjectExplorer::Abi::WindowsOS) {
switch (et) {
case CdbEngineType:
searchAbi = Abi(abi.architecture(), abi.os(), Abi::WindowsMsvc2010Flavor,
abi.binaryFormat(), abi.wordWidth());
searchAbis.clear();
searchAbis.push_back(Abi(abi.architecture(), abi.os(), Abi::WindowsMsvc2010Flavor,
abi.binaryFormat(), abi.wordWidth()));
searchAbis.push_back(Abi(abi.architecture(), abi.os(), Abi::WindowsMsvc2008Flavor,
abi.binaryFormat(), abi.wordWidth()));
searchAbis.push_back(Abi(abi.architecture(), abi.os(), Abi::WindowsMsvc2005Flavor,
abi.binaryFormat(), abi.wordWidth()));
break;
case GdbEngineType:
searchAbi = Abi(abi.architecture(), abi.os(), Abi::WindowsMSysFlavor,
abi.binaryFormat(), abi.wordWidth());
searchAbis.clear();
searchAbis.push_back(Abi(abi.architecture(), abi.os(), Abi::WindowsMSysFlavor,
abi.binaryFormat(), abi.wordWidth()));
break;
default:
break;
}
}
if (debug)
qDebug() << "debuggerForAbi" << abi.toString() << searchAbi.toString() << et;
qDebug() << "debuggerForAbi" << abi.toString() << searchAbis.size()
<< searchAbis.front().toString() << et;
const QList<ToolChain *> toolchains = ToolChainManager::instance()->findToolChains(searchAbi);
// Find manually configured ones first
for (int i = toolchains.size() - 1; i >= 0; i--) {
const QString debugger = toolchains.at(i)->debuggerCommand();
if (debug)
qDebug() << i << toolchains.at(i)->displayName() << debugger;
if (!debugger.isEmpty())
return debugger;
foreach (const Abi &searchAbi, searchAbis) {
const QList<ToolChain *> toolchains = ToolChainManager::instance()->findToolChains(searchAbi);
// Find manually configured ones first
for (int i = toolchains.size() - 1; i >= 0; i--) {
const QString debugger = toolchains.at(i)->debuggerCommand();
if (debug)
qDebug() << i << toolchains.at(i)->displayName() << debugger;
if (!debugger.isEmpty())
return debugger;
}
}
return QString();
}

View File

@@ -141,6 +141,9 @@ static QList<Abi> abiOf(const QByteArray &data)
case 21: // EM_PPC64
result.append(Abi(Abi::PowerPCArchitecture, Abi::LinuxOS, Abi::GenericLinuxFlavor, Abi::ElfFormat, 64));
break;
case 40: // EM_ARM
result.append(Abi(Abi::ArmArchitecture, Abi::LinuxOS, Abi::GenericLinuxFlavor, Abi::ElfFormat, 32));
break;
case 62: // EM_X86_64
result.append(Abi(Abi::X86Architecture, Abi::LinuxOS, Abi::GenericLinuxFlavor, Abi::ElfFormat, 64));
break;
@@ -171,6 +174,10 @@ static QList<Abi> abiOf(const QByteArray &data)
result.append(macAbiForCpu(type));
pos += 20;
}
} else if (data.size() >= 20
&& static_cast<unsigned char>(data.at(16)) == 'E' && static_cast<unsigned char>(data.at(17)) == 'P'
&& static_cast<unsigned char>(data.at(18)) == 'O' && static_cast<unsigned char>(data.at(19)) == 'C') {
result.append(Abi(Abi::ArmArchitecture, Abi::SymbianOS, Abi::SymbianDeviceFlavor, Abi::ElfFormat, 32));
} else {
// Windows PE
// Windows can have its magic bytes everywhere...
@@ -492,13 +499,13 @@ Abi Abi::hostAbi()
QList<Abi> Abi::abisOfBinary(const QString &path)
{
QList<Abi> result;
QList<Abi> tmp;
if (path.isEmpty())
return result;
return tmp;
QFile f(path);
if (!f.exists())
return result;
return tmp;
bool windowsStatic = path.endsWith(QLatin1String(".lib"));
@@ -509,7 +516,7 @@ QList<Abi> Abi::abisOfBinary(const QString &path)
&& static_cast<unsigned char>(data.at(2)) == 'a' && static_cast<unsigned char>(data.at(3)) == 'r'
&& static_cast<unsigned char>(data.at(4)) == 'c' && static_cast<unsigned char>(data.at(5)) == 'h'
&& static_cast<unsigned char>(data.at(6)) == '>' && static_cast<unsigned char>(data.at(7)) == 0x0a) {
// We got an ar file: possibly a static lib for ELF or Mach-O
// We got an ar file: possibly a static lib for ELF, PE or Mach-O
data = data.mid(8); // Cut of ar file magic
quint64 offset = 8;
@@ -530,22 +537,123 @@ QList<Abi> Abi::abisOfBinary(const QString &path)
offset += fileLength.toInt() + 60 /* header */;
if (windowsStatic) {
if (fileName == QLatin1String("/0 "))
result = parseCoffHeader(data.mid(toSkip, 20));
tmp = parseCoffHeader(data.mid(toSkip, 20));
} else {
result = abiOf(data.mid(toSkip));
tmp.append(abiOf(data.mid(toSkip)));
}
if (!result.isEmpty())
if (!tmp.isEmpty()
&& tmp.at(0).binaryFormat() != Abi::MachOFormat)
break;
f.seek(offset + (offset % 2)); // ar is 2 byte alligned
data = f.read(1024);
}
} else {
result = abiOf(data);
tmp = abiOf(data);
}
f.close();
// Remove duplicates:
QList<Abi> result;
foreach (const Abi &a, tmp) {
if (!result.contains(a))
result.append(a);
}
return result;
}
} // namespace ProjectExplorer
// Unit tests:
#ifdef WITH_TESTS
# include <QTest>
# include <QtCore/QFileInfo>
# include "projectexplorer.h"
void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
{
QTest::addColumn<QString>("file");
QTest::addColumn<QStringList>("abis");
QTest::newRow("no file")
<< QString()
<< (QStringList());
QTest::newRow("non existing file")
<< QString::fromLatin1("/does/not/exist")
<< (QStringList());
// Set up prefix for test data now that we can be sure to have some tests to run:
QString prefix = qgetenv("QTC_TEST_EXTRADATALOCATION");
if (prefix.isEmpty())
return;
QFileInfo fi(prefix);
if (!fi.exists() || !fi.isDir())
return;
prefix = fi.absoluteFilePath();
QTest::newRow("text file")
<< QString::fromLatin1("%1/broken/text.txt").arg(prefix)
<< (QStringList());
QTest::newRow("static QtCore: win msvc2008")
<< QString::fromLatin1("%1/abi/static/win_msvc2008_release.lib").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-unknown-pe-32bit"));
QTest::newRow("static QtCore: win msvc2008 (debug)")
<< QString::fromLatin1("%1/abi/static/win_msvc2008_debug.lib").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-unknown-pe-32bit"));
QTest::newRow("static QtCore: mac (debug)")
<< QString::fromLatin1("%1/abi/static/mac-32bit-debug.a").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-macos-generic-mach_o-32bit"));
QTest::newRow("static QtCore: linux 32bit")
<< QString::fromLatin1("%1/abi/static/linux-32bit-release.a").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-linux-generic-elf-32bit"));
QTest::newRow("static QtCore: linux 64bit")
<< QString::fromLatin1("%1/abi/static/linux-64bit-release.a").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-linux-generic-elf-64bit"));
QTest::newRow("static stdc++: mac fat")
<< QString::fromLatin1("%1/abi/static/mac-fat.a").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-macos-generic-mach_o-32bit")
<< QString::fromLatin1("ppc-macos-generic-mach_o-32bit")
<< QString::fromLatin1("x86-macos-generic-mach_o-64bit"));
QTest::newRow("dynamic QtCore: symbian")
<< QString::fromLatin1("%1/abi/dynamic/symbian.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("arm-symbian-device-elf-32bit"));
QTest::newRow("dynamic QtCore: win msvc2010 64bit")
<< QString::fromLatin1("%1/abi/dynamic/win-msvc2010-64bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msvc2010-pe-64bit"));
QTest::newRow("dynamic QtCore: win msvc2008 32bit")
<< QString::fromLatin1("%1/abi/dynamic/win-msvc2008-32bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msvc2008-pe-32bit"));
QTest::newRow("dynamic QtCore: win msvc2005 32bit")
<< QString::fromLatin1("%1/abi/dynamic/win-msvc2005-32bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msvc2005-pe-32bit"));
QTest::newRow("dynamic QtCore: win msys 32bit")
<< QString::fromLatin1("%1/abi/dynamic/win-mingw-32bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msys-pe-32bit"));
QTest::newRow("dynamic QtCore: win msys 32bit")
<< QString::fromLatin1("%1/abi/dynamic/win-mingw-32bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msys-pe-32bit"));
QTest::newRow("static stdc++: mac fat")
<< QString::fromLatin1("%1/abi/dynamic/mac-fat.dylib").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-macos-generic-mach_o-32bit")
<< QString::fromLatin1("ppc-macos-generic-mach_o-32bit")
<< QString::fromLatin1("x86-macos-generic-mach_o-64bit"));
}
void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary()
{
QFETCH(QString, file);
QFETCH(QStringList, abis);
QList<ProjectExplorer::Abi> result = Abi::abisOfBinary(file);
QCOMPARE(result.count(), abis.count());
for (int i = 0; i < abis.count(); ++i)
QCOMPARE(result.at(i).toString(), abis.at(i));
}
#endif

View File

@@ -71,11 +71,9 @@ ApplicationLauncher::~ApplicationLauncher()
void ApplicationLauncher::setWorkingDirectory(const QString &dir)
{
QString fixedPath = dir;
QString error;
// Work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch' ...)
const QString longPath = Utils::getLongPathName(dir, &error);
QString fixedPath = dir;
const QString longPath = Utils::getLongPathName(dir);
if (!longPath.isEmpty())
fixedPath = longPath;

View File

@@ -103,16 +103,18 @@ static Abi findAbiOfMsvc(MsvcToolChain::Type type, MsvcToolChain::Platform platf
QString msvcVersionString = version;
if (type == MsvcToolChain::WindowsSDK) {
if (version.startsWith("7."))
msvcVersionString = "10.0";
else if (version.startsWith("6.1"))
msvcVersionString = "9.0";
if (version.startsWith(QLatin1String("7.")))
msvcVersionString = QLatin1String("10.0");
else if (version.startsWith(QLatin1String("6.1"))
|| (version.startsWith(QLatin1String("6.0")) && version != QLatin1String("6.0")))
// The 6.0 SDK is shipping MSVC2005, Starting at 6.0a it is MSVC2008.
msvcVersionString = QLatin1String("9.0");
else
msvcVersionString = "8.0";
msvcVersionString = QLatin1String("8.0");
}
if (msvcVersionString.startsWith("10."))
if (msvcVersionString.startsWith(QLatin1String("10.")))
flavor = Abi::WindowsMsvc2010Flavor;
else if (msvcVersionString.startsWith("9."))
else if (msvcVersionString.startsWith(QLatin1String("9.")))
flavor = Abi::WindowsMsvc2008Flavor;
else
flavor = Abi::WindowsMsvc2005Flavor;

View File

@@ -236,6 +236,9 @@ private slots:
void testGccAbiGuessing_data();
void testGccAbiGuessing();
void testAbiOfBinary_data();
void testAbiOfBinary();
#endif
private:

View File

@@ -873,26 +873,6 @@ void SessionManager::removeProjects(QList<Project *> remove)
emit aboutToRemoveProject(pro);
}
// TODO: Clear m_modelProjectHash
// Delete projects
foreach (Project *pro, remove) {
pro->saveSettings();
m_file->m_projects.removeOne(pro);
if (pro == m_file->m_startupProject)
setStartupProject(0);
disconnect(pro, SIGNAL(fileListChanged()),
this, SLOT(clearProjectFileCache()));
m_projectFileCache.remove(pro);
if (debug)
qDebug() << "SessionManager - emitting projectRemoved(" << pro->displayName() << ")";
m_sessionNode->removeProjectNode(pro->rootProjectNode());
emit projectRemoved(pro);
delete pro;
}
// Refresh dependencies
QSet<QString> projectFiles;
@@ -915,6 +895,27 @@ void SessionManager::removeProjects(QList<Project *> remove)
m_file->m_depMap = resMap;
// TODO: Clear m_modelProjectHash
// Delete projects
foreach (Project *pro, remove) {
pro->saveSettings();
m_file->m_projects.removeOne(pro);
if (pro == m_file->m_startupProject)
setStartupProject(0);
disconnect(pro, SIGNAL(fileListChanged()),
this, SLOT(clearProjectFileCache()));
m_projectFileCache.remove(pro);
if (debug)
qDebug() << "SessionManager - emitting projectRemoved(" << pro->displayName() << ")";
m_sessionNode->removeProjectNode(pro->rootProjectNode());
emit projectRemoved(pro);
delete pro;
}
if (startupProject() == 0)
if (!m_file->m_projects.isEmpty())
setStartupProject(m_file->m_projects.first());

View File

@@ -188,8 +188,8 @@ void FormEditorView::nodeAboutToBeRemoved(const ModelNode &removedNode)
}
foreach (FormEditorItem *item, m_scene->allFormEditorItems()) {
delete item;
m_scene->removeItemFromHash(item);
delete item;
}
QmlModelView::rootNodeTypeChanged(type, majorVersion, minorVersion);

View File

@@ -161,8 +161,19 @@ void DesignDocumentController::detachNodeInstanceView()
void DesignDocumentController::attachNodeInstanceView()
{
QmlModelState state;
if (m_d->nodeInstanceView)
model()->attachView(m_d->nodeInstanceView.data());
//We go back to base state (and back again) to avoid side effects from text editing.
if (m_d->statesEditorView) {
state = m_d->statesEditorView->currentState();
m_d->statesEditorView->setCurrentState(m_d->statesEditorView->baseState());
}
if (state.isValid() && m_d->statesEditorView)
m_d->statesEditorView->setCurrentState(state);
}
QWidget *DesignDocumentController::centralWidget() const

View File

@@ -53,7 +53,6 @@ NavigatorView::NavigatorView(QObject* parent) :
m_widget->setTreeModel(m_treeModel.data());
connect(treeWidget()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(changeSelection(QItemSelection,QItemSelection)));
connect(treeWidget(), SIGNAL(doubleClicked(QModelIndex)), this, SLOT(changeToComponent(QModelIndex)));
treeWidget()->setIndentation(treeWidget()->indentation() * 0.5);
NameItemDelegate *idDelegate = new NameItemDelegate(this,m_treeModel.data());

View File

@@ -599,7 +599,11 @@ QString templateGeneration(NodeMetaInfo type, NodeMetaInfo superType, const QmlO
qSort(orderedList);
foreach (const QString &name, orderedList) {
if (name.startsWith(QLatin1String("__")))
continue; //private API
QString properName = name;
properName.replace('.', '_');
QString typeName = type.propertyTypeName(name);

View File

@@ -38,7 +38,7 @@
namespace QmlDesigner {
PropertyEditorTransaction::PropertyEditorTransaction(QmlDesigner::PropertyEditor *propertyEditor) : QObject(propertyEditor), m_propertyEditor(propertyEditor)
PropertyEditorTransaction::PropertyEditorTransaction(QmlDesigner::PropertyEditor *propertyEditor) : QObject(propertyEditor), m_propertyEditor(propertyEditor), m_timerId(-1)
{
}
@@ -49,17 +49,21 @@ void PropertyEditorTransaction::start()
if (m_rewriterTransaction.isValid())
m_rewriterTransaction.commit();
m_rewriterTransaction = m_propertyEditor->beginRewriterTransaction();
startTimer(4000);
m_timerId = startTimer(4000);
}
void PropertyEditorTransaction::end()
{
if (m_rewriterTransaction.isValid() && m_propertyEditor->model())
if (m_rewriterTransaction.isValid() && m_propertyEditor->model()) {
killTimer(m_timerId);
m_rewriterTransaction.commit();
}
}
void PropertyEditorTransaction::timerEvent(QTimerEvent *timerEvent)
{
if (timerEvent->timerId() != m_timerId)
return;
killTimer(timerEvent->timerId());
if (m_rewriterTransaction.isValid())
m_rewriterTransaction.commit();

View File

@@ -53,6 +53,7 @@ protected:
private:
QmlDesigner::PropertyEditor *m_propertyEditor;
QmlDesigner::RewriterTransaction m_rewriterTransaction;
int m_timerId;
};
} //QmlDesigner

View File

@@ -72,12 +72,36 @@ QList<ServerNodeInstance> GraphicsObjectNodeInstance::childItems() const
QGraphicsObject *childObject = item->toGraphicsObject();
if (childObject && nodeInstanceServer()->hasInstanceForObject(childObject)) {
instanceList.append(nodeInstanceServer()->instanceForObject(childObject));
} else { //there might be an item in between the parent instance
//and the child instance.
//Popular example is flickable which has a viewport item between
//the flickable item and the flickable children
instanceList.append(childItemsForChild(item)); //In such a case we go deeper inside the item and
//search for child items with instances.
}
}
return instanceList;
}
QList<ServerNodeInstance> GraphicsObjectNodeInstance::childItemsForChild(QGraphicsItem *childItem) const
{
QList<ServerNodeInstance> instanceList;
if (childItem) {
foreach(QGraphicsItem *item, childItem->childItems())
{
QGraphicsObject *childObject = item->toGraphicsObject();
if (childObject && nodeInstanceServer()->hasInstanceForObject(childObject)) {
instanceList.append(nodeInstanceServer()->instanceForObject(childObject));
} else {
instanceList.append(childItemsForChild(item));
}
}
}
return instanceList;
}
void GraphicsObjectNodeInstance::setHasContent(bool hasContent)
{
m_hasContent = hasContent;

View File

@@ -76,6 +76,7 @@ public:
bool hasContent() const;
QList<ServerNodeInstance> childItems() const;
QList<ServerNodeInstance> childItemsForChild(QGraphicsItem *childItem) const;
void paintUpdate();

View File

@@ -258,6 +258,7 @@ void NodeInstanceServer::clearScene(const ClearSceneCommand &/*command*/)
void NodeInstanceServer::removeInstances(const RemoveInstancesCommand &command)
{
ServerNodeInstance oldState = activeStateInstance();
if (activeStateInstance().isValid())
activeStateInstance().deactivateState();
@@ -265,9 +266,8 @@ void NodeInstanceServer::removeInstances(const RemoveInstancesCommand &command)
removeInstanceRelationsip(instanceId);
}
if (activeStateInstance().isValid())
activeStateInstance().activateState();
if (oldState.isValid())
oldState.activateState();
refreshBindings();
startRenderTimer();

View File

@@ -64,7 +64,7 @@ void RenderNodeInstanceServer::findItemChangesAndSendChangeCommands()
ServerNodeInstance instance = instanceForObject(graphicsObject);
QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(item);
if((d->dirty && d->notifyBoundingRectChanged)|| (d->dirty && !d->dirtySceneTransform) || nonInstanceChildIsDirty(graphicsObject))
if((d->dirty && d->notifyBoundingRectChanged)|| (d->dirty) || nonInstanceChildIsDirty(graphicsObject))
m_dirtyInstanceSet.insert(instance);
if (d->geometryChanged) {

View File

@@ -343,8 +343,7 @@ void BauhausPlugin::extensionsInitialized()
{
m_designMode = ExtensionSystem::PluginManager::instance()->getObject<Core::DesignMode>();
m_mimeTypes << "application/x-qml" << "application/javascript"
<< "application/x-javascript" << "text/javascript";
m_mimeTypes << "application/x-qml";
m_designMode->registerDesignWidget(m_mainWidget, m_mimeTypes, m_context->context());
connect(m_designMode, SIGNAL(actionsUpdated(Core::IEditor*)), SLOT(updateActions(Core::IEditor*)));

View File

@@ -73,19 +73,13 @@ QmlInspectorToolBar::QmlInspectorToolBar(QObject *parent) :
m_zoomAction(0),
m_colorPickerAction(0),
m_showAppOnTopAction(0),
m_defaultAnimSpeedAction(0),
m_halfAnimSpeedAction(0),
m_fourthAnimSpeedAction(0),
m_eighthAnimSpeedAction(0),
m_tenthAnimSpeedAction(0),
m_menuPauseAction(0),
m_playSpeedMenuActions(0),
m_playIcon(QIcon(QLatin1String(":/qml/images/play-small.png"))),
m_pauseIcon(QIcon(QLatin1String(":/qml/images/pause-small.png"))),
m_colorBox(0),
m_emitSignals(true),
m_isRunning(false),
m_paused(false),
m_animationSpeed(1.0f),
m_previousAnimationSpeed(0.0f),
m_activeTool(NoTool),
m_barWidget(0)
{
@@ -142,32 +136,33 @@ void QmlInspectorToolBar::activateZoomTool()
m_emitSignals = true;
}
void QmlInspectorToolBar::setAnimationSpeed(qreal slowdownFactor)
void QmlInspectorToolBar::setAnimationSpeed(qreal slowDownFactor)
{
m_emitSignals = false;
if (slowdownFactor != 0) {
m_animationSpeed = slowdownFactor;
if (m_animationSpeed == slowDownFactor)
return;
if (slowdownFactor == 1.0f) {
m_defaultAnimSpeedAction->setChecked(true);
} else if (slowdownFactor == 2.0f) {
m_halfAnimSpeedAction->setChecked(true);
} else if (slowdownFactor == 4.0f) {
m_fourthAnimSpeedAction->setChecked(true);
} else if (slowdownFactor == 8.0f) {
m_eighthAnimSpeedAction->setChecked(true);
} else if (slowdownFactor == 10.0f) {
m_tenthAnimSpeedAction->setChecked(true);
m_emitSignals = false;
m_animationSpeed = slowDownFactor;
foreach (QAction *action, m_playSpeedMenuActions->actions()) {
if (action->data().toReal() == slowDownFactor) {
action->setChecked(true);
break;
}
updatePlayAction();
} else {
m_menuPauseAction->setChecked(true);
updatePauseAction();
}
m_emitSignals = true;
}
void QmlInspectorToolBar::setAnimationPaused(bool paused)
{
if (m_paused == paused)
return;
m_paused = paused;
updatePlayAction();
}
void QmlInspectorToolBar::setDesignModeBehavior(bool inDesignMode)
{
m_emitSignals = false;
@@ -220,7 +215,8 @@ void QmlInspectorToolBar::createActions(const Core::Context &context)
m_colorPickerAction->setCheckable(true);
am->registerAction(m_observerModeAction, Constants::DESIGNMODE_ACTION, context);
am->registerAction(m_playAction, Constants::PLAY_ACTION, context);
Core::Command *command = am->registerAction(m_playAction, Constants::PLAY_ACTION, context);
command->setAttribute(Core::Command::CA_UpdateIcon);
am->registerAction(m_selectAction, Constants::SELECT_ACTION, context);
am->registerAction(m_zoomAction, Constants::ZOOM_ACTION, context);
am->registerAction(m_colorPickerAction, Constants::COLOR_PICKER_ACTION, context);
@@ -232,40 +228,33 @@ void QmlInspectorToolBar::createActions(const Core::Context &context)
m_barWidget->setProperty("topBorder", true);
QMenu *playSpeedMenu = new QMenu(m_barWidget);
QActionGroup *playSpeedMenuActions = new QActionGroup(this);
playSpeedMenuActions->setExclusive(true);
playSpeedMenu->addAction(tr("Animation Speed"));
playSpeedMenu->addSeparator();
m_defaultAnimSpeedAction =
playSpeedMenu->addAction(tr("1x"), this, SLOT(changeToDefaultAnimSpeed()));
m_defaultAnimSpeedAction->setCheckable(true);
m_defaultAnimSpeedAction->setChecked(true);
playSpeedMenuActions->addAction(m_defaultAnimSpeedAction);
m_playSpeedMenuActions = new QActionGroup(this);
m_playSpeedMenuActions->setExclusive(true);
QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setChecked(true);
speedAction->setData(1.0f);
m_playSpeedMenuActions->addAction(speedAction);
m_halfAnimSpeedAction =
playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeToHalfAnimSpeed()));
m_halfAnimSpeedAction->setCheckable(true);
playSpeedMenuActions->addAction(m_halfAnimSpeedAction);
speedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setData(2.0f);
m_playSpeedMenuActions->addAction(speedAction);
m_fourthAnimSpeedAction =
playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeToFourthAnimSpeed()));
m_fourthAnimSpeedAction->setCheckable(true);
playSpeedMenuActions->addAction(m_fourthAnimSpeedAction);
speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setData(4.0f);
m_playSpeedMenuActions->addAction(speedAction);
m_eighthAnimSpeedAction =
playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeToEighthAnimSpeed()));
m_eighthAnimSpeedAction->setCheckable(true);
playSpeedMenuActions->addAction(m_eighthAnimSpeedAction);
speedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setData(8.0f);
m_playSpeedMenuActions->addAction(speedAction);
m_tenthAnimSpeedAction =
playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeToTenthAnimSpeed()));
m_tenthAnimSpeedAction->setCheckable(true);
playSpeedMenuActions->addAction(m_tenthAnimSpeedAction);
m_menuPauseAction = playSpeedMenu->addAction(tr("Pause"), this, SLOT(updatePauseAction()));
m_menuPauseAction->setCheckable(true);
m_menuPauseAction->setIcon(m_pauseIcon);
playSpeedMenuActions->addAction(m_menuPauseAction);
speedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeAnimationSpeed()));
speedAction->setCheckable(true);
speedAction->setData(10.0f);
m_playSpeedMenuActions->addAction(speedAction);
QHBoxLayout *toolBarLayout = new QHBoxLayout(m_barWidget);
toolBarLayout->setMargin(0);
@@ -324,33 +313,13 @@ QWidget *QmlInspectorToolBar::widget() const
return m_barWidget;
}
void QmlInspectorToolBar::changeToDefaultAnimSpeed()
void QmlInspectorToolBar::changeAnimationSpeed()
{
m_animationSpeed = 1.0f;
updatePlayAction();
}
QAction *action = static_cast<QAction*>(sender());
void QmlInspectorToolBar::changeToHalfAnimSpeed()
{
m_animationSpeed = 2.0f;
updatePlayAction();
}
m_animationSpeed = action->data().toReal();
emit animationSpeedChanged(m_animationSpeed);
void QmlInspectorToolBar::changeToFourthAnimSpeed()
{
m_animationSpeed = 4.0f;
updatePlayAction();
}
void QmlInspectorToolBar::changeToEighthAnimSpeed()
{
m_animationSpeed = 8.0f;
updatePlayAction();
}
void QmlInspectorToolBar::changeToTenthAnimSpeed()
{
m_animationSpeed = 10.0f;
updatePlayAction();
}
@@ -368,34 +337,14 @@ void QmlInspectorToolBar::activateDesignModeOnClick()
void QmlInspectorToolBar::activatePlayOnClick()
{
if (m_isRunning) {
updatePauseAction();
} else {
updatePlayAction();
}
m_paused = !m_paused;
emit animationPausedChanged(m_paused);
updatePlayAction();
}
void QmlInspectorToolBar::updatePlayAction()
{
m_isRunning = true;
m_playAction->setIcon(m_pauseIcon);
if (m_animationSpeed != m_previousAnimationSpeed)
m_previousAnimationSpeed = m_animationSpeed;
if (m_emitSignals)
emit animationSpeedChanged(m_animationSpeed);
m_playButton->setDefaultAction(m_playAction);
}
void QmlInspectorToolBar::updatePauseAction()
{
m_isRunning = false;
m_playAction->setIcon(m_playIcon);
if (m_emitSignals)
emit animationSpeedChanged(0.0f);
m_playButton->setDefaultAction(m_playAction);
m_playAction->setIcon(m_paused ? m_playIcon : m_pauseIcon);
}
void QmlInspectorToolBar::activateColorPickerOnClick()

View File

@@ -40,6 +40,7 @@
#include <QtGui/QIcon>
QT_FORWARD_DECLARE_CLASS(QAction)
QT_FORWARD_DECLARE_CLASS(QActionGroup)
QT_FORWARD_DECLARE_CLASS(QColor)
QT_FORWARD_DECLARE_CLASS(QToolButton)
@@ -84,7 +85,10 @@ public slots:
void activateColorPicker();
void activateSelectTool();
void activateZoomTool();
void setAnimationSpeed(qreal slowdownFactor);
void setAnimationSpeed(qreal slowDownFactor);
void setAnimationPaused(bool paused);
void setDesignModeBehavior(bool inDesignMode);
void setShowAppOnTop(bool showAppOnTop);
void setSelectedColor(const QColor &color);
@@ -99,7 +103,9 @@ signals:
void zoomToolSelected();
void showAppOnTopSelected(bool isChecked);
void animationSpeedChanged(qreal slowdownFactor = 1.0f);
void animationSpeedChanged(qreal slowdownFactor);
void animationPausedChanged(bool paused);
private slots:
void activateDesignModeOnClick();
@@ -110,16 +116,11 @@ private slots:
void showAppOnTopClick();
void changeToDefaultAnimSpeed();
void changeToHalfAnimSpeed();
void changeToFourthAnimSpeed();
void changeToEighthAnimSpeed();
void changeToTenthAnimSpeed();
void changeAnimationSpeed();
void activateFromQml();
void updatePlayAction();
void updatePauseAction();
void activeDebugLanguagesChanged(Debugger::DebuggerLanguages languages);
@@ -135,12 +136,7 @@ private:
QAction *m_showAppOnTopAction;
QAction *m_defaultAnimSpeedAction;
QAction *m_halfAnimSpeedAction;
QAction *m_fourthAnimSpeedAction;
QAction *m_eighthAnimSpeedAction;
QAction *m_tenthAnimSpeedAction;
QAction *m_menuPauseAction;
QActionGroup *m_playSpeedMenuActions;
QToolButton *m_playButton;
QIcon m_playIcon;
@@ -149,9 +145,8 @@ private:
ToolBarColorBox *m_colorBox;
bool m_emitSignals;
bool m_isRunning;
bool m_paused;
qreal m_animationSpeed;
qreal m_previousAnimationSpeed;
DesignTool m_activeTool;

View File

@@ -86,6 +86,8 @@ void ClientProxy::connectToServer()
SIGNAL(selectMarqueeToolActivated()));
connect(m_observerClient, SIGNAL(animationSpeedChanged(qreal)),
SIGNAL(animationSpeedChanged(qreal)));
connect(m_observerClient, SIGNAL(animationPausedChanged(bool)),
SIGNAL(animationPausedChanged(bool)));
connect(m_observerClient, SIGNAL(designModeBehaviorChanged(bool)),
SIGNAL(designModeBehaviorChanged(bool)));
connect(m_observerClient, SIGNAL(showAppOnTopChanged(bool)),
@@ -545,10 +547,16 @@ void ClientProxy::setDesignModeBehavior(bool inDesignMode)
m_observerClient->setDesignModeBehavior(inDesignMode);
}
void ClientProxy::setAnimationSpeed(qreal slowdownFactor)
void ClientProxy::setAnimationSpeed(qreal slowDownFactor)
{
if (isConnected())
m_observerClient->setAnimationSpeed(slowdownFactor);
m_observerClient->setAnimationSpeed(slowDownFactor);
}
void ClientProxy::setAnimationPaused(bool paused)
{
if (isConnected())
m_observerClient->setAnimationPaused(paused);
}
void ClientProxy::changeToColorPickerTool()

View File

@@ -106,7 +106,8 @@ signals:
void selectToolActivated();
void selectMarqueeToolActivated();
void zoomToolActivated();
void animationSpeedChanged(qreal slowdownFactor);
void animationSpeedChanged(qreal slowDownFactor);
void animationPausedChanged(bool paused);
void designModeBehaviorChanged(bool inDesignMode);
void showAppOnTopChanged(bool showAppOnTop);
void serverReloaded();
@@ -120,7 +121,8 @@ public slots:
void reloadQmlViewer();
void setDesignModeBehavior(bool inDesignMode);
void setAnimationSpeed(qreal slowdownFactor = 1.0f);
void setAnimationSpeed(qreal slowDownFactor);
void setAnimationPaused(bool paused);
void changeToColorPickerTool();
void changeToZoomTool();
void changeToSelectTool();

View File

@@ -884,6 +884,8 @@ void InspectorUi::connectSignals()
m_toolBar, SLOT(setSelectedColor(QColor)));
connect(m_clientProxy, SIGNAL(animationSpeedChanged(qreal)),
m_toolBar, SLOT(setAnimationSpeed(qreal)));
connect(m_clientProxy, SIGNAL(animationPausedChanged(bool)),
m_toolBar, SLOT(setAnimationPaused(bool)));
connect(m_toolBar, SIGNAL(applyChangesFromQmlFileTriggered(bool)),
this, SLOT(setApplyChangesToQmlObserver(bool)));
@@ -894,6 +896,8 @@ void InspectorUi::connectSignals()
m_clientProxy, SLOT(reloadQmlViewer()));
connect(m_toolBar, SIGNAL(animationSpeedChanged(qreal)),
m_clientProxy, SLOT(setAnimationSpeed(qreal)));
connect(m_toolBar, SIGNAL(animationPausedChanged(bool)),
m_clientProxy, SLOT(setAnimationPaused(bool)));
connect(m_toolBar, SIGNAL(colorPickerSelected()),
m_clientProxy, SLOT(changeToColorPickerTool()));
connect(m_toolBar, SIGNAL(zoomToolSelected()),

View File

@@ -106,12 +106,21 @@ void QmlJSObserverClient::messageReceived(const QByteArray &message)
break;
}
case ObserverProtocol::AnimationSpeedChanged: {
qreal slowdownFactor;
ds >> slowdownFactor;
qreal slowDownFactor;
ds >> slowDownFactor;
log(LogReceive, type, QString::number(slowdownFactor));
log(LogReceive, type, QString::number(slowDownFactor));
emit animationSpeedChanged(slowdownFactor);
emit animationSpeedChanged(slowDownFactor);
break;
}
case ObserverProtocol::AnimationPausedChanged: {
bool paused;
ds >> paused;
log(LogReceive, type, paused ? QLatin1String("true") : QLatin1String("false"));
emit animationPausedChanged(paused);
break;
}
case ObserverProtocol::SetDesignMode: {
@@ -291,7 +300,7 @@ void QmlJSObserverClient::setDesignModeBehavior(bool inDesignMode)
sendMessage(message);
}
void QmlJSObserverClient::setAnimationSpeed(qreal slowdownFactor)
void QmlJSObserverClient::setAnimationSpeed(qreal slowDownFactor)
{
if (!m_connection || !m_connection->isConnected())
return;
@@ -301,10 +310,27 @@ void QmlJSObserverClient::setAnimationSpeed(qreal slowdownFactor)
ObserverProtocol::Message cmd = ObserverProtocol::SetAnimationSpeed;
ds << cmd
<< slowdownFactor;
<< slowDownFactor;
log(LogSend, cmd, QString::number(slowdownFactor));
log(LogSend, cmd, QString::number(slowDownFactor));
sendMessage(message);
}
void QmlJSObserverClient::setAnimationPaused(bool paused)
{
if (!m_connection || !m_connection->isConnected())
return;
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ObserverProtocol::Message cmd = ObserverProtocol::SetAnimationPaused;
ds << cmd
<< paused;
log(LogSend, cmd, paused ? QLatin1String("true") : QLatin1String("false"));
sendMessage(message);
}

View File

@@ -59,7 +59,8 @@ public:
void setCurrentObjects(const QList<int> &debugIds);
void reloadViewer();
void setDesignModeBehavior(bool inDesignMode);
void setAnimationSpeed(qreal slowdownFactor);
void setAnimationSpeed(qreal slowDownFactor);
void setAnimationPaused(bool paused);
void changeToColorPickerTool();
void changeToSelectTool();
void changeToSelectMarqueeTool();
@@ -92,6 +93,7 @@ signals:
void selectMarqueeToolActivated();
void zoomToolActivated();
void animationSpeedChanged(qreal slowdownFactor);
void animationPausedChanged(bool paused);
void designModeBehaviorChanged(bool inDesignMode);
void showAppOnTopChanged(bool showAppOnTop);
void reloaded(); // the server has reloadetd he document

View File

@@ -188,12 +188,11 @@ QString QmlProjectRunConfiguration::canonicalCapsPath(const QString &fileName)
QString canonicalPath = QFileInfo(fileName).canonicalFilePath();
#if defined(Q_OS_WIN32)
QString error;
// don't know whether the shortpath step is really needed,
// but we do this in QtDeclarative too.
QString path = Utils::getShortPathName(canonicalPath, &error);
QString path = Utils::getShortPathName(canonicalPath);
if (!path.isEmpty())
path = Utils::getLongPathName(canonicalPath, &error);
path = Utils::getLongPathName(canonicalPath);
if (!path.isEmpty())
canonicalPath = path;
#endif

View File

@@ -50,7 +50,7 @@ ProjectLoadWizard::ProjectLoadWizard(Qt4Project *project, QWidget *parent, Qt::W
{
Q_ASSERT(project);
setWindowTitle(tr("Project setup"));
setWindowTitle(tr("Project Setup"));
setupTargetPage();

View File

@@ -148,12 +148,31 @@ bool S60DeployConfiguration::isStaticLibrary(const Qt4ProFileNode &projectNode)
return false;
}
bool S60DeployConfiguration::isApplication(const Qt4ProFileNode &projectNode) const
{
return projectNode.projectType() == ApplicationTemplate;
}
bool S60DeployConfiguration::isDeployable(const Qt4ProFileNode &projectNode) const
{
const QStringList &deployment(projectNode.variableValue(Deployment));
// default_*deployment are default for DEPLOYMENT
const char * defaultDeploymentStart = "default_";
const char * defaultDeploymentEnd = "deployment";
//we need to filter out the default_*deployment
for (int i = deployment.count() - 1; i >= 0; --i) {
const QString var = deployment.at(i);
if (!var.startsWith(QLatin1String(defaultDeploymentStart))
|| !var.endsWith(QLatin1String(defaultDeploymentEnd)))
return true;
}
return false;
}
bool S60DeployConfiguration::hasSisPackage(const Qt4ProFileNode &projectNode) const
{
if (projectNode.projectType() != ApplicationTemplate
&& projectNode.projectType() != LibraryTemplate)
return false;
return !isStaticLibrary(projectNode);
return isDeployable(projectNode) || isApplication(projectNode);
}
QStringList S60DeployConfiguration::signedPackages() const

View File

@@ -130,7 +130,9 @@ private:
QString symbianTarget() const;
QString createPackageName(const QString &baseName) const;
bool isDebug() const;
bool isDeployable(const Qt4ProFileNode &projectNode) const;
bool isStaticLibrary(const Qt4ProFileNode &projectNode) const;
bool isApplication(const Qt4ProFileNode &projectNode) const;
bool hasSisPackage(const Qt4ProFileNode &projectNode) const;
private:

View File

@@ -1745,6 +1745,7 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
QLatin1String("QML_IMPORT_PATH"), m_projectDir);
newVarValues[Makefile] = m_readerExact->values("MAKEFILE");
newVarValues[SymbianCapabilities] = m_readerExact->values("TARGET.CAPABILITY");
newVarValues[Deployment] = m_readerExact->values("DEPLOYMENT");
if (m_varValues != newVarValues) {
Qt4VariablesHash oldValues = m_varValues;

View File

@@ -104,7 +104,8 @@ enum Qt4Variable {
ConfigVar,
QmlImportPathVar,
Makefile,
SymbianCapabilities
SymbianCapabilities,
Deployment
};
class Qt4PriFileNode;

View File

@@ -191,7 +191,7 @@ void Qt4Manager::updateVariable(const QString &variable)
return;
}
QString value = qt4pro->activeTarget()->activeBuildConfiguration()
->qtVersion()->versionInfo().value(QLatin1String(kInstallBins));
->qtVersion()->versionInfo().value(QLatin1String("QT_INSTALL_BINS"));
Core::VariableManager::instance()->insert(QLatin1String(kInstallBins), value);
}
}

View File

@@ -613,7 +613,7 @@ void Qt4DefaultTargetSetupWidget::addImportClicked()
}
if (!info.version->supportsTargetId(m_id)) {
QMessageBox::critical(Core::ICore::instance()->mainWindow(),
QMessageBox::critical(this,
tr("Incompatible build found"),
tr("The Build found in %1 is incompatible with this target").arg(m_importLinePath->path()));
return;
@@ -720,6 +720,8 @@ void Qt4DefaultTargetSetupWidget::createImportWidget(const BuildConfigurationInf
QCheckBox *checkBox = new QCheckBox;
checkBox->setText(tr("Import build from %1").arg(info.directory));
checkBox->setChecked(m_importEnabled.at(pos));
if (info.version)
checkBox->setToolTip(info.version->toHtml(false));
m_importLayout->addWidget(checkBox, pos, 0, 1, 2);
connect(checkBox, SIGNAL(toggled(bool)),
@@ -738,6 +740,8 @@ void Qt4DefaultTargetSetupWidget::setupWidgets()
QCheckBox *checkbox = new QCheckBox;
checkbox->setText(displayNameFrom(info));
checkbox->setChecked(m_enabled.at(i));
if (info.version)
checkbox->setToolTip(info.version->toHtml(false));
m_newBuildsLayout->addWidget(checkbox, i * 2, 0);
Utils::PathChooser *pathChooser = new Utils::PathChooser();

View File

@@ -230,7 +230,7 @@ bool QtOptionsPageWidget::eventFilter(QObject *o, QEvent *e)
const int index = indexForTreeItem(item);
if (index == -1)
return false;
const QString tooltip = m_versions.at(index)->toHtml();
const QString tooltip = m_versions.at(index)->toHtml(true);
QToolTip::showText(helpEvent->globalPos(), tooltip, m_ui->qtdirList);
helpEvent->accept();
return true;
@@ -575,10 +575,14 @@ void QtOptionsPageWidget::updateDebuggingHelperUi()
const bool hasLog = currentItem && !currentItem->data(0, BuildLogRole).toString().isEmpty();
m_debuggingHelperUi->showLogButton->setEnabled(hasLog);
m_debuggingHelperUi->rebuildButton->setEnabled(!isBuildingGdbHelper
&& !isBuildingQmlDumper
&& !isBuildingQmlDebuggingLib
&& !isBuildingQmlObserver);
m_debuggingHelperUi->rebuildButton->setEnabled((!isBuildingGdbHelper
&& !isBuildingQmlDumper
&& !isBuildingQmlDebuggingLib
&& !isBuildingQmlObserver)
&& (canBuildGdbHelper
|| canBuildQmlDumper
|| canBuildQmlDebuggingLib
|| canBuildQmlObserver));
m_ui->debuggingHelperWidget->setVisible(true);
}

View File

@@ -698,7 +698,7 @@ QtVersion::~QtVersion()
{
}
QString QtVersion::toHtml() const
QString QtVersion::toHtml(bool verbose) const
{
QString rc;
QTextStream str(&rc);
@@ -729,11 +729,13 @@ QString QtVersion::toHtml() const
} // default config.
str << "<tr><td><b>" << QtVersionManager::tr("Version:")
<< "</b></td><td>" << qtVersionString() << "</td></tr>";
const QHash<QString,QString> vInfo = versionInfo();
if (!vInfo.isEmpty()) {
const QHash<QString,QString>::const_iterator vcend = vInfo.constEnd();
for (QHash<QString,QString>::const_iterator it = vInfo.constBegin(); it != vcend; ++it)
str << "<tr><td><pre>" << it.key() << "</pre></td><td>" << it.value() << "</td></tr>";
if (verbose) {
const QHash<QString,QString> vInfo = versionInfo();
if (!vInfo.isEmpty()) {
const QHash<QString,QString>::const_iterator vcend = vInfo.constEnd();
for (QHash<QString,QString>::const_iterator it = vInfo.constBegin(); it != vcend; ++it)
str << "<tr><td><pre>" << it.key() << "</pre></td><td>" << it.value() << "</td></tr>";
}
}
}
str << "</table></body></html>";

View File

@@ -182,7 +182,7 @@ public:
Q_DECLARE_FLAGS(QmakeBuildConfigs, QmakeBuildConfig)
QmakeBuildConfigs defaultBuildConfig() const;
QString toHtml() const;
QString toHtml(bool verbose) const;
bool supportsShadowBuilds() const;

View File

@@ -94,12 +94,12 @@
<string>The path in which the directory containing the checkout will be created.</string>
</property>
<property name="text">
<string>Checkout Path:</string>
<string>Checkout path:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Utils::PathChooser" name="pathChooser"/>
<widget class="Utils::PathChooser" name="pathChooser" native="true"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="checkoutDirectoryLabel">
@@ -107,7 +107,7 @@
<string>The local directory that will contain the code after the checkout.</string>
</property>
<property name="text">
<string>Checkout Directory:</string>
<string>Checkout directory:</string>
</property>
</widget>
</item>