Merge remote-tracking branch 'origin/9.0' into qds/dev

Conflicts:
  src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: Idc7be1f8871df51f7372ea66f81178cfe3e68846
This commit is contained in:
Tim Jenssen
2023-01-12 16:42:15 +01:00
11 changed files with 228 additions and 186 deletions

View File

@@ -1106,7 +1106,8 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
}
}
m_state.pushTokenBuffer(body.constBegin(), body.constEnd(), macro);
const PPToken *start = body.constData();
m_state.pushTokenBuffer(start, start + body.size(), macro);
if (m_client && !idTk.generated())
m_client->stopExpandingMacro(idTk.byteOffset, *macro);

View File

@@ -440,6 +440,7 @@ void prepareNonNativeDialog(QFileDialog &dialog)
dialog.setSidebarUrls(Utils::transform(sideBarPaths, filePathToQUrl));
dialog.setIconProvider(Utils::FileIconProvider::iconProvider());
dialog.setFilter(QDir::Hidden | dialog.filter());
}
}

View File

@@ -6,6 +6,7 @@
#include "commandline.h"
#include "environment.h"
#include "fileutils.h"
#include "guard.h"
#include "hostosinfo.h"
#include "macroexpander.h"
#include "qtcassert.h"
@@ -174,6 +175,7 @@ public:
const MacroExpander *m_macroExpander = globalMacroExpander();
std::function<void()> m_openTerminal;
bool m_allowPathFromDevice = false;
Guard m_callGuard;
};
PathChooserPrivate::PathChooserPrivate()
@@ -350,11 +352,15 @@ QString PathChooser::expandedDirectory(const QString &input, const Environment &
void PathChooser::setPath(const QString &path)
{
QTC_ASSERT(!d->m_callGuard.isLocked(), return);
GuardLocker locker(d->m_callGuard);
d->m_lineEdit->setTextKeepingActiveCursor(QDir::toNativeSeparators(path));
}
void PathChooser::setFilePath(const FilePath &fn)
{
QTC_ASSERT(!d->m_callGuard.isLocked(), return);
GuardLocker locker(d->m_callGuard);
d->m_lineEdit->setTextKeepingActiveCursor(fn.toUserOutput());
}

View File

@@ -366,6 +366,10 @@ void doSemanticHighlighting(
const QList<BlockRange> ifdefedOutBlocks = cleanupDisabledCode(results, &doc, docContents);
ExtraHighlightingResultsCollector(future, results, filePath, ast, &doc, docContents,
clangdVersion).collect();
Utils::erase(results, [](const HighlightingResult &res) {
// QTCREATORBUG-28639
return res.textStyles.mainStyle == C_TEXT && res.textStyles.mixinStyles.empty();
});
if (!future.isCanceled()) {
qCInfo(clangdLogHighlight) << "reporting" << results.size() << "highlighting results";
QMetaObject::invokeMethod(textDocument, [textDocument, ifdefedOutBlocks, docRevision] {

View File

@@ -391,8 +391,10 @@ int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const
ret = 0;
break;
case QStyle::SH_ComboBox_AllowWheelScrolling:
// Turn this off completely to prevent accidental current index change on a scroll view
ret = false;
// Turn this on only when simultaneously pressing Ctrl, to prevent accidental current
// index change, e.g. on a scroll view
ret = QGuiApplication::keyboardModifiers()
== (HostOsInfo::isMacHost() ? Qt::MetaModifier : Qt::ControlModifier);
break;
default:
break;

View File

@@ -260,7 +260,7 @@ AppOutputPane::RunControlTab *AppOutputPane::tabFor(const RunControl *rc)
[rc](RunControlTab &t) { return t.runControl == rc; });
if (it == m_runControlTabs.end())
return nullptr;
return it;
return &*it;
}
AppOutputPane::RunControlTab *AppOutputPane::tabFor(const QWidget *outputWindow)
@@ -269,7 +269,7 @@ AppOutputPane::RunControlTab *AppOutputPane::tabFor(const QWidget *outputWindow)
[outputWindow](RunControlTab &t) { return t.window == outputWindow; });
if (it == m_runControlTabs.end())
return nullptr;
return it;
return &*it;
}
const AppOutputPane::RunControlTab *AppOutputPane::tabFor(const QWidget *outputWindow) const

View File

@@ -9,6 +9,7 @@ namespace QmlProjectManager {
namespace Constants {
const char QML_PROJECT_ID[] = "QmlProjectManager.QmlProject";
const char QML_VIEWER_KEY[] = "QmlProjectManager.QmlRunConfiguration.QDeclarativeViewer";
const char QML_VIEWER_ARGUMENTS_KEY[] = "QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments";
const char QML_VIEWER_TARGET_DISPLAY_NAME[] = "QML Viewer";
const char QML_MAINSCRIPT_KEY[] = "QmlProjectManager.QmlRunConfiguration.MainScript";

View File

@@ -73,9 +73,10 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
{
m_qmlViewerAspect = addAspect<StringAspect>();
m_qmlViewerAspect->setLabelText(tr("QML Viewer:"));
m_qmlViewerAspect->setPlaceHolderText(commandLine().executable().toString());
m_qmlViewerAspect->setPlaceHolderText(qmlRuntimeFilePath().toUserOutput());
m_qmlViewerAspect->setDisplayStyle(StringAspect::PathChooserDisplay);
m_qmlViewerAspect->setHistoryCompleter("QmlProjectManager.viewer.history");
m_qmlViewerAspect->setSettingsKey(Constants::QML_VIEWER_KEY);
auto argumentAspect = addAspect<ArgumentsAspect>(macroExpander());
argumentAspect->setSettingsKey(Constants::QML_VIEWER_ARGUMENTS_KEY);