forked from qt-creator/qt-creator
QmlDesigner: Fix various compiler warnings
-Wdangling-else -Wdeprecated-declaration -Wunused-function -Wunused-parameter Change-Id: Id655b6c9c043e2049e921b05619f596b3641bdbd Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -178,6 +178,8 @@ namespace ADS
|
|||||||
|
|
||||||
void DockFocusController::onApplicationFocusChanged(QWidget *focusedOld, QWidget *focusedNow)
|
void DockFocusController::onApplicationFocusChanged(QWidget *focusedOld, QWidget *focusedNow)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(focusedOld);
|
||||||
|
|
||||||
if (d->m_dockManager->isRestoringState())
|
if (d->m_dockManager->isRestoringState())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
namespace {
|
namespace {
|
||||||
Q_LOGGING_CATEGORY(loggerInfo, "qtc.designer.assetExportPlugin.view", QtInfoMsg)
|
Q_LOGGING_CATEGORY(loggerInfo, "qtc.designer.assetExportPlugin.view", QtInfoMsg)
|
||||||
Q_LOGGING_CATEGORY(loggerWarn, "qtc.designer.assetExportPlugin.view", QtWarningMsg)
|
Q_LOGGING_CATEGORY(loggerWarn, "qtc.designer.assetExportPlugin.view", QtWarningMsg)
|
||||||
Q_LOGGING_CATEGORY(loggerError, "qtc.designer.assetExportPlugin.view", QtCriticalMsg)
|
//Q_LOGGING_CATEGORY(loggerError, "qtc.designer.assetExportPlugin.view", QtCriticalMsg)
|
||||||
|
|
||||||
static const int RetryIntervalMs = 500;
|
static const int RetryIntervalMs = 500;
|
||||||
static const int MinRetry = 2;
|
static const int MinRetry = 2;
|
||||||
|
@@ -37,10 +37,11 @@ static QString styleConfigFileName(const QString &qmlFileName)
|
|||||||
{
|
{
|
||||||
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(Utils::FilePath::fromString(qmlFileName));
|
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(Utils::FilePath::fromString(qmlFileName));
|
||||||
|
|
||||||
if (currentProject)
|
if (currentProject) {
|
||||||
foreach (const Utils::FilePath &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles))
|
foreach (const Utils::FilePath &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles))
|
||||||
if (fileName.endsWith("qtquickcontrols2.conf"))
|
if (fileName.endsWith("qtquickcontrols2.conf"))
|
||||||
return fileName.toString();
|
return fileName.toString();
|
||||||
|
}
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
@@ -104,7 +104,7 @@ void BackendModel::resetModel()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rootNode.isValid())
|
if (rootNode.isValid()) {
|
||||||
foreach (const AbstractProperty &property ,rootNode.properties())
|
foreach (const AbstractProperty &property ,rootNode.properties())
|
||||||
if (property.isDynamic() && !simpleTypes.contains(property.dynamicTypeName())) {
|
if (property.isDynamic() && !simpleTypes.contains(property.dynamicTypeName())) {
|
||||||
|
|
||||||
@@ -133,6 +133,7 @@ void BackendModel::resetModel()
|
|||||||
appendRow({ type, name, singletonItem, inlineItem });
|
appendRow({ type, name, singletonItem, inlineItem });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_lock = false;
|
m_lock = false;
|
||||||
|
|
||||||
@@ -145,9 +146,10 @@ QStringList BackendModel::possibleCppTypes() const
|
|||||||
|
|
||||||
QStringList list;
|
QStringList list;
|
||||||
|
|
||||||
if (rewriterView)
|
if (rewriterView) {
|
||||||
foreach (const QmlTypeData &cppTypeData, rewriterView->getQMLTypes())
|
foreach (const QmlTypeData &cppTypeData, rewriterView->getQMLTypes())
|
||||||
list.append(cppTypeData.typeName);
|
list.append(cppTypeData.typeName);
|
||||||
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@@ -60,7 +60,7 @@ public:
|
|||||||
|
|
||||||
QVariant data(int role) const override
|
QVariant data(int role) const override
|
||||||
{
|
{
|
||||||
if (role == Qt::BackgroundColorRole && hasInvalidValue)
|
if (role == Qt::BackgroundRole && hasInvalidValue)
|
||||||
return QColor{Qt::darkYellow};
|
return QColor{Qt::darkYellow};
|
||||||
|
|
||||||
return QStandardItem::data(role);
|
return QStandardItem::data(role);
|
||||||
|
@@ -267,7 +267,7 @@ QString Annotation::toQString() const
|
|||||||
|
|
||||||
void Annotation::fromQString(const QString &str)
|
void Annotation::fromQString(const QString &str)
|
||||||
{
|
{
|
||||||
QStringList strl (str.split(s_sep, QString::SplitBehavior::KeepEmptyParts));
|
QStringList strl (str.split(s_sep, Qt::KeepEmptyParts));
|
||||||
removeComments();
|
removeComments();
|
||||||
|
|
||||||
const int intro = 1;
|
const int intro = 1;
|
||||||
|
@@ -256,11 +256,12 @@ void RewriterView::importAdded(const Import &import)
|
|||||||
if (textToModelMerger()->isActive())
|
if (textToModelMerger()->isActive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (import.url() == QLatin1String("Qt"))
|
if (import.url() == QLatin1String("Qt")) {
|
||||||
foreach (const Import &import, model()->imports()) {
|
foreach (const Import &import, model()->imports()) {
|
||||||
if (import.url() == QLatin1String("QtQuick"))
|
if (import.url() == QLatin1String("QtQuick"))
|
||||||
return; //QtQuick magic we do not have to add an import for Qt
|
return; //QtQuick magic we do not have to add an import for Qt
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
modelToTextMerger()->addImport(import);
|
modelToTextMerger()->addImport(import);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user