forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.9'
Conflicts: src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp src/plugins/qmldesigner/qmldesignerextension/timelineeditor/preseteditor.cpp src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelinesettingsmodel.cpp src/shared/qbs Change-Id: I369368de9b9c682b03e224d489589043e1f6782b
This commit is contained in:
10
dist/changes-4.9.1.md
vendored
10
dist/changes-4.9.1.md
vendored
@@ -14,10 +14,18 @@ Editing
|
||||
QMake Projects
|
||||
|
||||
* Fixed unnecessary reparsing on file save (QTCREATORBUG-22361)
|
||||
* Fixed code model for generated files when specified in `.pri` file
|
||||
(QTCREATORBUG-22395)
|
||||
|
||||
CMake Projects
|
||||
|
||||
* Fixed deployment with `QtCreatorDeployment.txt` (QTCREATORBUG-22184)
|
||||
* Fixed that configuration UI was disabled after configuration error
|
||||
|
||||
Qbs Projects
|
||||
|
||||
* Fixed crash when editing environment variables (QTCREATORBUG-22386)
|
||||
* Fixed handling of `cpp.minimum*Version` (QTCREATORBUG-22355)
|
||||
|
||||
Debugging
|
||||
|
||||
@@ -48,6 +56,7 @@ Remote Linux
|
||||
(QTCREATORBUG-22352)
|
||||
|
||||
Credits for these changes go to:
|
||||
Aaron Barany
|
||||
André Pönitz
|
||||
BogDan Vatra
|
||||
Christian Kandeler
|
||||
@@ -59,6 +68,7 @@ Jonathan Liu
|
||||
Leena Miettinen
|
||||
Mitch Curtis
|
||||
Nikolai Kosjar
|
||||
Orgad Shaneh
|
||||
Robert Löhning
|
||||
Thomas Hartmann
|
||||
Ulf Hermann
|
||||
|
@@ -103,7 +103,7 @@ Column {
|
||||
}
|
||||
|
||||
onHasGradientChanged: {
|
||||
if (!supportGradient)
|
||||
if (!colorEditor.supportGradient)
|
||||
return
|
||||
|
||||
if (gradientLine.hasGradient) {
|
||||
@@ -121,8 +121,9 @@ Column {
|
||||
default:
|
||||
buttonRow.initalChecked = 1
|
||||
}
|
||||
} else {
|
||||
buttonRow.initalChecked = 1
|
||||
}
|
||||
|
||||
colorEditor.color = gradientLine.currentColor
|
||||
} else {
|
||||
buttonRow.initalChecked = 0
|
||||
@@ -216,7 +217,9 @@ Column {
|
||||
iconSource: "images/icon_color_solid.png"
|
||||
|
||||
onClicked: {
|
||||
gradientLine.deleteGradient()
|
||||
if (colorEditor.supportGradient)
|
||||
gradientLine.deleteGradient()
|
||||
|
||||
textField.text = colorEditor.color
|
||||
colorEditor.backendValue.resetValue()
|
||||
}
|
||||
@@ -511,7 +514,8 @@ Column {
|
||||
iconSource: "images/icon_color_none.png"
|
||||
onClicked: {
|
||||
colorEditor.color = "#00000000"
|
||||
gradientLine.deleteGradient()
|
||||
if (colorEditor.supportGradient)
|
||||
gradientLine.deleteGradient()
|
||||
}
|
||||
tooltip: qsTr("Transparent")
|
||||
}
|
||||
|
@@ -349,11 +349,6 @@ void CMakeBuildSettingsWidget::setError(const QString &message)
|
||||
m_errorMessageLabel->setVisible(showError);
|
||||
m_errorMessageLabel->setText(message);
|
||||
m_errorMessageLabel->setToolTip(message);
|
||||
|
||||
m_editButton->setEnabled(!showError);
|
||||
m_unsetButton->setEnabled(!showError);
|
||||
m_resetButton->setEnabled(!showError);
|
||||
m_showAdvancedCheckBox->setEnabled(!showError);
|
||||
}
|
||||
|
||||
void CMakeBuildSettingsWidget::setWarning(const QString &message)
|
||||
|
@@ -175,6 +175,17 @@ static inline QString clientRootFromOutput(const QString &in)
|
||||
return QString();
|
||||
}
|
||||
|
||||
// When p4 port and p4 user is set a preconfigured Root: is given, which doesn't relate with
|
||||
// the current mapped project. In this case "Client:" has the same value as "Host:", which is an
|
||||
// invalid case.
|
||||
static inline bool clientAndHostAreEqual(const QString &in)
|
||||
{
|
||||
QString client = findTerm(in, QLatin1String("Client:"));
|
||||
QString host = findTerm(in, QLatin1String("Host:"));
|
||||
|
||||
return client == host;
|
||||
}
|
||||
|
||||
void PerforceChecker::parseOutput(const QString &response)
|
||||
{
|
||||
if (!response.contains(QLatin1String("View:")) && !response.contains(QLatin1String("//depot/"))) {
|
||||
@@ -182,6 +193,12 @@ void PerforceChecker::parseOutput(const QString &response)
|
||||
return;
|
||||
}
|
||||
|
||||
if (clientAndHostAreEqual(response)) {
|
||||
// Is an invalid case. But not an error. QtC checks cmake install directories for
|
||||
// p4 repositories, or the %temp% directory.
|
||||
return;
|
||||
}
|
||||
|
||||
const QString repositoryRoot = clientRootFromOutput(response);
|
||||
if (repositoryRoot.isEmpty()) {
|
||||
//: Unable to determine root of the p4 client installation
|
||||
|
@@ -80,7 +80,7 @@ CrumbleBar::~CrumbleBar()
|
||||
|
||||
void CrumbleBar::pushFile(const Utils::FileName &fileName)
|
||||
{
|
||||
if (m_isInternalCalled == false) {
|
||||
if (!m_isInternalCalled) {
|
||||
crumblePath()->clear();
|
||||
} else {
|
||||
CrumbleBarInfo lastElementCrumbleBarInfo = crumblePath()->dataForLastIndex().value<CrumbleBarInfo>();
|
||||
|
@@ -79,7 +79,7 @@ CustomFileSystemModel::CustomFileSystemModel(QObject *parent) : QAbstractListMod
|
||||
m_fileSystemModel->setIconProvider(new ItemLibraryFileIconProvider());
|
||||
|
||||
connect(m_fileSystemWatcher, &Utils::FileSystemWatcher::directoryChanged, [this] {
|
||||
setRootPath(m_fileSystemModel->rootPath());
|
||||
updatePath(m_fileSystemModel->rootPath());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ void CustomFileSystemModel::setFilter(QDir::Filters)
|
||||
|
||||
}
|
||||
|
||||
QString filterMetaIcons(const QString &fileName)
|
||||
bool filterMetaIcons(const QString &fileName)
|
||||
{
|
||||
|
||||
QFileInfo info(fileName);
|
||||
@@ -101,7 +101,7 @@ QString filterMetaIcons(const QString &fileName)
|
||||
while (!currentDir.isRoot() && i < 3) {
|
||||
if (currentDir.dirName() == "designer") {
|
||||
if (!currentDir.entryList({"*.metainfo"}).isEmpty())
|
||||
return {};
|
||||
return false;
|
||||
}
|
||||
|
||||
currentDir.cdUp();
|
||||
@@ -109,10 +109,10 @@ QString filterMetaIcons(const QString &fileName)
|
||||
}
|
||||
|
||||
if (info.dir().dirName() == "designer")
|
||||
return {};
|
||||
return false;
|
||||
}
|
||||
|
||||
return fileName;
|
||||
return true;
|
||||
}
|
||||
|
||||
QModelIndex CustomFileSystemModel::setRootPath(const QString &newPath)
|
||||
@@ -120,38 +120,7 @@ QModelIndex CustomFileSystemModel::setRootPath(const QString &newPath)
|
||||
if (m_fileSystemModel->rootPath() == newPath)
|
||||
return QAbstractListModel::index(0, 0);
|
||||
|
||||
beginResetModel();
|
||||
m_fileSystemModel->setRootPath(newPath);
|
||||
|
||||
m_fileSystemWatcher->removeDirectories(m_fileSystemWatcher->directories());
|
||||
|
||||
m_fileSystemWatcher->addDirectory(newPath, Utils::FileSystemWatcher::WatchAllChanges);
|
||||
|
||||
QStringList nameFilterList;
|
||||
|
||||
const QString searchFilter = m_searchFilter;
|
||||
|
||||
if (searchFilter.contains(QLatin1Char('.'))) {
|
||||
nameFilterList.append(QString(QStringLiteral("*%1*")).arg(searchFilter));
|
||||
} else {
|
||||
foreach (const QByteArray &extension, QImageReader::supportedImageFormats()) {
|
||||
nameFilterList.append(QString(QStringLiteral("*%1*.%2")).arg(searchFilter, QString::fromUtf8(extension)));
|
||||
}
|
||||
}
|
||||
|
||||
m_files.clear();
|
||||
|
||||
QDirIterator fileIterator(newPath, nameFilterList, QDir::Files, QDirIterator::Subdirectories);
|
||||
|
||||
while (fileIterator.hasNext())
|
||||
m_files.append(filterMetaIcons(fileIterator.next()));
|
||||
|
||||
QDirIterator dirIterator(newPath, {}, QDir::Dirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||
while (dirIterator.hasNext())
|
||||
m_fileSystemWatcher->addDirectory(dirIterator.next(), Utils::FileSystemWatcher::WatchAllChanges);
|
||||
|
||||
endResetModel();
|
||||
return QAbstractListModel::index(0, 0);
|
||||
return updatePath(newPath);
|
||||
}
|
||||
|
||||
QVariant CustomFileSystemModel::data(const QModelIndex &index, int role) const
|
||||
@@ -210,6 +179,48 @@ void CustomFileSystemModel::setSearchFilter(const QString &nameFilterList)
|
||||
setRootPath(m_fileSystemModel->rootPath());
|
||||
}
|
||||
|
||||
void CustomFileSystemModel::appendIfNotFiltered(const QString &file)
|
||||
{
|
||||
if (filterMetaIcons(file))
|
||||
m_files.append(file);
|
||||
}
|
||||
|
||||
QModelIndex CustomFileSystemModel::updatePath(const QString &newPath)
|
||||
{
|
||||
beginResetModel();
|
||||
m_fileSystemModel->setRootPath(newPath);
|
||||
|
||||
m_fileSystemWatcher->removeDirectories(m_fileSystemWatcher->directories());
|
||||
|
||||
m_fileSystemWatcher->addDirectory(newPath, Utils::FileSystemWatcher::WatchAllChanges);
|
||||
|
||||
QStringList nameFilterList;
|
||||
|
||||
const QString searchFilter = m_searchFilter;
|
||||
|
||||
if (searchFilter.contains(QLatin1Char('.'))) {
|
||||
nameFilterList.append(QString(QStringLiteral("*%1*")).arg(searchFilter));
|
||||
} else {
|
||||
foreach (const QByteArray &extension, QImageReader::supportedImageFormats()) {
|
||||
nameFilterList.append(QString(QStringLiteral("*%1*.%2")).arg(searchFilter, QString::fromUtf8(extension)));
|
||||
}
|
||||
}
|
||||
|
||||
m_files.clear();
|
||||
|
||||
QDirIterator fileIterator(newPath, nameFilterList, QDir::Files, QDirIterator::Subdirectories);
|
||||
|
||||
while (fileIterator.hasNext())
|
||||
appendIfNotFiltered(fileIterator.next());
|
||||
|
||||
QDirIterator dirIterator(newPath, {}, QDir::Dirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||
while (dirIterator.hasNext())
|
||||
m_fileSystemWatcher->addDirectory(dirIterator.next(), Utils::FileSystemWatcher::WatchAllChanges);
|
||||
|
||||
endResetModel();
|
||||
return QAbstractListModel::index(0, 0);
|
||||
}
|
||||
|
||||
QModelIndex CustomFileSystemModel::fileSystemModelIndex(const QModelIndex &index) const
|
||||
{
|
||||
const int row = index.row();
|
||||
|
@@ -61,7 +61,9 @@ public:
|
||||
void setSearchFilter(const QString &nameFilterList);
|
||||
|
||||
private:
|
||||
QModelIndex updatePath(const QString &newPath);
|
||||
QModelIndex fileSystemModelIndex(const QModelIndex &index) const;
|
||||
void appendIfNotFiltered(const QString &file);
|
||||
|
||||
QFileSystemModel *m_fileSystemModel;
|
||||
QStringList m_files;
|
||||
|
@@ -24,7 +24,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qmlanchorbindingproxy.h"
|
||||
#include "abstractview.h"
|
||||
|
||||
#include <exception.h>
|
||||
#include <abstractview.h>
|
||||
#include <qmlanchors.h>
|
||||
#include <nodeabstractproperty.h>
|
||||
#include <variantproperty.h>
|
||||
@@ -359,14 +361,20 @@ void QmlAnchorBindingProxy::setTopTarget(const QString &target)
|
||||
if (!newTarget.isValid())
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setTopTarget"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setTopTarget"));
|
||||
|
||||
m_topTarget = newTarget;
|
||||
m_topTarget = newTarget;
|
||||
|
||||
setDefaultRelativeTopTarget();
|
||||
setDefaultRelativeTopTarget();
|
||||
|
||||
anchorTop();
|
||||
anchorTop();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit topTargetChanged();
|
||||
}
|
||||
@@ -385,12 +393,18 @@ void QmlAnchorBindingProxy::setBottomTarget(const QString &target)
|
||||
if (!newTarget.isValid())
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setBottomTarget"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setBottomTarget"));
|
||||
|
||||
m_bottomTarget = newTarget;
|
||||
setDefaultRelativeBottomTarget();
|
||||
anchorBottom();
|
||||
m_bottomTarget = newTarget;
|
||||
setDefaultRelativeBottomTarget();
|
||||
anchorBottom();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit bottomTargetChanged();
|
||||
}
|
||||
@@ -408,12 +422,18 @@ void QmlAnchorBindingProxy::setLeftTarget(const QString &target)
|
||||
if (!newTarget.isValid())
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setLeftTarget"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setLeftTarget"));
|
||||
|
||||
m_leftTarget = newTarget;
|
||||
setDefaultRelativeLeftTarget();
|
||||
anchorLeft();
|
||||
m_leftTarget = newTarget;
|
||||
setDefaultRelativeLeftTarget();
|
||||
anchorLeft();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit leftTargetChanged();
|
||||
}
|
||||
@@ -431,12 +451,18 @@ void QmlAnchorBindingProxy::setRightTarget(const QString &target)
|
||||
if (!newTarget.isValid())
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRightTarget"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRightTarget"));
|
||||
|
||||
m_rightTarget = newTarget;
|
||||
setDefaultRelativeRightTarget();
|
||||
anchorRight();
|
||||
m_rightTarget = newTarget;
|
||||
setDefaultRelativeRightTarget();
|
||||
anchorRight();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit rightTargetChanged();
|
||||
}
|
||||
@@ -454,11 +480,17 @@ void QmlAnchorBindingProxy::setVerticalTarget(const QString &target)
|
||||
if (!newTarget.isValid())
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setVerticalTarget"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setVerticalTarget"));
|
||||
|
||||
m_verticalTarget = newTarget;
|
||||
anchorVertical();
|
||||
m_verticalTarget = newTarget;
|
||||
anchorVertical();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit verticalTargetChanged();
|
||||
}
|
||||
@@ -476,11 +508,17 @@ void QmlAnchorBindingProxy::setHorizontalTarget(const QString &target)
|
||||
if (!newTarget.isValid())
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setHorizontalTarget"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setHorizontalTarget"));
|
||||
|
||||
m_horizontalTarget = newTarget;
|
||||
anchorHorizontal();
|
||||
m_horizontalTarget = newTarget;
|
||||
anchorHorizontal();\
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit horizontalTargetChanged();
|
||||
}
|
||||
@@ -493,12 +531,18 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetTop(QmlAnchorBindingProxy::Re
|
||||
if (target == m_relativeTopTarget)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetTop"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetTop"));
|
||||
|
||||
m_relativeTopTarget = target;
|
||||
m_relativeTopTarget = target;
|
||||
|
||||
anchorTop();
|
||||
anchorTop();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetTopChanged();
|
||||
}
|
||||
@@ -511,12 +555,19 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetBottom(QmlAnchorBindingProxy:
|
||||
if (target == m_relativeBottomTarget)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetBottom"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetBottom"));
|
||||
|
||||
m_relativeBottomTarget = target;
|
||||
m_relativeBottomTarget = target;
|
||||
|
||||
anchorBottom();
|
||||
|
||||
anchorBottom();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetBottomChanged();
|
||||
}
|
||||
@@ -529,12 +580,18 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetLeft(QmlAnchorBindingProxy::R
|
||||
if (target == m_relativeLeftTarget)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetLeft"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetLeft"));
|
||||
|
||||
m_relativeLeftTarget = target;
|
||||
m_relativeLeftTarget = target;
|
||||
|
||||
anchorLeft();
|
||||
anchorLeft();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetLeftChanged();
|
||||
}
|
||||
@@ -547,12 +604,18 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetRight(QmlAnchorBindingProxy::
|
||||
if (target == m_relativeRightTarget)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetRight"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetRight"));
|
||||
|
||||
m_relativeRightTarget = target;
|
||||
m_relativeRightTarget = target;
|
||||
|
||||
anchorRight();
|
||||
anchorRight();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetRightChanged();
|
||||
|
||||
@@ -566,12 +629,18 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetVertical(QmlAnchorBindingProx
|
||||
if (target == m_relativeVerticalTarget)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetVertical"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetVertical"));
|
||||
|
||||
m_relativeVerticalTarget = target;
|
||||
m_relativeVerticalTarget = target;
|
||||
|
||||
anchorVertical();
|
||||
anchorVertical();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetVerticalChanged();
|
||||
}
|
||||
@@ -584,12 +653,18 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetHorizontal(QmlAnchorBindingPr
|
||||
if (target == m_relativeHorizontalTarget)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetHorizontal"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetHorizontal"));
|
||||
|
||||
m_relativeHorizontalTarget = target;
|
||||
m_relativeHorizontalTarget = target;
|
||||
|
||||
anchorHorizontal();
|
||||
anchorHorizontal();
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetHorizontalChanged();
|
||||
}
|
||||
@@ -635,8 +710,10 @@ int QmlAnchorBindingProxy::indexOfPossibleTargetItem(const QString &targetName)
|
||||
}
|
||||
|
||||
void QmlAnchorBindingProxy::resetLayout() {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::resetLayout"));
|
||||
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::resetLayout"));
|
||||
|
||||
m_qmlItemNode.anchors().removeAnchors();
|
||||
m_qmlItemNode.anchors().removeMargins();
|
||||
@@ -646,6 +723,11 @@ void QmlAnchorBindingProxy::resetLayout() {
|
||||
restoreProperty(modelNode(), "width");
|
||||
restoreProperty(modelNode(), "height");
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit topAnchorChanged();
|
||||
emit bottomAnchorChanged();
|
||||
emit leftAnchorChanged();
|
||||
@@ -661,16 +743,22 @@ void QmlAnchorBindingProxy::setBottomAnchor(bool anchor)
|
||||
if (bottomAnchored() == anchor)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setBottomAnchor"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setBottomAnchor"));
|
||||
|
||||
if (!anchor) {
|
||||
removeBottomAnchor();
|
||||
} else {
|
||||
setDefaultRelativeBottomTarget();
|
||||
anchorBottom();
|
||||
if (topAnchored())
|
||||
backupPropertyAndRemove(modelNode(), "height");
|
||||
if (!anchor) {
|
||||
removeBottomAnchor();
|
||||
} else {
|
||||
setDefaultRelativeBottomTarget();
|
||||
anchorBottom();
|
||||
if (topAnchored())
|
||||
backupPropertyAndRemove(modelNode(), "height");
|
||||
}
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetBottomChanged();
|
||||
@@ -688,18 +776,24 @@ void QmlAnchorBindingProxy::setLeftAnchor(bool anchor)
|
||||
if (leftAnchored() == anchor)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setLeftAnchor"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setLeftAnchor"));
|
||||
|
||||
if (!anchor) {
|
||||
removeLeftAnchor();
|
||||
} else {
|
||||
setDefaultRelativeLeftTarget();
|
||||
if (!anchor) {
|
||||
removeLeftAnchor();
|
||||
} else {
|
||||
setDefaultRelativeLeftTarget();
|
||||
|
||||
anchorLeft();
|
||||
backupPropertyAndRemove(modelNode(), "x");
|
||||
if (rightAnchored())
|
||||
backupPropertyAndRemove(modelNode(), "width");
|
||||
anchorLeft();
|
||||
backupPropertyAndRemove(modelNode(), "x");
|
||||
if (rightAnchored())
|
||||
backupPropertyAndRemove(modelNode(), "width");
|
||||
}
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetLeftChanged();
|
||||
@@ -716,17 +810,23 @@ void QmlAnchorBindingProxy::setRightAnchor(bool anchor)
|
||||
if (rightAnchored() == anchor)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRightAnchor"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRightAnchor"));
|
||||
|
||||
if (!anchor) {
|
||||
removeRightAnchor();
|
||||
} else {
|
||||
setDefaultRelativeRightTarget();
|
||||
if (!anchor) {
|
||||
removeRightAnchor();
|
||||
} else {
|
||||
setDefaultRelativeRightTarget();
|
||||
|
||||
anchorRight();
|
||||
if (leftAnchored())
|
||||
backupPropertyAndRemove(modelNode(), "width");
|
||||
anchorRight();
|
||||
if (leftAnchored())
|
||||
backupPropertyAndRemove(modelNode(), "width");
|
||||
}
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetRightChanged();
|
||||
@@ -926,18 +1026,23 @@ void QmlAnchorBindingProxy::setTopAnchor(bool anchor)
|
||||
if (topAnchored() == anchor)
|
||||
return;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setTopAnchor"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setTopAnchor"));
|
||||
|
||||
if (!anchor) {
|
||||
removeTopAnchor();
|
||||
} else {
|
||||
setDefaultRelativeTopTarget();
|
||||
if (!anchor) {
|
||||
removeTopAnchor();
|
||||
} else {
|
||||
setDefaultRelativeTopTarget();
|
||||
|
||||
anchorTop();
|
||||
backupPropertyAndRemove(modelNode(), "y");
|
||||
if (bottomAnchored())
|
||||
backupPropertyAndRemove(modelNode(), "height");
|
||||
anchorTop();
|
||||
backupPropertyAndRemove(modelNode(), "y");
|
||||
if (bottomAnchored())
|
||||
backupPropertyAndRemove(modelNode(), "height");
|
||||
}
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit relativeAnchorTargetTopChanged();
|
||||
@@ -947,47 +1052,70 @@ void QmlAnchorBindingProxy::setTopAnchor(bool anchor)
|
||||
}
|
||||
|
||||
void QmlAnchorBindingProxy::removeTopAnchor() {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeTopAnchor"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeTopAnchor"));
|
||||
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineTop);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineTop);
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineTop);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineTop);
|
||||
|
||||
restoreProperty(modelNode(), "y");
|
||||
restoreProperty(modelNode(), "height");
|
||||
restoreProperty(modelNode(), "y");
|
||||
restoreProperty(modelNode(), "height");
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlAnchorBindingProxy::removeBottomAnchor() {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeBottomAnchor"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeBottomAnchor"));
|
||||
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineBottom);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineBottom);
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineBottom);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineBottom);
|
||||
|
||||
|
||||
restoreProperty(modelNode(), "height");
|
||||
restoreProperty(modelNode(), "height");
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlAnchorBindingProxy::removeLeftAnchor() {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeLeftAnchor"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeLeftAnchor"));
|
||||
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineLeft);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineLeft);
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineLeft);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineLeft);
|
||||
|
||||
restoreProperty(modelNode(), "x");
|
||||
restoreProperty(modelNode(), "width");
|
||||
restoreProperty(modelNode(), "x");
|
||||
restoreProperty(modelNode(), "width");
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlAnchorBindingProxy::removeRightAnchor() {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeRightAnchor"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeRightAnchor"));
|
||||
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineRight);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineRight);
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineRight);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineRight);
|
||||
|
||||
restoreProperty(modelNode(), "width");
|
||||
restoreProperty(modelNode(), "width");
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlAnchorBindingProxy::setVerticalCentered(bool centered)
|
||||
@@ -1000,18 +1128,23 @@ void QmlAnchorBindingProxy::setVerticalCentered(bool centered)
|
||||
|
||||
m_locked = true;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setVerticalCentered"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setVerticalCentered"));
|
||||
|
||||
if (!centered) {
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineVerticalCenter);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineVerticalCenter);
|
||||
} else {
|
||||
m_relativeVerticalTarget = Center;
|
||||
if (!centered) {
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineVerticalCenter);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineVerticalCenter);
|
||||
} else {
|
||||
m_relativeVerticalTarget = Center;
|
||||
|
||||
anchorVertical();
|
||||
anchorVertical();
|
||||
}
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
m_locked = false;
|
||||
|
||||
emit relativeAnchorTargetVerticalChanged();
|
||||
@@ -1028,18 +1161,23 @@ void QmlAnchorBindingProxy::setHorizontalCentered(bool centered)
|
||||
|
||||
m_locked = true;
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setHorizontalCentered"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::setHorizontalCentered"));
|
||||
|
||||
if (!centered) {
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineHorizontalCenter);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineHorizontalCenter);
|
||||
} else {
|
||||
m_relativeHorizontalTarget = Center;
|
||||
if (!centered) {
|
||||
m_qmlItemNode.anchors().removeAnchor(AnchorLineHorizontalCenter);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineHorizontalCenter);
|
||||
} else {
|
||||
m_relativeHorizontalTarget = Center;
|
||||
|
||||
anchorHorizontal();
|
||||
anchorHorizontal();
|
||||
}
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
m_locked = false;
|
||||
|
||||
emit relativeAnchorTargetHorizontalChanged();
|
||||
@@ -1119,24 +1257,30 @@ bool QmlAnchorBindingProxy::horizontalCentered()
|
||||
void QmlAnchorBindingProxy::fill()
|
||||
{
|
||||
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::fill"));
|
||||
try {
|
||||
RewriterTransaction transaction = beginRewriterTransaction(
|
||||
QByteArrayLiteral("QmlAnchorBindingProxy::fill"));
|
||||
|
||||
|
||||
backupPropertyAndRemove(modelNode(), "x");
|
||||
backupPropertyAndRemove(modelNode(), "y");
|
||||
backupPropertyAndRemove(modelNode(), "width");
|
||||
backupPropertyAndRemove(modelNode(), "height");
|
||||
backupPropertyAndRemove(modelNode(), "x");
|
||||
backupPropertyAndRemove(modelNode(), "y");
|
||||
backupPropertyAndRemove(modelNode(), "width");
|
||||
backupPropertyAndRemove(modelNode(), "height");
|
||||
|
||||
m_qmlItemNode.anchors().fill();
|
||||
m_qmlItemNode.anchors().fill();
|
||||
|
||||
setHorizontalCentered(false);
|
||||
setVerticalCentered(false);
|
||||
setHorizontalCentered(false);
|
||||
setVerticalCentered(false);
|
||||
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineRight);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineLeft);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineTop);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineBottom);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineRight);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineLeft);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineTop);
|
||||
m_qmlItemNode.anchors().removeMargin(AnchorLineBottom);
|
||||
|
||||
transaction.commit();
|
||||
} catch (const Exception &e) {
|
||||
e.showException();
|
||||
}
|
||||
|
||||
emit topAnchorChanged();
|
||||
emit bottomAnchorChanged();
|
||||
|
@@ -870,6 +870,12 @@ bool NodeMetaInfoPrivate::isPropertyList(const PropertyName &propertyName) const
|
||||
const CppComponentValue *qmlObjectValue = getNearestCppComponentValue();
|
||||
if (!qmlObjectValue)
|
||||
return false;
|
||||
|
||||
if (!qmlObjectValue->hasProperty(QString::fromUtf8(propertyName))) {
|
||||
const TypeName typeName = propertyType(propertyName);
|
||||
return (typeName == "Item" || typeName == "QtObject");
|
||||
}
|
||||
|
||||
return qmlObjectValue->isListProperty(QString::fromUtf8(propertyName));
|
||||
}
|
||||
|
||||
|
@@ -85,14 +85,23 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent)
|
||||
if (newId == animation().id())
|
||||
return;
|
||||
|
||||
if (!animation().isValidId(newId)) {
|
||||
bool error = false;
|
||||
|
||||
if (!ModelNode::isValidId(newId)) {
|
||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
||||
tr("%1 is an invalid id.").arg(newId));
|
||||
error = true;
|
||||
} else if (animation().view()->hasId(newId)) {
|
||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
||||
tr("%1 already exists.").arg(newId));
|
||||
} else {
|
||||
animation().setIdWithRefactoring(newId);
|
||||
error = true;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
lastString.clear();
|
||||
ui->idLineEdit->setText(animation().id());
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -98,15 +98,24 @@ TimelineForm::TimelineForm(QWidget *parent)
|
||||
if (newId == m_timeline.modelNode().id())
|
||||
return;
|
||||
|
||||
if (!m_timeline.modelNode().isValidId(newId)) {
|
||||
bool error = false;
|
||||
|
||||
if (!ModelNode::isValidId(newId)) {
|
||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
||||
tr("%1 is an invalid id.").arg(newId));
|
||||
error = true;
|
||||
} else if (m_timeline.view()->hasId(newId)) {
|
||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
||||
tr("%1 already exists.").arg(newId));
|
||||
error = true;
|
||||
} else {
|
||||
m_timeline.modelNode().setIdWithRefactoring(newId);
|
||||
}
|
||||
|
||||
if (error) {
|
||||
lastString.clear();
|
||||
ui->idLineEdit->setText(m_timeline.modelNode().id());
|
||||
}
|
||||
});
|
||||
|
||||
connectSpinBox(ui->startFrame, "startFrame");
|
||||
|
@@ -220,6 +220,7 @@ void TimelineSettingsDialog::setupTimelines(const QmlTimeline &timeline)
|
||||
}
|
||||
|
||||
setTabForTimeline(ui->timelineTab, m_currentTimeline);
|
||||
setupAnimations(m_currentTimeline);
|
||||
m_timelineSettingsModel->resetModel();
|
||||
}
|
||||
|
||||
|
65
tests/manual/qml/testprojects/metainfohints/MainForm.ui.qml
Normal file
65
tests/manual/qml/testprojects/metainfohints/MainForm.ui.qml
Normal file
@@ -0,0 +1,65 @@
|
||||
import QtQuick 2.8
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.3
|
||||
import Qt.labs.calendar 1.0
|
||||
import test 1.0
|
||||
|
||||
Item {
|
||||
property alias mouseArea: mouseArea
|
||||
property alias textEdit: textEdit
|
||||
|
||||
width: 360
|
||||
height: 360
|
||||
TestComponent {
|
||||
}
|
||||
|
||||
ForceClip {
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: rectangle
|
||||
x: 152
|
||||
y: 65
|
||||
width: 200
|
||||
height: 200
|
||||
color: "#ffffff"
|
||||
|
||||
TestComponent {
|
||||
id: testComponent
|
||||
x: 55
|
||||
y: 35
|
||||
text: qsTr("This is text")
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: text1
|
||||
x: 17
|
||||
y: 133
|
||||
text: qsTr("Text")
|
||||
font.pixelSize: 12
|
||||
}
|
||||
|
||||
TestLayout {
|
||||
id: testLayout
|
||||
x: 8
|
||||
y: 252
|
||||
width: 100
|
||||
height: 100
|
||||
|
||||
CheckBox {
|
||||
id: checkBox
|
||||
text: qsTr("Check Box")
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: checkBox1
|
||||
text: qsTr("Check Box")
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: checkBox2
|
||||
text: qsTr("Check Box")
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
Item {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -100
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
Item {
|
||||
default property alias content: layout.children
|
||||
RowLayout {
|
||||
id: layout
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
Item {
|
||||
default property alias content: layout.children
|
||||
RowLayout {
|
||||
id: layout
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
|
||||
Rectangle {
|
||||
width: 60
|
||||
height: 60
|
||||
color: "green"
|
||||
property alias text: textItem.text
|
||||
|
||||
Text {
|
||||
id: textItem
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
Item {
|
||||
}
|
@@ -0,0 +1,143 @@
|
||||
MetaInfo {
|
||||
Type {
|
||||
name: "test.TestComponent"
|
||||
icon: ":/qtquickplugin/images/item-icon16.png"
|
||||
|
||||
Hints {
|
||||
canBeContainer: model.potentialChildIsSubclassOf("QtQuick.Text")
|
||||
canBeReparented: model.potentialParentIsSubclassOf("QtQuick.Rectangle")
|
||||
isResizable: false
|
||||
isMovable: !model.currentParentIsSubclassOf("QtQuick.Rectangle");
|
||||
}
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "Test Component"
|
||||
category: "Test Plugin"
|
||||
libraryIcon: ":/qtquickplugin/images/item-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "test"
|
||||
|
||||
Property {
|
||||
name: "text"
|
||||
type: "binding"
|
||||
value: "qsTr(\"This is text\")"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "test.TestLayout"
|
||||
icon: ":/qtquickplugin/images/item-icon16.png"
|
||||
|
||||
Hints {
|
||||
canBeContainer: true
|
||||
doesLayoutChildren: true
|
||||
}
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "Test Layout"
|
||||
category: "Test Plugin"
|
||||
libraryIcon: ":/qtquickplugin/images/item-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "test"
|
||||
|
||||
Property {
|
||||
name: "width"
|
||||
type: "int"
|
||||
value: "100"
|
||||
}
|
||||
|
||||
Property {
|
||||
name: "height"
|
||||
type: "int"
|
||||
value: "100"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "test.OnlyNavigator"
|
||||
icon: ":/qtquickplugin/images/item-icon16.png"
|
||||
|
||||
Hints {
|
||||
canBeDroppedInFormEditor: false
|
||||
}
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "Only Navigator"
|
||||
category: "Test Plugin"
|
||||
libraryIcon: ":/qtquickplugin/images/item-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "test"
|
||||
Property {
|
||||
name: "width"
|
||||
type: "int"
|
||||
value: "100"
|
||||
}
|
||||
|
||||
Property {
|
||||
name: "height"
|
||||
type: "int"
|
||||
value: "100"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "test.OnlyFormEditor"
|
||||
icon: ":/qtquickplugin/images/item-icon16.png"
|
||||
|
||||
Hints {
|
||||
canBeDroppedInNavigator: false
|
||||
}
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "Only Form Editor"
|
||||
category: "Test Plugin"
|
||||
libraryIcon: ":/qtquickplugin/images/item-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "test"
|
||||
Property {
|
||||
name: "width"
|
||||
type: "int"
|
||||
value: "100"
|
||||
}
|
||||
|
||||
Property {
|
||||
name: "height"
|
||||
type: "int"
|
||||
value: "100"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "test.ForceClip"
|
||||
icon: ":/qtquickplugin/images/item-icon16.png"
|
||||
|
||||
Hints {
|
||||
forceClip: true
|
||||
}
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "Force Clip"
|
||||
category: "Test Plugin"
|
||||
libraryIcon: ":/qtquickplugin/images/item-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "test"
|
||||
Property {
|
||||
name: "width"
|
||||
type: "int"
|
||||
value: "100"
|
||||
}
|
||||
|
||||
Property {
|
||||
name: "height"
|
||||
type: "int"
|
||||
value: "100"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
TestComponent 1.0 TestComponent.qml
|
||||
TestLayout 1.0 TestLayout.qml
|
||||
OnlyNavigator 1.0 OnlyNavigator.qml
|
||||
OnlyFormEditor 1.0 OnlyFormEditor.qml
|
||||
ForceClip 1.0 ForceClip.qml
|
@@ -0,0 +1,13 @@
|
||||
import QtQuick 2.8
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
Window {
|
||||
visible: true
|
||||
width: 640
|
||||
height: 480
|
||||
title: qsTr("Hello World")
|
||||
|
||||
MainForm {
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
import QmlProject 1.1
|
||||
|
||||
Project {
|
||||
mainFile: "metainfohints.qml"
|
||||
|
||||
/* Include .qml, .js, and image files from current directory and subdirectories */
|
||||
QmlFiles {
|
||||
directory: "."
|
||||
}
|
||||
JavaScriptFiles {
|
||||
directory: "."
|
||||
}
|
||||
ImageFiles {
|
||||
directory: "."
|
||||
}
|
||||
|
||||
importPaths: [ "imports" ]
|
||||
}
|
@@ -273,23 +273,14 @@ def createProject_Qt_Console(path, projectName, checks = True, buildSystem = Non
|
||||
if checks:
|
||||
__verifyFileCreation__(path, expectedFiles)
|
||||
|
||||
def createNewQtQuickApplication(workingDir, projectName = None,
|
||||
def createNewQtQuickApplication(workingDir, projectName=None,
|
||||
targets=Targets.desktopTargetClasses(), minimumQtVersion="5.6",
|
||||
withControls = False, fromWelcome = False, buildSystem = None):
|
||||
if withControls:
|
||||
template = "Qt Quick Application - Swipe"
|
||||
else:
|
||||
template = "Qt Quick Application - Empty"
|
||||
template="Qt Quick Application - Empty", fromWelcome=False,
|
||||
buildSystem=None):
|
||||
available = __createProjectOrFileSelectType__(" Application", template, fromWelcome)
|
||||
projectName = __createProjectSetNameAndPath__(workingDir, projectName)
|
||||
__handleBuildSystem__(buildSystem)
|
||||
if withControls:
|
||||
requiredQt = "5.7"
|
||||
# TODO use parameter to define style to choose
|
||||
test.log("Using default controls style")
|
||||
clickButton(waitForObject(":Next_QPushButton"))
|
||||
else:
|
||||
requiredQt = __createProjectHandleQtQuickSelection__(minimumQtVersion)
|
||||
requiredQt = __createProjectHandleQtQuickSelection__(minimumQtVersion)
|
||||
__modifyAvailableTargets__(available, requiredQt)
|
||||
checkedTargets = __chooseTargets__(targets, available)
|
||||
snooze(1)
|
||||
|
@@ -59,13 +59,6 @@ JIRA_URL='https://bugreports.qt.io/browse'
|
||||
class JIRA:
|
||||
__instance__ = None
|
||||
|
||||
# internal exception to be used inside workaround functions (lack of having return values)
|
||||
class JiraException(Exception):
|
||||
def __init__(self, value):
|
||||
self.value = value
|
||||
def __str__(self):
|
||||
return repr(self.value)
|
||||
|
||||
# Helper class
|
||||
class Bug:
|
||||
CREATOR = 'QTCREATORBUG'
|
||||
@@ -93,45 +86,12 @@ class JIRA:
|
||||
def __setattr__(self, attr, value):
|
||||
return setattr(self.__instance__, attr, value)
|
||||
|
||||
# function to get an instance of the singleton
|
||||
@staticmethod
|
||||
def getInstance():
|
||||
if '_JIRA__instance__' in JIRA.__dict__:
|
||||
return JIRA.__instance__
|
||||
else:
|
||||
return JIRA.__impl(0, Bug.CREATOR)
|
||||
|
||||
# function to check if the given bug is open or not
|
||||
@staticmethod
|
||||
def isBugStillOpen(number, bugType=Bug.CREATOR):
|
||||
tmpJIRA = JIRA(number, bugType)
|
||||
return tmpJIRA.isOpen()
|
||||
|
||||
# function that performs the workaround (function) for the given bug
|
||||
# if the function needs additional arguments pass them as 3rd parameter
|
||||
@staticmethod
|
||||
def performWorkaroundForBug(number, bugType=Bug.CREATOR, *args):
|
||||
if not JIRA.isBugStillOpen(number, bugType):
|
||||
test.warning("Bug %s-%d is closed for version %s." %
|
||||
(bugType, number, JIRA(number, bugType)._fix),
|
||||
"You should probably remove potential code inside workarounds.py")
|
||||
functionToCall = JIRA.getInstance().__bugs__.get("%s-%d" % (bugType, number), None)
|
||||
if functionToCall:
|
||||
test.warning("Using workaround for %s-%d" % (bugType, number))
|
||||
try:
|
||||
functionToCall(*args)
|
||||
except:
|
||||
t, v = sys.exc_info()[0:2]
|
||||
if t == JIRA.JiraException:
|
||||
raise JIRA.JiraException(v)
|
||||
else:
|
||||
test.warning("Exception caught while executing workaround function.",
|
||||
"%s (%s)" % (str(t), str(v)))
|
||||
return True
|
||||
else:
|
||||
JIRA.getInstance()._exitFatal_(bugType, number)
|
||||
return False
|
||||
|
||||
# implementation of JIRA singleton
|
||||
class __impl:
|
||||
# constructor of __impl
|
||||
@@ -139,8 +99,6 @@ class JIRA:
|
||||
self._number = number
|
||||
self._bugType = bugType
|
||||
self._fix = None
|
||||
self._localOnly = os.getenv("SYSTEST_JIRA_NO_LOOKUP")=="1"
|
||||
self.__initBugDict__()
|
||||
self._fetchResults_ = {}
|
||||
self.__fetchResolutionFromJira__()
|
||||
|
||||
@@ -169,30 +127,23 @@ class JIRA:
|
||||
return
|
||||
data = None
|
||||
proxy = os.getenv("SYSTEST_PROXY", None)
|
||||
if not self._localOnly:
|
||||
try:
|
||||
if proxy:
|
||||
proxy = urllib2.ProxyHandler({'https': proxy})
|
||||
opener = urllib2.build_opener(proxy)
|
||||
urllib2.install_opener(opener)
|
||||
bugReport = urllib2.urlopen('%s/%s' % (JIRA_URL, bug))
|
||||
data = bugReport.read()
|
||||
except:
|
||||
data = self.__tryExternalTools__(proxy)
|
||||
if data == None:
|
||||
test.warning("Sorry, ssl module missing - cannot fetch data via HTTPS",
|
||||
"Try to install the ssl module by yourself, or set the python "
|
||||
"path inside SQUISHDIR/etc/paths.ini to use a python version with "
|
||||
"ssl support OR install wget or curl to get rid of this warning!")
|
||||
self._localOnly = True
|
||||
try:
|
||||
if proxy:
|
||||
proxy = urllib2.ProxyHandler({'https': proxy})
|
||||
opener = urllib2.build_opener(proxy)
|
||||
urllib2.install_opener(opener)
|
||||
bugReport = urllib2.urlopen('%s/%s' % (JIRA_URL, bug))
|
||||
data = bugReport.read()
|
||||
except:
|
||||
data = self.__tryExternalTools__(proxy)
|
||||
if data == None:
|
||||
test.warning("Sorry, ssl module missing - cannot fetch data via HTTPS",
|
||||
"Try to install the ssl module by yourself, or set the python "
|
||||
"path inside SQUISHDIR/etc/paths.ini to use a python version with "
|
||||
"ssl support OR install wget or curl to get rid of this warning!")
|
||||
if data == None:
|
||||
if bug in self.__bugs__:
|
||||
test.warning("Using internal dict - bug status could have changed already",
|
||||
"Please check manually!")
|
||||
self._resolution = None
|
||||
else:
|
||||
test.fatal("No workaround function deposited for %s" % bug)
|
||||
self._resolution = 'Done'
|
||||
test.fatal("No resolution info for %s" % bug)
|
||||
self._resolution = 'Done'
|
||||
else:
|
||||
data = data.replace("\r", "").replace("\n", "")
|
||||
resPattern = re.compile('<span\s+id="resolution-val".*?>(?P<resolution>.*?)</span>')
|
||||
@@ -249,14 +200,3 @@ class JIRA:
|
||||
"%s[...]" % fetched[:200])
|
||||
else:
|
||||
test.log("Fetched and cropped data: [...]%s[...]" % fetched[resoInd-20:resoInd+100])
|
||||
|
||||
# this function initializes the bug dict for localOnly usage and
|
||||
# for later lookup which function to call for which bug
|
||||
# ALWAYS update this dict when adding a new function for a workaround!
|
||||
def __initBugDict__(self):
|
||||
self.__bugs__= {}
|
||||
# helper function - will be called if no workaround for the requested bug is deposited
|
||||
def _exitFatal_(self, bugType, number):
|
||||
test.fatal("No workaround found for bug %s-%d" % (bugType, number))
|
||||
|
||||
############### functions that hold workarounds #################################
|
||||
|
@@ -53,9 +53,9 @@ def main():
|
||||
return
|
||||
test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
|
||||
"Verifying if: .cpp file is opened in Edit mode.")
|
||||
# place cursor on line "QmlApplicationViewer viewer;"
|
||||
editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||
# invoke find usages from context menu on word "viewer"
|
||||
# place cursor on line "class TriangleWindow : public OpenGLWindow"
|
||||
# invoke find usages from context menu on word "OpenGLWindow"
|
||||
if not invokeFindUsage(editorWidget, "class TriangleWindow : public OpenGLWindow",
|
||||
"<Left>"):
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
@@ -30,26 +30,20 @@ def main():
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
|
||||
available = [("5.6", False), ("5.6", True)]
|
||||
available = [("5.6", "Qt Quick Application - Empty", Targets.DESKTOP_5_6_1_DEFAULT),
|
||||
("5.10", "Qt Quick Application - Swipe", Targets.DESKTOP_5_10_1_DEFAULT)]
|
||||
|
||||
for qtVersion, controls in available:
|
||||
targ = Targets.DESKTOP_5_6_1_DEFAULT
|
||||
for qtVersion, appTemplate, targ in available:
|
||||
# using a temporary directory won't mess up a potentially existing
|
||||
workingDir = tempDir()
|
||||
checkedTargets = createNewQtQuickApplication(workingDir, targets=[targ],
|
||||
minimumQtVersion=qtVersion,
|
||||
withControls = controls)[0]
|
||||
template=appTemplate)[0]
|
||||
if len(checkedTargets) == 0:
|
||||
if controls and qtVersion < "5.7":
|
||||
test.xfail("Could not check wanted target.", "Quick Controls 2 wizard needs Qt5.7+")
|
||||
else:
|
||||
test.fatal("Could not check wanted target")
|
||||
test.fatal("Could not check wanted target")
|
||||
continue
|
||||
additionalText = ''
|
||||
if controls:
|
||||
additionalText = ' Controls '
|
||||
test.log("Building project Qt Quick%sApplication (%s)"
|
||||
% (additionalText, Targets.getStringForTarget(targ)))
|
||||
test.log("Building project %s (%s)"
|
||||
% (appTemplate, Targets.getStringForTarget(targ)))
|
||||
invokeMenuItem("Build", "Build All")
|
||||
waitForCompile()
|
||||
if not checkCompile():
|
||||
|
Reference in New Issue
Block a user