aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-10-19 14:10:51 +0200
committerEike Ziller <eike.ziller@qt.io>2020-10-19 14:10:51 +0200
commit4d39f2736f3012a3defbf4a7d80fc1a21a86bdfb (patch)
tree9d3c73ce9182bebbd33a0f6b6894bd4fea6294f8 /src
parent91fb438b94500a864fbf70bd44f33ea137995bc5 (diff)
parent80dda222e0aab4f7e88627b6ad5288b91db03643 (diff)
Merge remote-tracking branch 'origin/4.13' into 4.14
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.cpp28
-rw-r--r--src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.ui6
-rw-r--r--src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewplugin.cpp20
-rw-r--r--src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp2
4 files changed, 42 insertions, 14 deletions
diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.cpp b/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.cpp
index 4f958d59f6..c7e1ab192c 100644
--- a/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.cpp
+++ b/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.cpp
@@ -28,18 +28,34 @@
#include "richtexteditor/richtexteditor.h"
+#include "QStringListModel"
+
namespace QmlDesigner {
-AnnotationCommentTab::AnnotationCommentTab(QWidget *parent) :
- QWidget(parent),
- ui(new Ui::AnnotationCommentTab)
+AnnotationCommentTab::AnnotationCommentTab(QWidget *parent)
+ : QWidget(parent)
+ , ui(new Ui::AnnotationCommentTab)
{
ui->setupUi(this);
m_editor = new RichTextEditor;
ui->formLayout->setWidget(3, QFormLayout::FieldRole, m_editor);
- connect(ui->titleEdit, &QLineEdit::textEdited,
+ ui->titleEdit->setModel(new QStringListModel{QStringList{"Description",
+ "Display Condition",
+ "helper_lines"
+ "highlight"
+ "project author",
+ "project confirmed",
+ "project developer",
+ "project distributor",
+ "project modified",
+ "project type"
+ "project version",
+ "Screen Description"
+ "Section"}});
+
+ connect(ui->titleEdit, &QComboBox::currentTextChanged,
this, &AnnotationCommentTab::commentTitleChanged);
}
@@ -52,7 +68,7 @@ Comment AnnotationCommentTab::currentComment() const
{
Comment result;
- result.setTitle(ui->titleEdit->text().trimmed());
+ result.setTitle(ui->titleEdit->currentText().trimmed());
result.setAuthor(ui->authorEdit->text().trimmed());
result.setText(m_editor->richText().trimmed());
@@ -77,7 +93,7 @@ void AnnotationCommentTab::setComment(const Comment &comment)
void AnnotationCommentTab::resetUI()
{
- ui->titleEdit->setText(m_comment.title());
+ ui->titleEdit->setCurrentText(m_comment.title());
ui->authorEdit->setText(m_comment.author());
m_editor->setRichText(m_comment.deescapedText());
diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.ui b/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.ui
index 4a69703d57..b3a9a85e6c 100644
--- a/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.ui
+++ b/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.ui
@@ -24,7 +24,11 @@
</widget>
</item>
<item row="1" column="1">
- <widget class="QLineEdit" name="titleEdit"/>
+ <widget class="QComboBox" name="titleEdit">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="textLabel">
diff --git a/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewplugin.cpp b/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewplugin.cpp
index ac0f30118d..e0d55eb21a 100644
--- a/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewplugin.cpp
+++ b/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewplugin.cpp
@@ -84,7 +84,9 @@ QmlPreviewPlugin::QmlPreviewPlugin()
if (s_previewPlugin) {
auto fpsAction = new FpsAction;
designerActionManager.addDesignerAction(fpsAction);
- s_previewPlugin->setProperty("fpsHandler", QVariant::fromValue<QmlPreview::QmlPreviewFpsHandler>(FpsLabelAction::fpsHandler));
+ bool hasFpsHandler =
+ s_previewPlugin->setProperty("fpsHandler", QVariant::fromValue<QmlPreview::QmlPreviewFpsHandler>(FpsLabelAction::fpsHandler));
+ QTC_CHECK(hasFpsHandler);
auto switchLanguageAction = new SwitchLanguageAction;
designerActionManager.addDesignerAction(switchLanguageAction);
}
@@ -132,7 +134,9 @@ void QmlPreviewPlugin::setQmlFile()
if (s_previewPlugin) {
const Utils::FilePath qmlFileName =
QmlDesignerPlugin::instance()->currentDesignDocument()->fileName();
- s_previewPlugin->setProperty("previewedFile", qmlFileName.toString());
+ bool hasPreviewedFile =
+ s_previewPlugin->setProperty("previewedFile", qmlFileName.toString());
+ QTC_CHECK(hasPreviewedFile);
}
}
@@ -146,14 +150,18 @@ float QmlPreviewPlugin::zoomFactor()
void QmlPreviewPlugin::setZoomFactor(float zoomFactor)
{
- if (s_previewPlugin)
- s_previewPlugin->setProperty("zoomFactor", zoomFactor);
+ if (s_previewPlugin) {
+ bool hasZoomFactor = s_previewPlugin->setProperty("zoomFactor", zoomFactor);
+ QTC_CHECK(hasZoomFactor);
+ }
}
void QmlPreviewPlugin::setLanguageLocale(const QString &locale)
{
- if (auto s_previewPlugin = getPreviewPlugin())
- s_previewPlugin->setProperty("locale", locale);
+ if (auto s_previewPlugin = getPreviewPlugin()) {
+ bool hasLocaleIsoCode = s_previewPlugin->setProperty("localeIsoCode", locale);
+ QTC_CHECK(hasLocaleIsoCode);
+ }
}
QObject *QmlPreviewPlugin::getPreviewPlugin()
diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp
index 3abb0f4659..997850f152 100644
--- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp
+++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp
@@ -95,7 +95,7 @@ void QmlMultiLanguageAspect::setCurrentLocale(const QString &locale)
return;
m_currentLocale = locale;
if (auto previewPlugin = getPreviewPlugin())
- previewPlugin->setProperty("locale", locale);
+ previewPlugin->setProperty("localeIsoCode", locale);
}
QString QmlMultiLanguageAspect::currentLocale() const