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
|
QMake Projects
|
||||||
|
|
||||||
* Fixed unnecessary reparsing on file save (QTCREATORBUG-22361)
|
* Fixed unnecessary reparsing on file save (QTCREATORBUG-22361)
|
||||||
|
* Fixed code model for generated files when specified in `.pri` file
|
||||||
|
(QTCREATORBUG-22395)
|
||||||
|
|
||||||
CMake Projects
|
CMake Projects
|
||||||
|
|
||||||
* Fixed deployment with `QtCreatorDeployment.txt` (QTCREATORBUG-22184)
|
* 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
|
Debugging
|
||||||
|
|
||||||
@@ -48,6 +56,7 @@ Remote Linux
|
|||||||
(QTCREATORBUG-22352)
|
(QTCREATORBUG-22352)
|
||||||
|
|
||||||
Credits for these changes go to:
|
Credits for these changes go to:
|
||||||
|
Aaron Barany
|
||||||
André Pönitz
|
André Pönitz
|
||||||
BogDan Vatra
|
BogDan Vatra
|
||||||
Christian Kandeler
|
Christian Kandeler
|
||||||
@@ -59,6 +68,7 @@ Jonathan Liu
|
|||||||
Leena Miettinen
|
Leena Miettinen
|
||||||
Mitch Curtis
|
Mitch Curtis
|
||||||
Nikolai Kosjar
|
Nikolai Kosjar
|
||||||
|
Orgad Shaneh
|
||||||
Robert Löhning
|
Robert Löhning
|
||||||
Thomas Hartmann
|
Thomas Hartmann
|
||||||
Ulf Hermann
|
Ulf Hermann
|
||||||
|
@@ -103,7 +103,7 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onHasGradientChanged: {
|
onHasGradientChanged: {
|
||||||
if (!supportGradient)
|
if (!colorEditor.supportGradient)
|
||||||
return
|
return
|
||||||
|
|
||||||
if (gradientLine.hasGradient) {
|
if (gradientLine.hasGradient) {
|
||||||
@@ -121,8 +121,9 @@ Column {
|
|||||||
default:
|
default:
|
||||||
buttonRow.initalChecked = 1
|
buttonRow.initalChecked = 1
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
buttonRow.initalChecked = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
colorEditor.color = gradientLine.currentColor
|
colorEditor.color = gradientLine.currentColor
|
||||||
} else {
|
} else {
|
||||||
buttonRow.initalChecked = 0
|
buttonRow.initalChecked = 0
|
||||||
@@ -216,7 +217,9 @@ Column {
|
|||||||
iconSource: "images/icon_color_solid.png"
|
iconSource: "images/icon_color_solid.png"
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
if (colorEditor.supportGradient)
|
||||||
gradientLine.deleteGradient()
|
gradientLine.deleteGradient()
|
||||||
|
|
||||||
textField.text = colorEditor.color
|
textField.text = colorEditor.color
|
||||||
colorEditor.backendValue.resetValue()
|
colorEditor.backendValue.resetValue()
|
||||||
}
|
}
|
||||||
@@ -511,6 +514,7 @@ Column {
|
|||||||
iconSource: "images/icon_color_none.png"
|
iconSource: "images/icon_color_none.png"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
colorEditor.color = "#00000000"
|
colorEditor.color = "#00000000"
|
||||||
|
if (colorEditor.supportGradient)
|
||||||
gradientLine.deleteGradient()
|
gradientLine.deleteGradient()
|
||||||
}
|
}
|
||||||
tooltip: qsTr("Transparent")
|
tooltip: qsTr("Transparent")
|
||||||
|
@@ -349,11 +349,6 @@ void CMakeBuildSettingsWidget::setError(const QString &message)
|
|||||||
m_errorMessageLabel->setVisible(showError);
|
m_errorMessageLabel->setVisible(showError);
|
||||||
m_errorMessageLabel->setText(message);
|
m_errorMessageLabel->setText(message);
|
||||||
m_errorMessageLabel->setToolTip(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)
|
void CMakeBuildSettingsWidget::setWarning(const QString &message)
|
||||||
|
@@ -175,6 +175,17 @@ static inline QString clientRootFromOutput(const QString &in)
|
|||||||
return QString();
|
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)
|
void PerforceChecker::parseOutput(const QString &response)
|
||||||
{
|
{
|
||||||
if (!response.contains(QLatin1String("View:")) && !response.contains(QLatin1String("//depot/"))) {
|
if (!response.contains(QLatin1String("View:")) && !response.contains(QLatin1String("//depot/"))) {
|
||||||
@@ -182,6 +193,12 @@ void PerforceChecker::parseOutput(const QString &response)
|
|||||||
return;
|
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);
|
const QString repositoryRoot = clientRootFromOutput(response);
|
||||||
if (repositoryRoot.isEmpty()) {
|
if (repositoryRoot.isEmpty()) {
|
||||||
//: Unable to determine root of the p4 client installation
|
//: Unable to determine root of the p4 client installation
|
||||||
|
@@ -80,7 +80,7 @@ CrumbleBar::~CrumbleBar()
|
|||||||
|
|
||||||
void CrumbleBar::pushFile(const Utils::FileName &fileName)
|
void CrumbleBar::pushFile(const Utils::FileName &fileName)
|
||||||
{
|
{
|
||||||
if (m_isInternalCalled == false) {
|
if (!m_isInternalCalled) {
|
||||||
crumblePath()->clear();
|
crumblePath()->clear();
|
||||||
} else {
|
} else {
|
||||||
CrumbleBarInfo lastElementCrumbleBarInfo = crumblePath()->dataForLastIndex().value<CrumbleBarInfo>();
|
CrumbleBarInfo lastElementCrumbleBarInfo = crumblePath()->dataForLastIndex().value<CrumbleBarInfo>();
|
||||||
|
@@ -79,7 +79,7 @@ CustomFileSystemModel::CustomFileSystemModel(QObject *parent) : QAbstractListMod
|
|||||||
m_fileSystemModel->setIconProvider(new ItemLibraryFileIconProvider());
|
m_fileSystemModel->setIconProvider(new ItemLibraryFileIconProvider());
|
||||||
|
|
||||||
connect(m_fileSystemWatcher, &Utils::FileSystemWatcher::directoryChanged, [this] {
|
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);
|
QFileInfo info(fileName);
|
||||||
@@ -101,7 +101,7 @@ QString filterMetaIcons(const QString &fileName)
|
|||||||
while (!currentDir.isRoot() && i < 3) {
|
while (!currentDir.isRoot() && i < 3) {
|
||||||
if (currentDir.dirName() == "designer") {
|
if (currentDir.dirName() == "designer") {
|
||||||
if (!currentDir.entryList({"*.metainfo"}).isEmpty())
|
if (!currentDir.entryList({"*.metainfo"}).isEmpty())
|
||||||
return {};
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentDir.cdUp();
|
currentDir.cdUp();
|
||||||
@@ -109,10 +109,10 @@ QString filterMetaIcons(const QString &fileName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (info.dir().dirName() == "designer")
|
if (info.dir().dirName() == "designer")
|
||||||
return {};
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileName;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex CustomFileSystemModel::setRootPath(const QString &newPath)
|
QModelIndex CustomFileSystemModel::setRootPath(const QString &newPath)
|
||||||
@@ -120,38 +120,7 @@ QModelIndex CustomFileSystemModel::setRootPath(const QString &newPath)
|
|||||||
if (m_fileSystemModel->rootPath() == newPath)
|
if (m_fileSystemModel->rootPath() == newPath)
|
||||||
return QAbstractListModel::index(0, 0);
|
return QAbstractListModel::index(0, 0);
|
||||||
|
|
||||||
beginResetModel();
|
return updatePath(newPath);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant CustomFileSystemModel::data(const QModelIndex &index, int role) const
|
QVariant CustomFileSystemModel::data(const QModelIndex &index, int role) const
|
||||||
@@ -210,6 +179,48 @@ void CustomFileSystemModel::setSearchFilter(const QString &nameFilterList)
|
|||||||
setRootPath(m_fileSystemModel->rootPath());
|
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
|
QModelIndex CustomFileSystemModel::fileSystemModelIndex(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
const int row = index.row();
|
const int row = index.row();
|
||||||
|
@@ -61,7 +61,9 @@ public:
|
|||||||
void setSearchFilter(const QString &nameFilterList);
|
void setSearchFilter(const QString &nameFilterList);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QModelIndex updatePath(const QString &newPath);
|
||||||
QModelIndex fileSystemModelIndex(const QModelIndex &index) const;
|
QModelIndex fileSystemModelIndex(const QModelIndex &index) const;
|
||||||
|
void appendIfNotFiltered(const QString &file);
|
||||||
|
|
||||||
QFileSystemModel *m_fileSystemModel;
|
QFileSystemModel *m_fileSystemModel;
|
||||||
QStringList m_files;
|
QStringList m_files;
|
||||||
|
@@ -24,7 +24,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qmlanchorbindingproxy.h"
|
#include "qmlanchorbindingproxy.h"
|
||||||
#include "abstractview.h"
|
|
||||||
|
#include <exception.h>
|
||||||
|
#include <abstractview.h>
|
||||||
#include <qmlanchors.h>
|
#include <qmlanchors.h>
|
||||||
#include <nodeabstractproperty.h>
|
#include <nodeabstractproperty.h>
|
||||||
#include <variantproperty.h>
|
#include <variantproperty.h>
|
||||||
@@ -359,6 +361,7 @@ void QmlAnchorBindingProxy::setTopTarget(const QString &target)
|
|||||||
if (!newTarget.isValid())
|
if (!newTarget.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setTopTarget"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setTopTarget"));
|
||||||
|
|
||||||
@@ -368,6 +371,11 @@ void QmlAnchorBindingProxy::setTopTarget(const QString &target)
|
|||||||
|
|
||||||
anchorTop();
|
anchorTop();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit topTargetChanged();
|
emit topTargetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,6 +393,7 @@ void QmlAnchorBindingProxy::setBottomTarget(const QString &target)
|
|||||||
if (!newTarget.isValid())
|
if (!newTarget.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setBottomTarget"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setBottomTarget"));
|
||||||
|
|
||||||
@@ -392,6 +401,11 @@ void QmlAnchorBindingProxy::setBottomTarget(const QString &target)
|
|||||||
setDefaultRelativeBottomTarget();
|
setDefaultRelativeBottomTarget();
|
||||||
anchorBottom();
|
anchorBottom();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit bottomTargetChanged();
|
emit bottomTargetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,6 +422,7 @@ void QmlAnchorBindingProxy::setLeftTarget(const QString &target)
|
|||||||
if (!newTarget.isValid())
|
if (!newTarget.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setLeftTarget"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setLeftTarget"));
|
||||||
|
|
||||||
@@ -415,6 +430,11 @@ void QmlAnchorBindingProxy::setLeftTarget(const QString &target)
|
|||||||
setDefaultRelativeLeftTarget();
|
setDefaultRelativeLeftTarget();
|
||||||
anchorLeft();
|
anchorLeft();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit leftTargetChanged();
|
emit leftTargetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,6 +451,7 @@ void QmlAnchorBindingProxy::setRightTarget(const QString &target)
|
|||||||
if (!newTarget.isValid())
|
if (!newTarget.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRightTarget"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setRightTarget"));
|
||||||
|
|
||||||
@@ -438,6 +459,11 @@ void QmlAnchorBindingProxy::setRightTarget(const QString &target)
|
|||||||
setDefaultRelativeRightTarget();
|
setDefaultRelativeRightTarget();
|
||||||
anchorRight();
|
anchorRight();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit rightTargetChanged();
|
emit rightTargetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,12 +480,18 @@ void QmlAnchorBindingProxy::setVerticalTarget(const QString &target)
|
|||||||
if (!newTarget.isValid())
|
if (!newTarget.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setVerticalTarget"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setVerticalTarget"));
|
||||||
|
|
||||||
m_verticalTarget = newTarget;
|
m_verticalTarget = newTarget;
|
||||||
anchorVertical();
|
anchorVertical();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit verticalTargetChanged();
|
emit verticalTargetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,11 +508,17 @@ void QmlAnchorBindingProxy::setHorizontalTarget(const QString &target)
|
|||||||
if (!newTarget.isValid())
|
if (!newTarget.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setHorizontalTarget"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setHorizontalTarget"));
|
||||||
|
|
||||||
m_horizontalTarget = newTarget;
|
m_horizontalTarget = newTarget;
|
||||||
anchorHorizontal();
|
anchorHorizontal();\
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit horizontalTargetChanged();
|
emit horizontalTargetChanged();
|
||||||
}
|
}
|
||||||
@@ -493,6 +531,7 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetTop(QmlAnchorBindingProxy::Re
|
|||||||
if (target == m_relativeTopTarget)
|
if (target == m_relativeTopTarget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetTop"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetTop"));
|
||||||
|
|
||||||
@@ -500,6 +539,11 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetTop(QmlAnchorBindingProxy::Re
|
|||||||
|
|
||||||
anchorTop();
|
anchorTop();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetTopChanged();
|
emit relativeAnchorTargetTopChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,13 +555,20 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetBottom(QmlAnchorBindingProxy:
|
|||||||
if (target == m_relativeBottomTarget)
|
if (target == m_relativeBottomTarget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetBottom"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetBottom"));
|
||||||
|
|
||||||
m_relativeBottomTarget = target;
|
m_relativeBottomTarget = target;
|
||||||
|
|
||||||
|
|
||||||
anchorBottom();
|
anchorBottom();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetBottomChanged();
|
emit relativeAnchorTargetBottomChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -529,6 +580,7 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetLeft(QmlAnchorBindingProxy::R
|
|||||||
if (target == m_relativeLeftTarget)
|
if (target == m_relativeLeftTarget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetLeft"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetLeft"));
|
||||||
|
|
||||||
@@ -536,6 +588,11 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetLeft(QmlAnchorBindingProxy::R
|
|||||||
|
|
||||||
anchorLeft();
|
anchorLeft();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetLeftChanged();
|
emit relativeAnchorTargetLeftChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,6 +604,7 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetRight(QmlAnchorBindingProxy::
|
|||||||
if (target == m_relativeRightTarget)
|
if (target == m_relativeRightTarget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetRight"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetRight"));
|
||||||
|
|
||||||
@@ -554,6 +612,11 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetRight(QmlAnchorBindingProxy::
|
|||||||
|
|
||||||
anchorRight();
|
anchorRight();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetRightChanged();
|
emit relativeAnchorTargetRightChanged();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -566,6 +629,7 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetVertical(QmlAnchorBindingProx
|
|||||||
if (target == m_relativeVerticalTarget)
|
if (target == m_relativeVerticalTarget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetVertical"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetVertical"));
|
||||||
|
|
||||||
@@ -573,6 +637,11 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetVertical(QmlAnchorBindingProx
|
|||||||
|
|
||||||
anchorVertical();
|
anchorVertical();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetVerticalChanged();
|
emit relativeAnchorTargetVerticalChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,6 +653,7 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetHorizontal(QmlAnchorBindingPr
|
|||||||
if (target == m_relativeHorizontalTarget)
|
if (target == m_relativeHorizontalTarget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetHorizontal"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setRelativeAnchorTargetHorizontal"));
|
||||||
|
|
||||||
@@ -591,6 +661,11 @@ void QmlAnchorBindingProxy::setRelativeAnchorTargetHorizontal(QmlAnchorBindingPr
|
|||||||
|
|
||||||
anchorHorizontal();
|
anchorHorizontal();
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetHorizontalChanged();
|
emit relativeAnchorTargetHorizontalChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -635,6 +710,8 @@ int QmlAnchorBindingProxy::indexOfPossibleTargetItem(const QString &targetName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QmlAnchorBindingProxy::resetLayout() {
|
void QmlAnchorBindingProxy::resetLayout() {
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::resetLayout"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::resetLayout"));
|
||||||
|
|
||||||
@@ -646,6 +723,11 @@ void QmlAnchorBindingProxy::resetLayout() {
|
|||||||
restoreProperty(modelNode(), "width");
|
restoreProperty(modelNode(), "width");
|
||||||
restoreProperty(modelNode(), "height");
|
restoreProperty(modelNode(), "height");
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit topAnchorChanged();
|
emit topAnchorChanged();
|
||||||
emit bottomAnchorChanged();
|
emit bottomAnchorChanged();
|
||||||
emit leftAnchorChanged();
|
emit leftAnchorChanged();
|
||||||
@@ -661,6 +743,7 @@ void QmlAnchorBindingProxy::setBottomAnchor(bool anchor)
|
|||||||
if (bottomAnchored() == anchor)
|
if (bottomAnchored() == anchor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setBottomAnchor"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setBottomAnchor"));
|
||||||
|
|
||||||
@@ -673,6 +756,11 @@ void QmlAnchorBindingProxy::setBottomAnchor(bool anchor)
|
|||||||
backupPropertyAndRemove(modelNode(), "height");
|
backupPropertyAndRemove(modelNode(), "height");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetBottomChanged();
|
emit relativeAnchorTargetBottomChanged();
|
||||||
emit bottomAnchorChanged();
|
emit bottomAnchorChanged();
|
||||||
|
|
||||||
@@ -688,6 +776,7 @@ void QmlAnchorBindingProxy::setLeftAnchor(bool anchor)
|
|||||||
if (leftAnchored() == anchor)
|
if (leftAnchored() == anchor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setLeftAnchor"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setLeftAnchor"));
|
||||||
|
|
||||||
@@ -702,6 +791,11 @@ void QmlAnchorBindingProxy::setLeftAnchor(bool anchor)
|
|||||||
backupPropertyAndRemove(modelNode(), "width");
|
backupPropertyAndRemove(modelNode(), "width");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetLeftChanged();
|
emit relativeAnchorTargetLeftChanged();
|
||||||
emit leftAnchorChanged();
|
emit leftAnchorChanged();
|
||||||
if (hasAnchors() != anchor)
|
if (hasAnchors() != anchor)
|
||||||
@@ -716,6 +810,7 @@ void QmlAnchorBindingProxy::setRightAnchor(bool anchor)
|
|||||||
if (rightAnchored() == anchor)
|
if (rightAnchored() == anchor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setRightAnchor"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setRightAnchor"));
|
||||||
|
|
||||||
@@ -729,6 +824,11 @@ void QmlAnchorBindingProxy::setRightAnchor(bool anchor)
|
|||||||
backupPropertyAndRemove(modelNode(), "width");
|
backupPropertyAndRemove(modelNode(), "width");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetRightChanged();
|
emit relativeAnchorTargetRightChanged();
|
||||||
emit rightAnchorChanged();
|
emit rightAnchorChanged();
|
||||||
|
|
||||||
@@ -926,6 +1026,7 @@ void QmlAnchorBindingProxy::setTopAnchor(bool anchor)
|
|||||||
if (topAnchored() == anchor)
|
if (topAnchored() == anchor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setTopAnchor"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setTopAnchor"));
|
||||||
|
|
||||||
@@ -939,6 +1040,10 @@ void QmlAnchorBindingProxy::setTopAnchor(bool anchor)
|
|||||||
if (bottomAnchored())
|
if (bottomAnchored())
|
||||||
backupPropertyAndRemove(modelNode(), "height");
|
backupPropertyAndRemove(modelNode(), "height");
|
||||||
}
|
}
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit relativeAnchorTargetTopChanged();
|
emit relativeAnchorTargetTopChanged();
|
||||||
emit topAnchorChanged();
|
emit topAnchorChanged();
|
||||||
@@ -947,6 +1052,7 @@ void QmlAnchorBindingProxy::setTopAnchor(bool anchor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QmlAnchorBindingProxy::removeTopAnchor() {
|
void QmlAnchorBindingProxy::removeTopAnchor() {
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeTopAnchor"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::removeTopAnchor"));
|
||||||
|
|
||||||
@@ -956,9 +1062,14 @@ void QmlAnchorBindingProxy::removeTopAnchor() {
|
|||||||
restoreProperty(modelNode(), "y");
|
restoreProperty(modelNode(), "y");
|
||||||
restoreProperty(modelNode(), "height");
|
restoreProperty(modelNode(), "height");
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlAnchorBindingProxy::removeBottomAnchor() {
|
void QmlAnchorBindingProxy::removeBottomAnchor() {
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeBottomAnchor"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::removeBottomAnchor"));
|
||||||
|
|
||||||
@@ -967,9 +1078,15 @@ void QmlAnchorBindingProxy::removeBottomAnchor() {
|
|||||||
|
|
||||||
|
|
||||||
restoreProperty(modelNode(), "height");
|
restoreProperty(modelNode(), "height");
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlAnchorBindingProxy::removeLeftAnchor() {
|
void QmlAnchorBindingProxy::removeLeftAnchor() {
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeLeftAnchor"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::removeLeftAnchor"));
|
||||||
|
|
||||||
@@ -978,9 +1095,15 @@ void QmlAnchorBindingProxy::removeLeftAnchor() {
|
|||||||
|
|
||||||
restoreProperty(modelNode(), "x");
|
restoreProperty(modelNode(), "x");
|
||||||
restoreProperty(modelNode(), "width");
|
restoreProperty(modelNode(), "width");
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlAnchorBindingProxy::removeRightAnchor() {
|
void QmlAnchorBindingProxy::removeRightAnchor() {
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::removeRightAnchor"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::removeRightAnchor"));
|
||||||
|
|
||||||
@@ -988,6 +1111,11 @@ void QmlAnchorBindingProxy::removeRightAnchor() {
|
|||||||
m_qmlItemNode.anchors().removeMargin(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)
|
void QmlAnchorBindingProxy::setVerticalCentered(bool centered)
|
||||||
@@ -1000,6 +1128,7 @@ void QmlAnchorBindingProxy::setVerticalCentered(bool centered)
|
|||||||
|
|
||||||
m_locked = true;
|
m_locked = true;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setVerticalCentered"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setVerticalCentered"));
|
||||||
|
|
||||||
@@ -1012,6 +1141,10 @@ void QmlAnchorBindingProxy::setVerticalCentered(bool centered)
|
|||||||
anchorVertical();
|
anchorVertical();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
m_locked = false;
|
m_locked = false;
|
||||||
|
|
||||||
emit relativeAnchorTargetVerticalChanged();
|
emit relativeAnchorTargetVerticalChanged();
|
||||||
@@ -1028,6 +1161,7 @@ void QmlAnchorBindingProxy::setHorizontalCentered(bool centered)
|
|||||||
|
|
||||||
m_locked = true;
|
m_locked = true;
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::setHorizontalCentered"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::setHorizontalCentered"));
|
||||||
|
|
||||||
@@ -1040,6 +1174,10 @@ void QmlAnchorBindingProxy::setHorizontalCentered(bool centered)
|
|||||||
anchorHorizontal();
|
anchorHorizontal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
m_locked = false;
|
m_locked = false;
|
||||||
|
|
||||||
emit relativeAnchorTargetHorizontalChanged();
|
emit relativeAnchorTargetHorizontalChanged();
|
||||||
@@ -1119,6 +1257,7 @@ bool QmlAnchorBindingProxy::horizontalCentered()
|
|||||||
void QmlAnchorBindingProxy::fill()
|
void QmlAnchorBindingProxy::fill()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
try {
|
||||||
RewriterTransaction transaction = beginRewriterTransaction(
|
RewriterTransaction transaction = beginRewriterTransaction(
|
||||||
QByteArrayLiteral("QmlAnchorBindingProxy::fill"));
|
QByteArrayLiteral("QmlAnchorBindingProxy::fill"));
|
||||||
|
|
||||||
@@ -1138,6 +1277,11 @@ void QmlAnchorBindingProxy::fill()
|
|||||||
m_qmlItemNode.anchors().removeMargin(AnchorLineTop);
|
m_qmlItemNode.anchors().removeMargin(AnchorLineTop);
|
||||||
m_qmlItemNode.anchors().removeMargin(AnchorLineBottom);
|
m_qmlItemNode.anchors().removeMargin(AnchorLineBottom);
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
e.showException();
|
||||||
|
}
|
||||||
|
|
||||||
emit topAnchorChanged();
|
emit topAnchorChanged();
|
||||||
emit bottomAnchorChanged();
|
emit bottomAnchorChanged();
|
||||||
emit leftAnchorChanged();
|
emit leftAnchorChanged();
|
||||||
|
@@ -870,6 +870,12 @@ bool NodeMetaInfoPrivate::isPropertyList(const PropertyName &propertyName) const
|
|||||||
const CppComponentValue *qmlObjectValue = getNearestCppComponentValue();
|
const CppComponentValue *qmlObjectValue = getNearestCppComponentValue();
|
||||||
if (!qmlObjectValue)
|
if (!qmlObjectValue)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!qmlObjectValue->hasProperty(QString::fromUtf8(propertyName))) {
|
||||||
|
const TypeName typeName = propertyType(propertyName);
|
||||||
|
return (typeName == "Item" || typeName == "QtObject");
|
||||||
|
}
|
||||||
|
|
||||||
return qmlObjectValue->isListProperty(QString::fromUtf8(propertyName));
|
return qmlObjectValue->isListProperty(QString::fromUtf8(propertyName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,14 +85,23 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent)
|
|||||||
if (newId == animation().id())
|
if (newId == animation().id())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!animation().isValidId(newId)) {
|
bool error = false;
|
||||||
|
|
||||||
|
if (!ModelNode::isValidId(newId)) {
|
||||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
||||||
tr("%1 is an invalid id.").arg(newId));
|
tr("%1 is an invalid id.").arg(newId));
|
||||||
|
error = true;
|
||||||
} else if (animation().view()->hasId(newId)) {
|
} else if (animation().view()->hasId(newId)) {
|
||||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
||||||
tr("%1 already exists.").arg(newId));
|
tr("%1 already exists.").arg(newId));
|
||||||
} else {
|
} else {
|
||||||
animation().setIdWithRefactoring(newId);
|
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())
|
if (newId == m_timeline.modelNode().id())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!m_timeline.modelNode().isValidId(newId)) {
|
bool error = false;
|
||||||
|
|
||||||
|
if (!ModelNode::isValidId(newId)) {
|
||||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
||||||
tr("%1 is an invalid id.").arg(newId));
|
tr("%1 is an invalid id.").arg(newId));
|
||||||
|
error = true;
|
||||||
} else if (m_timeline.view()->hasId(newId)) {
|
} else if (m_timeline.view()->hasId(newId)) {
|
||||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
Core::AsynchronousMessageBox::warning(tr("Invalid Id"),
|
||||||
tr("%1 already exists.").arg(newId));
|
tr("%1 already exists.").arg(newId));
|
||||||
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
m_timeline.modelNode().setIdWithRefactoring(newId);
|
m_timeline.modelNode().setIdWithRefactoring(newId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
lastString.clear();
|
||||||
|
ui->idLineEdit->setText(m_timeline.modelNode().id());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connectSpinBox(ui->startFrame, "startFrame");
|
connectSpinBox(ui->startFrame, "startFrame");
|
||||||
|
@@ -220,6 +220,7 @@ void TimelineSettingsDialog::setupTimelines(const QmlTimeline &timeline)
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTabForTimeline(ui->timelineTab, m_currentTimeline);
|
setTabForTimeline(ui->timelineTab, m_currentTimeline);
|
||||||
|
setupAnimations(m_currentTimeline);
|
||||||
m_timelineSettingsModel->resetModel();
|
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,22 +273,13 @@ def createProject_Qt_Console(path, projectName, checks = True, buildSystem = Non
|
|||||||
if checks:
|
if checks:
|
||||||
__verifyFileCreation__(path, expectedFiles)
|
__verifyFileCreation__(path, expectedFiles)
|
||||||
|
|
||||||
def createNewQtQuickApplication(workingDir, projectName = None,
|
def createNewQtQuickApplication(workingDir, projectName=None,
|
||||||
targets=Targets.desktopTargetClasses(), minimumQtVersion="5.6",
|
targets=Targets.desktopTargetClasses(), minimumQtVersion="5.6",
|
||||||
withControls = False, fromWelcome = False, buildSystem = None):
|
template="Qt Quick Application - Empty", fromWelcome=False,
|
||||||
if withControls:
|
buildSystem=None):
|
||||||
template = "Qt Quick Application - Swipe"
|
|
||||||
else:
|
|
||||||
template = "Qt Quick Application - Empty"
|
|
||||||
available = __createProjectOrFileSelectType__(" Application", template, fromWelcome)
|
available = __createProjectOrFileSelectType__(" Application", template, fromWelcome)
|
||||||
projectName = __createProjectSetNameAndPath__(workingDir, projectName)
|
projectName = __createProjectSetNameAndPath__(workingDir, projectName)
|
||||||
__handleBuildSystem__(buildSystem)
|
__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)
|
__modifyAvailableTargets__(available, requiredQt)
|
||||||
checkedTargets = __chooseTargets__(targets, available)
|
checkedTargets = __chooseTargets__(targets, available)
|
||||||
|
@@ -59,13 +59,6 @@ JIRA_URL='https://bugreports.qt.io/browse'
|
|||||||
class JIRA:
|
class JIRA:
|
||||||
__instance__ = None
|
__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
|
# Helper class
|
||||||
class Bug:
|
class Bug:
|
||||||
CREATOR = 'QTCREATORBUG'
|
CREATOR = 'QTCREATORBUG'
|
||||||
@@ -93,45 +86,12 @@ class JIRA:
|
|||||||
def __setattr__(self, attr, value):
|
def __setattr__(self, attr, value):
|
||||||
return setattr(self.__instance__, 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
|
# function to check if the given bug is open or not
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def isBugStillOpen(number, bugType=Bug.CREATOR):
|
def isBugStillOpen(number, bugType=Bug.CREATOR):
|
||||||
tmpJIRA = JIRA(number, bugType)
|
tmpJIRA = JIRA(number, bugType)
|
||||||
return tmpJIRA.isOpen()
|
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
|
# implementation of JIRA singleton
|
||||||
class __impl:
|
class __impl:
|
||||||
# constructor of __impl
|
# constructor of __impl
|
||||||
@@ -139,8 +99,6 @@ class JIRA:
|
|||||||
self._number = number
|
self._number = number
|
||||||
self._bugType = bugType
|
self._bugType = bugType
|
||||||
self._fix = None
|
self._fix = None
|
||||||
self._localOnly = os.getenv("SYSTEST_JIRA_NO_LOOKUP")=="1"
|
|
||||||
self.__initBugDict__()
|
|
||||||
self._fetchResults_ = {}
|
self._fetchResults_ = {}
|
||||||
self.__fetchResolutionFromJira__()
|
self.__fetchResolutionFromJira__()
|
||||||
|
|
||||||
@@ -169,7 +127,6 @@ class JIRA:
|
|||||||
return
|
return
|
||||||
data = None
|
data = None
|
||||||
proxy = os.getenv("SYSTEST_PROXY", None)
|
proxy = os.getenv("SYSTEST_PROXY", None)
|
||||||
if not self._localOnly:
|
|
||||||
try:
|
try:
|
||||||
if proxy:
|
if proxy:
|
||||||
proxy = urllib2.ProxyHandler({'https': proxy})
|
proxy = urllib2.ProxyHandler({'https': proxy})
|
||||||
@@ -184,14 +141,8 @@ class JIRA:
|
|||||||
"Try to install the ssl module by yourself, or set the python "
|
"Try to install the ssl module by yourself, or set the python "
|
||||||
"path inside SQUISHDIR/etc/paths.ini to use a python version with "
|
"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!")
|
"ssl support OR install wget or curl to get rid of this warning!")
|
||||||
self._localOnly = True
|
|
||||||
if data == None:
|
if data == None:
|
||||||
if bug in self.__bugs__:
|
test.fatal("No resolution info for %s" % bug)
|
||||||
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'
|
self._resolution = 'Done'
|
||||||
else:
|
else:
|
||||||
data = data.replace("\r", "").replace("\n", "")
|
data = data.replace("\r", "").replace("\n", "")
|
||||||
@@ -249,14 +200,3 @@ class JIRA:
|
|||||||
"%s[...]" % fetched[:200])
|
"%s[...]" % fetched[:200])
|
||||||
else:
|
else:
|
||||||
test.log("Fetched and cropped data: [...]%s[...]" % fetched[resoInd-20:resoInd+100])
|
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
|
return
|
||||||
test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
|
test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
|
||||||
"Verifying if: .cpp file is opened in Edit mode.")
|
"Verifying if: .cpp file is opened in Edit mode.")
|
||||||
# place cursor on line "QmlApplicationViewer viewer;"
|
|
||||||
editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
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",
|
if not invokeFindUsage(editorWidget, "class TriangleWindow : public OpenGLWindow",
|
||||||
"<Left>"):
|
"<Left>"):
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
@@ -30,26 +30,20 @@ def main():
|
|||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
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:
|
for qtVersion, appTemplate, targ in available:
|
||||||
targ = Targets.DESKTOP_5_6_1_DEFAULT
|
|
||||||
# using a temporary directory won't mess up a potentially existing
|
# using a temporary directory won't mess up a potentially existing
|
||||||
workingDir = tempDir()
|
workingDir = tempDir()
|
||||||
checkedTargets = createNewQtQuickApplication(workingDir, targets=[targ],
|
checkedTargets = createNewQtQuickApplication(workingDir, targets=[targ],
|
||||||
minimumQtVersion=qtVersion,
|
minimumQtVersion=qtVersion,
|
||||||
withControls = controls)[0]
|
template=appTemplate)[0]
|
||||||
if len(checkedTargets) == 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
|
continue
|
||||||
additionalText = ''
|
test.log("Building project %s (%s)"
|
||||||
if controls:
|
% (appTemplate, Targets.getStringForTarget(targ)))
|
||||||
additionalText = ' Controls '
|
|
||||||
test.log("Building project Qt Quick%sApplication (%s)"
|
|
||||||
% (additionalText, Targets.getStringForTarget(targ)))
|
|
||||||
invokeMenuItem("Build", "Build All")
|
invokeMenuItem("Build", "Build All")
|
||||||
waitForCompile()
|
waitForCompile()
|
||||||
if not checkCompile():
|
if not checkCompile():
|
||||||
|
Reference in New Issue
Block a user