Commit 914adeab authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/3.2'

Conflicts:
	src/plugins/qmldesigner/designercore/model/plaintexteditmodifier.cpp
	src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp

Change-Id: I1627f6aa98a442413f8b08b579ecaf9647dc887b
parents 11f89ece a4db6db3
Qt Creator version 3.2.1 is a bugfix release.
The most important changes are listed in this document. For a complete
list of changes, see the Git log for the Qt Creator sources that
you can check out from the public Git repository. For example:
git clone git://gitorious.org/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline v3.2.0..v3.2.1
General
* Fixed freeze when using shortcut for all projects or current project
locator filters (QTCREATORBUG-12875)
* Fixed crash when activating timers by removing the unsupported UpdateInfo
plugin that triggered it (QTCREATORBUG-11262)
Qbs Projects
* Fixed adding and removing files when project file is write protected by VCS
* Fixed crash when removing empty install step
C++ Support
* Fixed crash when opening context menu on macro parameter (QTCREATORBUG-12853)
QML Support
* Added missing members to date objects
* Added templates for Qt Quick 2.3 and Qt Quick Controls 1.2 applications
* Fixed keyboard shortcuts in QML/JS console (QTCREATORBUG-12956)
Qt Quick Designer
* Added option to use fallback QML puppet and set it to be the default
* Fixed updating of color properties (QTCREATORBUG-12841)
* Fixed duplication of ApplicationWindow properties (QTCREATORBUG-12910)
Platform Specific
OS X
* Fixed deployment of Clang library in binary packages
* Fixed deployment of fallback QML puppets in binary packages
* Removed wrong File > Exit menu item
iOS
* Fixed determination of newest SDK version when no version is explicitly stated
Remote Linux
* Fixed mixed QML and C++ debugging (QTCREATORBUG-12928)
* Fixed check for maximum packet size for SSH connections (QTCREATORBUG-12884)
Windows Phone
* Fixed font deployment for Windows Phone 8.0
......@@ -75,8 +75,8 @@
\list
\li Select \gui {Qt Quick Controls 1.1} or \gui {Qt Quick 2.2} to
develop for platforms that run Qt 5.
\li Select \gui {Qt Quick Controls} or \gui {Qt Quick 2.1}, or
later, to develop for platforms that run Qt 5.
\li Select \gui {Qt Quick 1.1} to develop for platforms that run
Qt 4.7.4. To develop for platforms that run Qt 4.7.1, 4.7.2, or
......
......@@ -17,11 +17,14 @@
****************************************************************************/
//! [0]
\badcode
otool -L /Developer/Applications/Qt/plugins/designer/libqwt_designer_plugin.dylib
\endcode
//! [0]
//! [1]
\badcode
/Developer/Applications/Qt/plugins/designer/libqwt_designer_plugin.dylib:
libqwt_designer_plugin.dylib (compatibility version 0.0.0, current version 0.0.0)
libqwt.5.dylib (compatibility version 5.2.0, current version 5.2.1)
......@@ -33,14 +36,18 @@ otool -L /Developer/Applications/Qt/plugins/designer/libqwt_designer_plugin.dyli
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 438.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1)
\endcode
//! [1]
//! [2]
\badcode
otool -L /usr/local/qwt-5.2.1/lib/libqwt.5.dylib
\endcode
//! [2]
//! [3]
\badcode
/usr/local/qwt-5.2.1/lib/libqwt.5.dylib:
libqwt.5.dylib (compatibility version 5.2.0, current version 5.2.1)
QtGui.framework/Versions/4/QtGui (compatibility version 4.6.0, current version 4.6.2)
......@@ -48,18 +55,22 @@ otool -L /usr/local/qwt-5.2.1/lib/libqwt.5.dylib
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 438.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1)
\endcode
//! [3]
//! [4]
\badcode
sudo cp /Developer/Applications/Qt/plugins/designer/libqwt_designer_plugin.dylib \
/Developer/Applications/Qt/Qt\ Creator.app/Contents/MacOS/designer
sudo cp -R /usr/local/qwt-5.2.1/lib/* \
/Developer/Applications/Qt/Qt\ Creator.app/Contents/Frameworks/
\endcode
//! [4]
//! [5]
\badcode
cd /Developer/Applications/Qt/Qt\ Creator.app/Contents/MacOS/designer
sudo install_name_tool -change
QtCore.framework/Versions/4/QtCore \
......@@ -90,4 +101,6 @@ sudo install_name_tool -change \
QtGui.framework/Versions/4/QtGui \
@executable_path/../Frameworks/libQtGui.4.dylib \
libqwt.5.2.1.dylib
\endcode
//! [5]
......@@ -85,13 +85,13 @@
\li To check the paths used in the Qwt library, enter the following
\c otool command:
\snippet doc_src_plugins.qdoc 0
\include doc_src_plugins.qdocinc 0
The output for Qwt 5.2.1 indicates that the plugin uses Qt core
libraries (QtDesigner, QtScript, QtXml, QtGui and QtCore) and
libqwt.5.dylib:
\snippet doc_src_plugins.qdoc 1
\include doc_src_plugins.qdocinc 1
\li You must copy the \QD plugin and the Qwt library files to the
......@@ -108,21 +108,21 @@
Enter the following commands:
\snippet doc_src_plugins.qdoc 4
\include doc_src_plugins.qdocinc 4
\li Enter the following \c otool command to check the libraries that are
used by the Qwt library:
\snippet doc_src_plugins.qdoc 2
\include doc_src_plugins.qdocinc 2
The command returns the following output:
\snippet doc_src_plugins.qdoc 3
\include doc_src_plugins.qdocinc 3
\li Enter the following \c install_name_tool command to fix the
references of the libraries:
\snippet doc_src_plugins.qdoc 5
\include doc_src_plugins.qdocinc 5
\endlist
......
......@@ -24,12 +24,12 @@ if [ -d "$5" ]; then
fi
qmlpuppetapp="$1/Contents/MacOS/qmlpuppet"
if [ -d "$qmlpuppetapp" ]; then
if [ -f "$qmlpuppetapp" ]; then
qmlpuppetArgument="-executable=$qmlpuppetapp"
fi
qml2puppetapp="$1/Contents/MacOS/qml2puppet"
if [ -d "$qml2puppetapp" ]; then
if [ -f "$qml2puppetapp" ]; then
qml2puppetArgument="-executable=$qml2puppetapp"
fi
......
......@@ -13,6 +13,12 @@ Rectangle {
onStatusBarChanged: { if (statusBar) { statusBar.parent = statusBarArea } }
onToolBarChanged: { if (toolBar) { toolBar.parent = toolBarArea } }
property int maximumWidth: 0
property int minimumWidth: 0
property int maximumHeight: 0
property int minimumHeight: 0
Item {
id: contentArea
anchors.top: toolBarArea.bottom
......
......@@ -475,33 +475,21 @@ PropertyNameList ObjectNodeInstance::ignoredProperties() const
QVariant ObjectNodeInstance::convertEnumToValue(const QVariant &value, const PropertyName &name)
{
int idx = object()->metaObject()->indexOfProperty(name);
QMetaProperty metaProperty = object()->metaObject()->property(idx);
QVariant fixedValue = fixResourcePaths(value);
if (value.canConvert<Enumeration>()) {
Enumeration enumeration = value.value<Enumeration>();
if (metaProperty.isValid() && metaProperty.isEnumType()) {
fixedValue = metaProperty.enumerator().keyToValue(enumeration.name());
} else if (metaProperty.isValid()
&& (QLatin1String(metaProperty.typeName()) == QLatin1String("int"))) {
//If the target property is an integer handle an enum as binding
QQmlExpression expression(context(), object(), enumeration.toString());
fixedValue = expression.evaluate();
if (expression.hasError())
qDebug() << "Enum can not be evaluated:" << object() << name << enumeration;
} else if (!metaProperty.isValid()) { //In this case this is most likely an attached property
QQmlExpression expression(context(), object(), enumeration.toString());
fixedValue = expression.evaluate();
if (expression.hasError())
qDebug() << "Enum can not be evaluated:" << object() << name << enumeration;
}
Q_ASSERT(value.canConvert<Enumeration>());
int propertyIndex = object()->metaObject()->indexOfProperty(name);
QMetaProperty metaProperty = object()->metaObject()->property(propertyIndex);
QVariant adjustedValue;
Enumeration enumeration = value.value<Enumeration>();
if (metaProperty.isValid() && metaProperty.isEnumType()) {
adjustedValue = metaProperty.enumerator().keyToValue(enumeration.name());
} else {
QQmlExpression expression(context(), object(), enumeration.toString());
adjustedValue = expression.evaluate();
if (expression.hasError())
qDebug() << "Enumeration can not be evaluated:" << object() << name << enumeration;
}
return fixedValue;
return adjustedValue;
}
void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
......@@ -514,8 +502,12 @@ void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVar
if (!property.isValid())
return;
QVariant fixedValue = fixResourcePaths(value);
fixedValue = convertEnumToValue(fixedValue, name);
QVariant adjustedValue;
if (value.canConvert<Enumeration>())
adjustedValue = convertEnumToValue(value, name);
else
adjustedValue = fixResourcePaths(value);
QVariant oldValue = property.read();
if (oldValue.type() == QVariant::Url) {
......@@ -529,10 +521,10 @@ void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVar
QQmlPropertyPrivate::setBinding(property, 0, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding);
}
bool isWritten = property.write(convertSpecialCharacter(fixedValue));
bool isWritten = property.write(convertSpecialCharacter(adjustedValue));
if (!isWritten)
qDebug() << "ObjectNodeInstance.setPropertyVariant: Cannot be written: " << object() << name << fixedValue;
qDebug() << "ObjectNodeInstance.setPropertyVariant: Cannot be written: " << object() << name << adjustedValue;
QVariant newValue = property.read();
if (newValue.type() == QVariant::Url) {
......
......@@ -57,7 +57,8 @@ ButtonRow {
onClicked: {
if (checked) {
anchorBackend.verticalCentered = false;
if (anchorBackend.bottomAnchored)
anchorBackend.verticalCentered = false;
anchorBackend.topAnchored = true;
} else {
anchorBackend.topAnchored = false;
......@@ -75,7 +76,8 @@ ButtonRow {
onClicked: {
if (checked) {
anchorBackend.verticalCentered = false;
if (anchorBackend.topAnchored)
anchorBackend.verticalCentered = false;
anchorBackend.bottomAnchored = true;
} else {
anchorBackend.bottomAnchored = false;
......@@ -94,7 +96,8 @@ ButtonRow {
onClicked: {
if (checked) {
anchorBackend.horizontalCentered = false;
if (anchorBackend.rightAnchored)
anchorBackend.horizontalCentered = false;
anchorBackend.leftAnchored = true;
} else {
anchorBackend.leftAnchored = false;
......@@ -112,7 +115,8 @@ ButtonRow {
onClicked: {
if (checked) {
anchorBackend.horizontalCentered = false;
if (anchorBackend.leftAnchored)
anchorBackend.horizontalCentered = false;
anchorBackend.rightAnchored = true;
} else {
anchorBackend.rightAnchored = false;
......@@ -156,8 +160,10 @@ ButtonRow {
onClicked: {
if (checked) {
anchorBackend.topAnchored = false;
anchorBackend.bottomAnchored = false;
if (anchorBackend.topAnchored && anchorBackend.bottomAnchored) {
anchorBackend.topAnchored = false;
anchorBackend.bottomAnchored = false;
}
anchorBackend.verticalCentered = true;
} else {
anchorBackend.verticalCentered = false;
......@@ -175,8 +181,10 @@ ButtonRow {
onClicked: {
if (checked) {
anchorBackend.leftAnchored = false;
anchorBackend.rightAnchored = false;
if (anchorBackend.leftAnchored && anchorBackend.rightAnchored) {
anchorBackend.leftAnchored = false;
anchorBackend.rightAnchored = false;
}
anchorBackend.horizontalCentered = true;
} else {
anchorBackend.horizontalCentered = false;
......
......@@ -6,6 +6,7 @@ SpinBox {
maximumValue: 9999999
minimumValue: -9999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.%2
Layout.fillWidth: true
Layout.maximumWidth: 100
......
......@@ -22,8 +22,9 @@ AutoTypes {
typeNames: ["bool", "boolean"]
sourceFile: "BooleanEditorTemplate.template"
}
Type {
typeNames: ["color", "QColor"]
sourceFile: "ColorEditorTemplate.template"
sourceFile: "StringEditorTemplate.template"
}
}
......@@ -47,8 +47,8 @@ Column {
SecondColumnLayout {
SpinBox {
backendValue: backendValues.spacing
minimumValue: 0
maximumValue: 2000
minimumValue: -4000
maximumValue: 4000
decimals: 0
}
......
......@@ -78,8 +78,8 @@ Column {
SecondColumnLayout {
SpinBox {
backendValue: backendValues.spacing
minimumValue: 0
maximumValue: 2000
minimumValue: -4000
maximumValue: 4000
decimals: 0
}
......
......@@ -109,8 +109,8 @@ Column {
SecondColumnLayout {
SpinBox {
backendValue: backendValues.spacing
minimumValue: 0
maximumValue: 2000
minimumValue: -4000
maximumValue: 4000
decimals: 0
}
......
......@@ -61,8 +61,8 @@ Column {
SecondColumnLayout {
SpinBox {
backendValue: backendValues.spacing
minimumValue: 0
maximumValue: 2000
minimumValue: -4000
maximumValue: 4000
decimals: 0
}
......
/* File generated by Qt Creator, version 2.7.0 */
/* File generated by Qt Creator */
import QmlProject 1.1
......
/* File generated by Qt Creator, version 2.7.0 */
/* File generated by Qt Creator */
import QmlProject 1.1
......
/* File generated by Qt Creator, version 2.7.0 */
/* File generated by Qt Creator */
import QmlProject 1.1
......
/* File generated by Qt Creator, version 2.7.0 */
/* File generated by Qt Creator */
import QmlProject 1.1
......
/* File generated by Qt Creator, version 2.7.0 */
/* File generated by Qt Creator */
import QmlProject 1.1
......
......@@ -525,10 +525,24 @@ public:
}
};
class UnsupportedRootObjectTypesByVisualDesigner : public QStringList
{
public:
UnsupportedRootObjectTypesByVisualDesigner()
{
(*this) << QLatin1String("QtObject") << QLatin1String("ListModel")
<< QLatin1String("Component") << QLatin1String("Timer")
<< QLatin1String("Package");
}
};
} // end of anonymous namespace
Q_GLOBAL_STATIC(VisualAspectsPropertyBlackList, visualAspectsPropertyBlackList)
Q_GLOBAL_STATIC(UnsupportedTypesByVisualDesigner, unsupportedTypesByVisualDesigner)
Q_GLOBAL_STATIC(UnsupportedRootObjectTypesByVisualDesigner, unsupportedRootObjectTypesByVisualDesigner)
Check::Check(Document::Ptr doc, const ContextPtr &context)
: _doc(doc)
......@@ -559,6 +573,7 @@ Check::Check(Document::Ptr doc, const ContextPtr &context)
disableMessage(WarnReferenceToParentItemNotSupportedByVisualDesigner);
disableMessage(WarnUndefinedValueForVisualDesigner);
disableMessage(WarnStatesOnlyInRootItemForVisualDesigner);
disableMessage(ErrUnsupportedRootTypeInVisualDesigner);
}
Check::~Check()
......@@ -729,6 +744,13 @@ void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId,
if (m_typeStack.count() > 1 && getRightMostIdentifier(typeId)->name.toString() == QLatin1String("State"))
addMessage(WarnStatesOnlyInRootItemForVisualDesigner, typeErrorLocation);
const QString typeName = getRightMostIdentifier(typeId)->name.toString();
if (m_typeStack.isEmpty()
&& unsupportedRootObjectTypesByVisualDesigner()->contains(typeName))
addMessage(ErrUnsupportedRootTypeInVisualDesigner,
locationFromRange(ast->firstSourceLocation(), ast->lastSourceLocation()), typeName);
bool typeError = false;
if (_importsOk) {
const ObjectValue *prototype = _context->lookupType(_doc.data(), typeId);
......
......@@ -1361,6 +1361,8 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
res.maybeAddPath(pAndL.path().toString());
}
}
foreach (const QString &path, environmentImportPaths())
res.maybeAddPath(path);
break;
}
case Dialect::NoLanguage:
......@@ -1385,6 +1387,11 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
if (res.language == Dialect::AnyLanguage || res.language == Dialect::Qml
|| res.language == Dialect::QmlQtQuick1)
res.maybeAddPath(info.qtQmlPath);
if (res.language == Dialect::AnyLanguage || res.language == Dialect::Qml
|| res.language == Dialect::QmlQtQuick1 || res.language == Dialect::QmlQtQuick2) {
foreach (const QString &path, environmentImportPaths())
res.maybeAddPath(path);
}
break;
}
res.flags = ViewerContext::Complete;
......
......@@ -221,6 +221,8 @@ StaticAnalysisMessages::StaticAnalysisMessages()
tr("Qt Quick Designer only supports states in the root item."));
newMsg(WarnAboutQtQuick1InsteadQtQuick2, Warning,
tr("Using Qt Quick 1 code model instead of Qt Quick 2."));
newMsg(ErrUnsupportedRootTypeInVisualDesigner, Error,
tr("This type is not supported as a root element by Qt Quick Designer %1."), 1);
}
} // anonymous namespace
......
......@@ -97,6 +97,7 @@ enum Type
WarnReferenceToParentItemNotSupportedByVisualDesigner = 205,
WarnUndefinedValueForVisualDesigner = 206,
WarnStatesOnlyInRootItemForVisualDesigner = 207,
ErrUnsupportedRootTypeInVisualDesigner = 208,
ErrUnknownComponent = 300,
ErrCouldNotResolvePrototypeOf = 301,
ErrCouldNotResolvePrototype = 302,
......
......@@ -302,6 +302,9 @@ void SftpChannelPrivate::handleExitStatus(const SshChannelExitStatus &exitStatus
qDebug("Remote SFTP service exited with exit code %d", exitStatus.exitStatus);
#endif
if (channelState() == CloseRequested || channelState() == Closed)
return;
emit channelError(tr("The SFTP server finished unexpectedly with exit code %1.")
.arg(exitStatus.exitStatus));
......
......@@ -39,7 +39,10 @@
namespace QSsh {
namespace Internal {
const quint32 MinMaxPacketSize = 32768;
// "Payload length" (RFC 4253, 6.1), i.e. minus packet type, channel number
// and length field for string.
const quint32 MinMaxPacketSize = 32768 - sizeof(quint32) - sizeof(quint32) - 1;
const quint32 NoChannel = 0xffffffffu;
AbstractSshChannel::AbstractSshChannel(quint32 channelId,
......@@ -151,8 +154,7 @@ void AbstractSshChannel::handleOpenSuccess(quint32 remoteChannelId,
#endif
m_remoteChannel = remoteChannelId;
m_remoteWindowSize = remoteWindowSize;
m_remoteMaxPacketSize = remoteMaxPacketSize - sizeof(quint32) - sizeof m_remoteChannel - 1;
// Original value includes packet type, channel number and length field for string.
m_remoteMaxPacketSize = remoteMaxPacketSize;
setChannelState(SessionEstablished);
handleOpenSuccessInternal();
}
......
......@@ -239,6 +239,8 @@ void Utils::unCommentSelection(QPlainTextEdit *edit, const CommentDefinition &de
}
}
cursor.endEditBlock();
// adjust selection when commenting out
if (hasSelection && !doMultiLineStyleUncomment && !doSingleLineStyleUncomment) {
cursor = edit->textCursor();
......@@ -254,6 +256,4 @@ void Utils::unCommentSelection(QPlainTextEdit *edit, const CommentDefinition &de
}
edit->setTextCursor(cursor);
}
cursor.endEditBlock();
}
......@@ -1562,11 +1562,6 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
QFileInfo fi(workingDir, fileName);
QString topLevel = currentState().topLevel();
QString absPath = fi.absoluteFilePath();
const QString relFile = QDir(topLevel).relativeFilePath(absPath);
const QString file = QDir::toNativeSeparators(relFile);
const QString title = QString::fromLatin1("Checkout %1").arg(file);
CheckOutDialog coDialog(title, m_viewData.isUcm);
if (!m_settings.disableIndexer &&
(fi.isWritable() || vcsStatus(absPath).status == FileStatus::Unknown))
......@@ -1575,6 +1570,12 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
QMessageBox::information(0, tr("ClearCase Checkout"), tr("File is already checked out."));
return true;
}
const QString relFile = QDir(topLevel).relativeFilePath(absPath);
const QString file = QDir::toNativeSeparators(relFile);
const QString title = QString::fromLatin1("Checkout %1").arg(file);
CheckOutDialog coDialog(title, m_viewData.isUcm);
// Only snapshot views can have hijacked files
bool isHijacked = (!m_viewData.isDynamic && (vcsStatus(absPath).status & FileStatus::Hijacked));
if (!isHijacked)
......@@ -1591,9 +1592,11 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
else
args << QLatin1String("-c") << comment;
args << QLatin1String("-query");
if (coDialog.isReserved())
const bool reserved = coDialog.isReserved();
const bool unreserved = !reserved || coDialog.isUnreserved();