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)
|
||||
{
|
||||
Q_UNUSED(focusedOld);
|
||||
|
||||
if (d->m_dockManager->isRestoringState())
|
||||
return;
|
||||
|
||||
|
@@ -37,7 +37,7 @@
|
||||
namespace {
|
||||
Q_LOGGING_CATEGORY(loggerInfo, "qtc.designer.assetExportPlugin.view", QtInfoMsg)
|
||||
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 MinRetry = 2;
|
||||
|
@@ -37,10 +37,11 @@ static QString styleConfigFileName(const QString &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))
|
||||
if (fileName.endsWith("qtquickcontrols2.conf"))
|
||||
return fileName.toString();
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
@@ -104,7 +104,7 @@ void BackendModel::resetModel()
|
||||
}
|
||||
}
|
||||
|
||||
if (rootNode.isValid())
|
||||
if (rootNode.isValid()) {
|
||||
foreach (const AbstractProperty &property ,rootNode.properties())
|
||||
if (property.isDynamic() && !simpleTypes.contains(property.dynamicTypeName())) {
|
||||
|
||||
@@ -133,6 +133,7 @@ void BackendModel::resetModel()
|
||||
appendRow({ type, name, singletonItem, inlineItem });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_lock = false;
|
||||
|
||||
@@ -145,9 +146,10 @@ QStringList BackendModel::possibleCppTypes() const
|
||||
|
||||
QStringList list;
|
||||
|
||||
if (rewriterView)
|
||||
if (rewriterView) {
|
||||
foreach (const QmlTypeData &cppTypeData, rewriterView->getQMLTypes())
|
||||
list.append(cppTypeData.typeName);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
|
||||
QVariant data(int role) const override
|
||||
{
|
||||
if (role == Qt::BackgroundColorRole && hasInvalidValue)
|
||||
if (role == Qt::BackgroundRole && hasInvalidValue)
|
||||
return QColor{Qt::darkYellow};
|
||||
|
||||
return QStandardItem::data(role);
|
||||
|
@@ -267,7 +267,7 @@ QString Annotation::toQString() const
|
||||
|
||||
void Annotation::fromQString(const QString &str)
|
||||
{
|
||||
QStringList strl (str.split(s_sep, QString::SplitBehavior::KeepEmptyParts));
|
||||
QStringList strl (str.split(s_sep, Qt::KeepEmptyParts));
|
||||
removeComments();
|
||||
|
||||
const int intro = 1;
|
||||
|
@@ -256,11 +256,12 @@ void RewriterView::importAdded(const Import &import)
|
||||
if (textToModelMerger()->isActive())
|
||||
return;
|
||||
|
||||
if (import.url() == QLatin1String("Qt"))
|
||||
if (import.url() == QLatin1String("Qt")) {
|
||||
foreach (const Import &import, model()->imports()) {
|
||||
if (import.url() == QLatin1String("QtQuick"))
|
||||
return; //QtQuick magic we do not have to add an import for Qt
|
||||
}
|
||||
}
|
||||
|
||||
modelToTextMerger()->addImport(import);
|
||||
|
||||
|
Reference in New Issue
Block a user