forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/6.0'"
This commit is contained in:
@@ -1157,12 +1157,16 @@ QStandardItemModel *ListField::itemModel()
|
|||||||
return m_itemModel;
|
return m_itemModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListField::selectRow(int row)
|
bool ListField::selectRow(int row)
|
||||||
{
|
{
|
||||||
auto index = itemModel()->index(row, 0);
|
QModelIndex index = itemModel()->index(row, 0);
|
||||||
|
if (!index.isValid())
|
||||||
|
return false;
|
||||||
|
|
||||||
selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
|
selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
|
||||||
|
|
||||||
this->updateIndex();
|
this->updateIndex();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QItemSelectionModel *ListField::selectionModel() const
|
QItemSelectionModel *ListField::selectionModel() const
|
||||||
@@ -1271,12 +1275,15 @@ QVariant ComboBoxField::toSettings() const
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBoxField::selectRow(int row)
|
bool ComboBoxField::selectRow(int row)
|
||||||
{
|
{
|
||||||
ListField::selectRow(row);
|
if (!ListField::selectRow(row))
|
||||||
|
return false;
|
||||||
|
|
||||||
auto w = qobject_cast<QComboBox *>(widget());
|
auto w = qobject_cast<QComboBox *>(widget());
|
||||||
w->setCurrentIndex(row);
|
w->setCurrentIndex(row);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ComboBoxField::selectedRow() const
|
int ComboBoxField::selectedRow() const
|
||||||
|
@@ -282,7 +282,7 @@ public:
|
|||||||
~ListField() override;
|
~ListField() override;
|
||||||
|
|
||||||
QStandardItemModel *model() { return m_itemModel; }
|
QStandardItemModel *model() { return m_itemModel; }
|
||||||
virtual void selectRow(int row);
|
virtual bool selectRow(int row);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool parseData(const QVariant &data, QString *errorMessage) override;
|
bool parseData(const QVariant &data, QString *errorMessage) override;
|
||||||
@@ -351,7 +351,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void selectRow(int row) override;
|
bool selectRow(int row) override;
|
||||||
int selectedRow() const;
|
int selectedRow() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -78,6 +78,7 @@ using namespace LanguageUtils;
|
|||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
|
|
||||||
static Q_LOGGING_CATEGORY(rewriterBenchmark, "qtc.rewriter.load", QtWarningMsg)
|
static Q_LOGGING_CATEGORY(rewriterBenchmark, "qtc.rewriter.load", QtWarningMsg)
|
||||||
|
static Q_LOGGING_CATEGORY(texttomodelMergerDebug, "qtc.texttomodelmerger.debug", QtDebugMsg)
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -574,7 +575,7 @@ public:
|
|||||||
if (parentObject)
|
if (parentObject)
|
||||||
*parentObject = objectValue;
|
*parentObject = objectValue;
|
||||||
if (!value) {
|
if (!value) {
|
||||||
qWarning() << Q_FUNC_INFO << "Skipping invalid property name" << propertyName;
|
qCInfo(texttomodelMergerDebug) << Q_FUNC_INFO << "Skipping invalid property name" << propertyName;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -655,7 +656,8 @@ public:
|
|||||||
const ObjectValue *containingObject = nullptr;
|
const ObjectValue *containingObject = nullptr;
|
||||||
QString name;
|
QString name;
|
||||||
if (!lookupProperty(propertyPrefix, propertyId, &property, &containingObject, &name)) {
|
if (!lookupProperty(propertyPrefix, propertyId, &property, &containingObject, &name)) {
|
||||||
qWarning() << Q_FUNC_INFO << "Unknown property" << propertyPrefix + QLatin1Char('.') + toString(propertyId)
|
qCInfo(texttomodelMergerDebug) << Q_FUNC_INFO << "Unknown property"
|
||||||
|
<< propertyPrefix + QLatin1Char('.') + toString(propertyId)
|
||||||
<< "on line" << propertyId->identifierToken.startLine
|
<< "on line" << propertyId->identifierToken.startLine
|
||||||
<< "column" << propertyId->identifierToken.startColumn;
|
<< "column" << propertyId->identifierToken.startColumn;
|
||||||
return hasQuotes ? QVariant(cleanedValue) : cleverConvert(cleanedValue);
|
return hasQuotes ? QVariant(cleanedValue) : cleverConvert(cleanedValue);
|
||||||
|
@@ -97,17 +97,20 @@ public:
|
|||||||
Sqlite::JournalMode::Wal,
|
Sqlite::JournalMode::Wal,
|
||||||
Sqlite::LockingMode::Normal};
|
Sqlite::LockingMode::Normal};
|
||||||
ImageCacheStorage<Sqlite::Database> storage{database};
|
ImageCacheStorage<Sqlite::Database> storage{database};
|
||||||
ImageCacheConnectionManager connectionManager;
|
|
||||||
ImageCacheCollector collector{connectionManager,
|
|
||||||
ImageCacheCollectorNullImageHandling::DontCaptureNullImage};
|
|
||||||
TimeStampProvider timeStampProvider;
|
|
||||||
AsynchronousExplicitImageCache cache{storage};
|
AsynchronousExplicitImageCache cache{storage};
|
||||||
AsynchronousImageFactory factory{storage, timeStampProvider, collector};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QmlDesignerProjectManagerProjectData
|
class QmlDesignerProjectManagerProjectData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
QmlDesignerProjectManagerProjectData(ImageCacheStorage<Sqlite::Database> &storage)
|
||||||
|
: factory{storage, timeStampProvider, collector}
|
||||||
|
{}
|
||||||
|
ImageCacheConnectionManager connectionManager;
|
||||||
|
ImageCacheCollector collector{connectionManager,
|
||||||
|
ImageCacheCollectorNullImageHandling::DontCaptureNullImage};
|
||||||
|
TimeStampProvider timeStampProvider;
|
||||||
|
AsynchronousImageFactory factory;
|
||||||
::ProjectExplorer::Target *activeTarget = nullptr;
|
::ProjectExplorer::Target *activeTarget = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -157,8 +160,8 @@ void QmlDesignerProjectManager::currentEditorChanged(::Core::IEditor *)
|
|||||||
m_projectData->activeTarget);
|
m_projectData->activeTarget);
|
||||||
|
|
||||||
if (qmlBuildSystem) {
|
if (qmlBuildSystem) {
|
||||||
m_imageCacheData->collector.setTarget(m_projectData->activeTarget);
|
m_projectData->collector.setTarget(m_projectData->activeTarget);
|
||||||
m_imageCacheData->factory.generate(qmlBuildSystem->mainFilePath().toString().toUtf8());
|
m_projectData->factory.generate(qmlBuildSystem->mainFilePath().toString().toUtf8());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,16 +169,14 @@ void QmlDesignerProjectManager::editorsClosed(const QList<::Core::IEditor *> &)
|
|||||||
|
|
||||||
void QmlDesignerProjectManager::projectAdded(::ProjectExplorer::Project *project)
|
void QmlDesignerProjectManager::projectAdded(::ProjectExplorer::Project *project)
|
||||||
{
|
{
|
||||||
m_projectData = std::make_unique<QmlDesignerProjectManagerProjectData>();
|
m_projectData = std::make_unique<QmlDesignerProjectManagerProjectData>(m_imageCacheData->storage);
|
||||||
m_projectData->activeTarget = project->activeTarget();
|
m_projectData->activeTarget = project->activeTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerProjectManager::aboutToRemoveProject(::ProjectExplorer::Project *)
|
void QmlDesignerProjectManager::aboutToRemoveProject(::ProjectExplorer::Project *)
|
||||||
{
|
{
|
||||||
if (m_projectData) {
|
if (m_projectData)
|
||||||
m_imageCacheData->collector.setTarget(m_projectData->activeTarget);
|
|
||||||
m_projectData.reset();
|
m_projectData.reset();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesignerProjectManager::projectRemoved(::ProjectExplorer::Project *) {}
|
void QmlDesignerProjectManager::projectRemoved(::ProjectExplorer::Project *) {}
|
||||||
|
@@ -62,7 +62,7 @@ private:
|
|||||||
void projectRemoved(::ProjectExplorer::Project *project);
|
void projectRemoved(::ProjectExplorer::Project *project);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<QmlDesignerProjectManagerProjectData> m_projectData;
|
|
||||||
std::unique_ptr<PreviewImageCacheData> m_imageCacheData;
|
std::unique_ptr<PreviewImageCacheData> m_imageCacheData;
|
||||||
|
std::unique_ptr<QmlDesignerProjectManagerProjectData> m_projectData;
|
||||||
};
|
};
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -99,6 +99,11 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FilePath &fi
|
|||||||
if (fileSelectorsProperty.isValid())
|
if (fileSelectorsProperty.isValid())
|
||||||
projectItem->setFileSelectors(fileSelectorsProperty.value.toStringList());
|
projectItem->setFileSelectors(fileSelectorsProperty.value.toStringList());
|
||||||
|
|
||||||
|
const auto multilanguageSupportProperty = rootNode->property(
|
||||||
|
QLatin1String("multilanguageSupport"));
|
||||||
|
if (multilanguageSupportProperty.isValid())
|
||||||
|
projectItem->setMultilanguageSupport(multilanguageSupportProperty.value.toBool());
|
||||||
|
|
||||||
const auto languagesProperty = rootNode->property(QLatin1String("supportedLanguages"));
|
const auto languagesProperty = rootNode->property(QLatin1String("supportedLanguages"));
|
||||||
if (languagesProperty.isValid())
|
if (languagesProperty.isValid())
|
||||||
projectItem->setSupportedLanguages(languagesProperty.value.toStringList());
|
projectItem->setSupportedLanguages(languagesProperty.value.toStringList());
|
||||||
|
@@ -77,6 +77,11 @@ void QmlProjectItem::setFileSelectors(const QStringList &selectors)
|
|||||||
m_fileSelectors = selectors;
|
m_fileSelectors = selectors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlProjectItem::setMultilanguageSupport(const bool isEnabled)
|
||||||
|
{
|
||||||
|
m_multilanguageSupport = isEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
void QmlProjectItem::setSupportedLanguages(const QStringList &languages)
|
void QmlProjectItem::setSupportedLanguages(const QStringList &languages)
|
||||||
{
|
{
|
||||||
if (m_supportedLanguages != languages)
|
if (m_supportedLanguages != languages)
|
||||||
|
@@ -63,6 +63,9 @@ public:
|
|||||||
QStringList fileSelectors() const { return m_fileSelectors; }
|
QStringList fileSelectors() const { return m_fileSelectors; }
|
||||||
void setFileSelectors(const QStringList &selectors);
|
void setFileSelectors(const QStringList &selectors);
|
||||||
|
|
||||||
|
bool multilanguageSupport() const { return m_multilanguageSupport; }
|
||||||
|
void setMultilanguageSupport(const bool isEnabled);
|
||||||
|
|
||||||
QStringList supportedLanguages() const { return m_supportedLanguages; }
|
QStringList supportedLanguages() const { return m_supportedLanguages; }
|
||||||
void setSupportedLanguages(const QStringList &languages);
|
void setSupportedLanguages(const QStringList &languages);
|
||||||
|
|
||||||
@@ -94,6 +97,7 @@ protected:
|
|||||||
QString m_targetDirectory;
|
QString m_targetDirectory;
|
||||||
QStringList m_importPaths;
|
QStringList m_importPaths;
|
||||||
QStringList m_fileSelectors;
|
QStringList m_fileSelectors;
|
||||||
|
bool m_multilanguageSupport;
|
||||||
QStringList m_supportedLanguages;
|
QStringList m_supportedLanguages;
|
||||||
QString m_primaryLanguage;
|
QString m_primaryLanguage;
|
||||||
QString m_mainFile;
|
QString m_mainFile;
|
||||||
|
@@ -75,8 +75,9 @@ QmlMultiLanguageAspect::QmlMultiLanguageAspect(ProjectExplorer::Target *target)
|
|||||||
{
|
{
|
||||||
setVisible(isMultilanguagePresent());
|
setVisible(isMultilanguagePresent());
|
||||||
setSettingsKey(Constants::USE_MULTILANGUAGE_KEY);
|
setSettingsKey(Constants::USE_MULTILANGUAGE_KEY);
|
||||||
setLabel(tr("Use MultiLanguage translation database."), BoolAspect::LabelPlacement::AtCheckBox);
|
setLabel(tr("Use MultiLanguage in Form Editor."), BoolAspect::LabelPlacement::AtCheckBox);
|
||||||
setToolTip(tr("Enable loading application with special desktop SQLite translation database."));
|
setToolTip(tr("By enabling this Form Editor can read translations\n"
|
||||||
|
"from MultiLanguage plugin."));
|
||||||
|
|
||||||
setDefaultValue(!databaseFilePath().isEmpty());
|
setDefaultValue(!databaseFilePath().isEmpty());
|
||||||
QVariantMap getDefaultValues;
|
QVariantMap getDefaultValues;
|
||||||
|
@@ -340,6 +340,13 @@ QStringList QmlBuildSystem::customFileSelectors() const
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QmlBuildSystem::multilanguageSupport() const
|
||||||
|
{
|
||||||
|
if (m_projectItem)
|
||||||
|
return m_projectItem->multilanguageSupport();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList QmlBuildSystem::supportedLanguages() const
|
QStringList QmlBuildSystem::supportedLanguages() const
|
||||||
{
|
{
|
||||||
if (m_projectItem)
|
if (m_projectItem)
|
||||||
|
@@ -88,6 +88,7 @@ public:
|
|||||||
Utils::EnvironmentItems environment() const;
|
Utils::EnvironmentItems environment() const;
|
||||||
QStringList customImportPaths() const;
|
QStringList customImportPaths() const;
|
||||||
QStringList customFileSelectors() const;
|
QStringList customFileSelectors() const;
|
||||||
|
bool multilanguageSupport() const;
|
||||||
QStringList supportedLanguages() const;
|
QStringList supportedLanguages() const;
|
||||||
void setSupportedLanguages(QStringList languages);
|
void setSupportedLanguages(QStringList languages);
|
||||||
QString primaryLanguage() const;
|
QString primaryLanguage() const;
|
||||||
|
@@ -120,16 +120,24 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
|
|||||||
connect(target, &Target::kitChanged, this, &RunConfiguration::update);
|
connect(target, &Target::kitChanged, this, &RunConfiguration::update);
|
||||||
|
|
||||||
m_multiLanguageAspect = addAspect<QmlMultiLanguageAspect>(target);
|
m_multiLanguageAspect = addAspect<QmlMultiLanguageAspect>(target);
|
||||||
|
auto buildSystem = qobject_cast<const QmlBuildSystem *>(activeBuildSystem());
|
||||||
|
if (buildSystem)
|
||||||
|
m_multiLanguageAspect->setValue(buildSystem->multilanguageSupport());
|
||||||
|
|
||||||
auto envAspect = addAspect<EnvironmentAspect>();
|
auto envAspect = addAspect<EnvironmentAspect>();
|
||||||
connect(m_multiLanguageAspect, &QmlMultiLanguageAspect::changed, envAspect, &EnvironmentAspect::environmentChanged);
|
connect(m_multiLanguageAspect,
|
||||||
|
&QmlMultiLanguageAspect::changed,
|
||||||
|
envAspect,
|
||||||
|
&EnvironmentAspect::environmentChanged);
|
||||||
|
|
||||||
auto envModifier = [this](Environment env) {
|
auto envModifier = [this](Environment env) {
|
||||||
if (auto bs = dynamic_cast<const QmlBuildSystem *>(activeBuildSystem()))
|
if (auto bs = qobject_cast<const QmlBuildSystem *>(activeBuildSystem()))
|
||||||
env.modify(bs->environment());
|
env.modify(bs->environment());
|
||||||
|
|
||||||
if (m_multiLanguageAspect && m_multiLanguageAspect->value() && !m_multiLanguageAspect->databaseFilePath().isEmpty()) {
|
if (m_multiLanguageAspect && m_multiLanguageAspect->value()
|
||||||
env.set("QT_MULTILANGUAGE_DATABASE", m_multiLanguageAspect->databaseFilePath().toString());
|
&& !m_multiLanguageAspect->databaseFilePath().isEmpty()) {
|
||||||
|
env.set("QT_MULTILANGUAGE_DATABASE",
|
||||||
|
m_multiLanguageAspect->databaseFilePath().toString());
|
||||||
env.set("QT_MULTILANGUAGE_LANGUAGE", m_multiLanguageAspect->currentLocale());
|
env.set("QT_MULTILANGUAGE_LANGUAGE", m_multiLanguageAspect->currentLocale());
|
||||||
} else {
|
} else {
|
||||||
env.unset("QT_MULTILANGUAGE_DATABASE");
|
env.unset("QT_MULTILANGUAGE_DATABASE");
|
||||||
|
@@ -68,6 +68,7 @@ void CreateProject::processFieldPage(ProjectExplorer::JsonFieldPage *page)
|
|||||||
auto widthField = dynamic_cast<ProjectExplorer::LineEditField *>(page->jsonField("CustomScreenWidth"));
|
auto widthField = dynamic_cast<ProjectExplorer::LineEditField *>(page->jsonField("CustomScreenWidth"));
|
||||||
auto heightField = dynamic_cast<ProjectExplorer::LineEditField *>(page->jsonField("CustomScreenHeight"));
|
auto heightField = dynamic_cast<ProjectExplorer::LineEditField *>(page->jsonField("CustomScreenHeight"));
|
||||||
|
|
||||||
|
// TODO: use m_wizard to set these text items?
|
||||||
if (widthField && heightField) {
|
if (widthField && heightField) {
|
||||||
if (!m_customWidth.isEmpty() && !m_customHeight.isEmpty()) {
|
if (!m_customWidth.isEmpty() && !m_customHeight.isEmpty()) {
|
||||||
widthField->setText(m_customWidth);
|
widthField->setText(m_customWidth);
|
||||||
|
@@ -170,17 +170,26 @@ void QdsNewDialog::onProjectCanBeCreatedChanged(bool value)
|
|||||||
emit fieldsValidChanged();
|
emit fieldsValidChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QdsNewDialog::updateScreenSizes()
|
||||||
|
{
|
||||||
|
int index = m_wizard.screenSizeIndex(m_currentPreset->screenSizeName);
|
||||||
|
if (index > -1) {
|
||||||
|
setScreenSizeIndex(index);
|
||||||
|
} else {
|
||||||
|
index = m_screenSizeModel->appendItem(m_currentPreset->screenSizeName);
|
||||||
|
setScreenSizeIndex(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_screenSizeModel->reset();
|
||||||
|
}
|
||||||
|
|
||||||
void QdsNewDialog::onWizardCreated(QStandardItemModel *screenSizeModel, QStandardItemModel *styleModel)
|
void QdsNewDialog::onWizardCreated(QStandardItemModel *screenSizeModel, QStandardItemModel *styleModel)
|
||||||
{
|
{
|
||||||
m_screenSizeModel->setBackendModel(screenSizeModel);
|
m_screenSizeModel->setBackendModel(screenSizeModel);
|
||||||
m_styleModel->setBackendModel(styleModel);
|
m_styleModel->setBackendModel(styleModel);
|
||||||
|
|
||||||
if (m_qmlDetailsLoaded) {
|
if (m_qmlDetailsLoaded) {
|
||||||
int index = m_wizard.screenSizeIndex(m_currentPreset->screenSizeName);
|
updateScreenSizes();
|
||||||
if (index > -1)
|
|
||||||
setScreenSizeIndex(index);
|
|
||||||
|
|
||||||
m_screenSizeModel->reset();
|
|
||||||
|
|
||||||
emit haveVirtualKeyboardChanged();
|
emit haveVirtualKeyboardChanged();
|
||||||
emit haveTargetQtVersionChanged();
|
emit haveTargetQtVersionChanged();
|
||||||
@@ -288,11 +297,7 @@ void QdsNewDialog::setWizardFactories(QList<Core::IWizardFactory *> factories_,
|
|||||||
emit projectLocationChanged(); // So that QML knows to update the field
|
emit projectLocationChanged(); // So that QML knows to update the field
|
||||||
|
|
||||||
if (m_qmlDetailsLoaded) {
|
if (m_qmlDetailsLoaded) {
|
||||||
int index = m_wizard.screenSizeIndex(m_currentPreset->screenSizeName);
|
updateScreenSizes();
|
||||||
if (index > -1)
|
|
||||||
setScreenSizeIndex(index);
|
|
||||||
|
|
||||||
m_screenSizeModel->reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_qmlStylesLoaded)
|
if (m_qmlStylesLoaded)
|
||||||
@@ -334,9 +339,9 @@ void QdsNewDialog::accept()
|
|||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
PresetItem item = m_wizard.preset();
|
PresetItem item = m_wizard.preset();
|
||||||
QString screenSize = m_wizard.screenSizeName(m_qmlScreenSizeIndex);
|
QString customSizeName = m_qmlCustomWidth + " x " + m_qmlCustomHeight;
|
||||||
|
|
||||||
m_recentsStore.add(item.categoryId, item.name, screenSize);
|
m_recentsStore.add(item.categoryId, item.name, customSizeName);
|
||||||
|
|
||||||
m_dialog->close();
|
m_dialog->close();
|
||||||
m_dialog->deleteLater();
|
m_dialog->deleteLater();
|
||||||
|
@@ -131,6 +131,8 @@ private:
|
|||||||
|
|
||||||
QString projectDescription() const { return m_qmlProjectDescription; }
|
QString projectDescription() const { return m_qmlProjectDescription; }
|
||||||
|
|
||||||
|
void updateScreenSizes();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onDeletingWizard();
|
void onDeletingWizard();
|
||||||
void onWizardCreated(QStandardItemModel *screenSizeModel, QStandardItemModel *styleModel);
|
void onWizardCreated(QStandardItemModel *screenSizeModel, QStandardItemModel *styleModel);
|
||||||
|
119
src/plugins/studiowelcome/qml/downloaddialog/PushButton.ui.qml
Normal file
119
src/plugins/studiowelcome/qml/downloaddialog/PushButton.ui.qml
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2021 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.15
|
||||||
|
import QtQuick.Templates 2.15
|
||||||
|
import ExampleCheckout 1.0
|
||||||
|
import StudioTheme 1.0
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: control
|
||||||
|
|
||||||
|
implicitWidth: Math.max(
|
||||||
|
buttonBackground ? buttonBackground.implicitWidth : 0,
|
||||||
|
textItem.implicitWidth + leftPadding + rightPadding)
|
||||||
|
implicitHeight: Math.max(
|
||||||
|
buttonBackground ? buttonBackground.implicitHeight : 0,
|
||||||
|
textItem.implicitHeight + topPadding + bottomPadding)
|
||||||
|
leftPadding: 4
|
||||||
|
rightPadding: 4
|
||||||
|
|
||||||
|
text: "My Button"
|
||||||
|
property alias fontpixelSize: textItem.font.pixelSize
|
||||||
|
//property bool decorated: false
|
||||||
|
state: "normal"
|
||||||
|
|
||||||
|
background: buttonBackground
|
||||||
|
Rectangle {
|
||||||
|
id: buttonBackground
|
||||||
|
color: "#00000000"
|
||||||
|
implicitWidth: 100
|
||||||
|
implicitHeight: 40
|
||||||
|
opacity: enabled ? 1 : 0.3
|
||||||
|
radius: 2
|
||||||
|
border.color: "#047eff"
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
contentItem: textItem
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: textItem
|
||||||
|
text: control.text
|
||||||
|
font.pixelSize: 18
|
||||||
|
|
||||||
|
opacity: enabled ? 1.0 : 0.3
|
||||||
|
color: Values.themeTextColor
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "normal"
|
||||||
|
when: !control.down && !control.hovered
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: buttonBackground
|
||||||
|
color: Values.themeControlBackground
|
||||||
|
border.color: Values.themeControlOutline
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: textItem
|
||||||
|
color: Values.themeTextColor
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "hover"
|
||||||
|
when: control.hovered && !control.down
|
||||||
|
PropertyChanges {
|
||||||
|
target: textItem
|
||||||
|
color: Values.themeTextColor
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: buttonBackground
|
||||||
|
color: Values.themeControlBackgroundHover
|
||||||
|
border.color: Values.themeControlOutline
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "activeQds"
|
||||||
|
when: control.down
|
||||||
|
PropertyChanges {
|
||||||
|
target: textItem
|
||||||
|
color: "#ffffff"
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: buttonBackground
|
||||||
|
color: "#2e769e"
|
||||||
|
border.color: "#00000000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@@ -30,17 +30,23 @@ import ExampleCheckout 1.0
|
|||||||
import QtQuick.Layouts 1.11
|
import QtQuick.Layouts 1.11
|
||||||
|
|
||||||
import StudioFonts 1.0
|
import StudioFonts 1.0
|
||||||
|
import StudioTheme 1.0
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
|
property color currentThemeBackground: Values.welcomeScreenBackground
|
||||||
|
property color themeTextColor: Values.themeTextColor
|
||||||
|
|
||||||
id: root
|
id: root
|
||||||
property alias url: downloader.url
|
property alias url: downloader.url
|
||||||
property string path: fileExtractor.targetPath
|
property string path: fileExtractor.targetPath
|
||||||
width: 620
|
width: 620
|
||||||
height: 300
|
height: 300
|
||||||
|
|
||||||
color: "#2d2e30"
|
color: root.currentThemeBackground
|
||||||
|
|
||||||
property color textColor: "#b9b9ba"
|
property color textColor: Values.themeTextColor
|
||||||
|
|
||||||
signal canceled
|
signal canceled
|
||||||
signal accepted
|
signal accepted
|
||||||
@@ -51,7 +57,7 @@ Rectangle {
|
|||||||
StackLayout {
|
StackLayout {
|
||||||
id: stackLayout
|
id: stackLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
currentIndex: root.tempFile.length === 0 ? 0 : 1
|
currentIndex: root.tempFile.length === 0 ? 1 : 1
|
||||||
|
|
||||||
FileExtractor {
|
FileExtractor {
|
||||||
id: fileExtractor
|
id: fileExtractor
|
||||||
@@ -76,7 +82,7 @@ Rectangle {
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
DialogButton {
|
PushButton {
|
||||||
id: button
|
id: button
|
||||||
x: 532
|
x: 532
|
||||||
y: 432
|
y: 432
|
||||||
@@ -87,6 +93,7 @@ Rectangle {
|
|||||||
anchors.rightMargin: 20
|
anchors.rightMargin: 20
|
||||||
enabled: false
|
enabled: false
|
||||||
onClicked: stackLayout.currentIndex = 1
|
onClicked: stackLayout.currentIndex = 1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CoolProgressBar {
|
CoolProgressBar {
|
||||||
@@ -106,7 +113,7 @@ Rectangle {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogButton {
|
PushButton{
|
||||||
id: downloadbutton
|
id: downloadbutton
|
||||||
y: 420
|
y: 420
|
||||||
enabled: !button.enabled
|
enabled: !button.enabled
|
||||||
@@ -119,6 +126,7 @@ Rectangle {
|
|||||||
downloadbutton.enabled = false
|
downloadbutton.enabled = false
|
||||||
downloader.start()
|
downloader.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CircularIndicator {
|
CircularIndicator {
|
||||||
@@ -138,7 +146,7 @@ Rectangle {
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
DialogButton {
|
PushButton {
|
||||||
id: nextPageDestination
|
id: nextPageDestination
|
||||||
x: 532
|
x: 532
|
||||||
y: 432
|
y: 432
|
||||||
@@ -152,6 +160,7 @@ Rectangle {
|
|||||||
stackLayout.currentIndex = 2
|
stackLayout.currentIndex = 2
|
||||||
fileExtractor.extract()
|
fileExtractor.extract()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
@@ -171,7 +180,7 @@ Rectangle {
|
|||||||
readOnly: true
|
readOnly: true
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogButton {
|
PushButton{
|
||||||
id: browse
|
id: browse
|
||||||
text: qsTr("Browse")
|
text: qsTr("Browse")
|
||||||
onClicked: fileExtractor.browse()
|
onClicked: fileExtractor.browse()
|
||||||
@@ -189,7 +198,7 @@ Rectangle {
|
|||||||
visible: !nextPageDestination.enabled
|
visible: !nextPageDestination.enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogButton {
|
PushButton{
|
||||||
id: button5
|
id: button5
|
||||||
x: 400
|
x: 400
|
||||||
y: 420
|
y: 420
|
||||||
@@ -199,6 +208,7 @@ Rectangle {
|
|||||||
anchors.bottomMargin: 20
|
anchors.bottomMargin: 20
|
||||||
anchors.rightMargin: 20
|
anchors.rightMargin: 20
|
||||||
onClicked: root.canceled()
|
onClicked: root.canceled()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogLabel {
|
DialogLabel {
|
||||||
@@ -215,8 +225,7 @@ Rectangle {
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
PushButton{
|
||||||
DialogButton {
|
|
||||||
id: done
|
id: done
|
||||||
x: 532
|
x: 532
|
||||||
y: 432
|
y: 432
|
||||||
@@ -227,6 +236,7 @@ Rectangle {
|
|||||||
anchors.rightMargin: 20
|
anchors.rightMargin: 20
|
||||||
enabled: fileExtractor.finished
|
enabled: fileExtractor.finished
|
||||||
onClicked: root.accepted()
|
onClicked: root.accepted()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -241,8 +251,7 @@ Rectangle {
|
|||||||
anchors.bottomMargin: 20
|
anchors.bottomMargin: 20
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PushButton{
|
||||||
DialogButton {
|
|
||||||
id: details
|
id: details
|
||||||
x: 8
|
x: 8
|
||||||
text: qsTr("Details")
|
text: qsTr("Details")
|
||||||
@@ -250,6 +259,7 @@ Rectangle {
|
|||||||
anchors.topMargin: 66
|
anchors.topMargin: 66
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
checkable: true
|
checkable: true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -291,7 +301,7 @@ Rectangle {
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
DialogButton {
|
PushButton{
|
||||||
id: finish
|
id: finish
|
||||||
x: 532
|
x: 532
|
||||||
y: 432
|
y: 432
|
||||||
@@ -301,6 +311,7 @@ Rectangle {
|
|||||||
anchors.bottomMargin: 20
|
anchors.bottomMargin: 20
|
||||||
anchors.rightMargin: 20
|
anchors.rightMargin: 20
|
||||||
onClicked: root.canceled()
|
onClicked: root.canceled()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogLabel {
|
DialogLabel {
|
||||||
|
@@ -87,6 +87,12 @@ public:
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int appendItem(const QString &text)
|
||||||
|
{
|
||||||
|
m_backendModel->appendRow(new QStandardItem{text});
|
||||||
|
return rowCount(QModelIndex{}) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
QHash<int, QByteArray> roleNames() const override
|
QHash<int, QByteArray> roleNames() const override
|
||||||
{
|
{
|
||||||
if (m_backendModel)
|
if (m_backendModel)
|
||||||
|
Reference in New Issue
Block a user