forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/15.0'
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs src/plugins/languageclient/languageclientmanager.cpp src/plugins/languageclient/languageclientmanager.h Change-Id: I5d705abb1dd6b67e7c51c4f9151bf4fe3213004f
This commit is contained in:
@@ -87,56 +87,54 @@ jobs:
|
||||
string(REPLACE "." "" qt_version_dotless "${qt_version}")
|
||||
if ("${{ runner.os }}" STREQUAL "Windows")
|
||||
set(url_os "windows_x86")
|
||||
set(qt_package_arch_suffix "win64_msvc2019_64")
|
||||
set(qt_dir_prefix "${qt_version}/msvc2019_64")
|
||||
set(qt_package_suffix "-Windows-Windows_10_22H2-MSVC2019-Windows-Windows_10_22H2-X86_64")
|
||||
set(qt_package_arch_suffix "win64_msvc2022_64")
|
||||
set(qt_dir_prefix "${qt_version}/msvc_64")
|
||||
set(qt_package_suffix "-Windows-Windows_11_23H2-MSVC2022-Windows-Windows_11_23H2-X86_64")
|
||||
elseif ("${{ runner.os }}" STREQUAL "Linux")
|
||||
set(url_os "linux_x64")
|
||||
if (qt_version VERSION_LESS "6.7.0")
|
||||
set(qt_package_arch_suffix "gcc_64")
|
||||
else()
|
||||
set(qt_package_arch_suffix "linux_gcc_64")
|
||||
endif()
|
||||
set(qt_package_arch_suffix "linux_gcc_64")
|
||||
set(qt_dir_prefix "${qt_version}/gcc_64")
|
||||
set(qt_package_suffix "-Linux-RHEL_8_8-GCC-Linux-RHEL_8_8-X86_64")
|
||||
set(qt_package_suffix "-Linux-RHEL_8_10-GCC-Linux-RHEL_8_10-X86_64")
|
||||
elseif ("${{ runner.os }}" STREQUAL "macOS")
|
||||
set(url_os "mac_x64")
|
||||
set(qt_package_arch_suffix "clang_64")
|
||||
set(qt_dir_prefix "${qt_version}/macos")
|
||||
set(qt_package_suffix "-MacOS-MacOS_13-Clang-MacOS-MacOS_13-X86_64-ARM64")
|
||||
set(qt_package_suffix "-MacOS-MacOS_14-Clang-MacOS-MacOS_14-X86_64-ARM64")
|
||||
endif()
|
||||
|
||||
set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt6_${qt_version_dotless}")
|
||||
set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt6_${qt_version_dotless}/qt6_${qt_version_dotless}")
|
||||
file(DOWNLOAD "${qt_base_url}/Updates.xml" ./Updates.xml SHOW_PROGRESS)
|
||||
|
||||
file(READ ./Updates.xml updates_xml)
|
||||
string(REGEX MATCH "<Name>qt.qt6.*<Version>([0-9+-.]+)</Version>" updates_xml_output "${updates_xml}")
|
||||
set(qt_package_version ${CMAKE_MATCH_1})
|
||||
|
||||
file(MAKE_DIRECTORY qt6)
|
||||
|
||||
# Save the path for other steps
|
||||
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt6/${qt_dir_prefix}" qt_dir)
|
||||
file(APPEND "$ENV{GITHUB_OUTPUT}" "qt_dir=${qt_dir}")
|
||||
|
||||
message("Downloading Qt to ${qt_dir}")
|
||||
function(downloadAndExtract url archive)
|
||||
function(downloadAndExtract url archive subdir)
|
||||
file(MAKE_DIRECTORY "${qt_dir}/${subdir}")
|
||||
message("Downloading ${url}")
|
||||
file(DOWNLOAD "${url}" ./${archive} SHOW_PROGRESS)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${archive} WORKING_DIRECTORY qt6)
|
||||
message("... extracting to ${qt_dir}/${subdir}")
|
||||
file(DOWNLOAD "${url}" "$ENV{GITHUB_WORKSPACE}/${archive}" SHOW_PROGRESS)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "$ENV{GITHUB_WORKSPACE}/${archive}" WORKING_DIRECTORY "${qt_dir}/${subdir}")
|
||||
endfunction()
|
||||
|
||||
foreach(package qtbase qtdeclarative)
|
||||
downloadAndExtract(
|
||||
"${qt_base_url}/qt.qt6.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z"
|
||||
${package}.7z
|
||||
""
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(package qt5compat qtshadertools)
|
||||
downloadAndExtract(
|
||||
"${qt_base_url}/qt.qt6.${qt_version_dotless}.${package}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z"
|
||||
"${qt_base_url}/qt.qt6.${qt_version_dotless}.addons.${package}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z"
|
||||
${package}.7z
|
||||
""
|
||||
)
|
||||
endforeach()
|
||||
|
||||
@@ -150,9 +148,11 @@ jobs:
|
||||
downloadAndExtract(
|
||||
"${qt_base_url}/qt.qt6.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}icu-linux-${uic_suffix}.7z"
|
||||
icu.7z
|
||||
"lib"
|
||||
)
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${qt_dir}/bin/qmake -query)
|
||||
- name: Download Qt Creator
|
||||
uses: qt-creator/install-dev-package@v1.2
|
||||
with:
|
||||
|
@@ -920,7 +920,10 @@ expected_str<FilePath> Client::getCmdBridgePath(
|
||||
const QString type = typeToString.value(osType);
|
||||
const QString arch = archToString.value(osArch);
|
||||
|
||||
const QString cmdBridgeName = QStringLiteral("cmdbridge-%1-%2").arg(type, arch);
|
||||
QString cmdBridgeName = QStringLiteral("cmdbridge-%1-%2").arg(type, arch);
|
||||
|
||||
if (osType == OsType::OsTypeWindows)
|
||||
cmdBridgeName += QStringLiteral(".exe");
|
||||
|
||||
const FilePath result = libExecPath.resolvePath(cmdBridgeName);
|
||||
if (result.exists())
|
||||
|
@@ -8,6 +8,10 @@ function(go_build NAME SOURCES PLATFORMS ARCHITECTURES LDFLAGS)
|
||||
set(TARGET_NAME ${NAME}-${PLATFORM}-${ARCHITECTURE})
|
||||
set(OUTPUT ${OUTPUT_FOLDER}/${TARGET_NAME})
|
||||
|
||||
if (${PLATFORM} STREQUAL "windows")
|
||||
string(APPEND OUTPUT ".exe")
|
||||
endif()
|
||||
|
||||
if ((${PLATFORM} STREQUAL "linux" OR (${PLATFORM} STREQUAL "windows" AND ${ARCHITECTURE} STREQUAL "amd64")) AND NOT UPX_BIN STREQUAL "UPX_BIN-NOTFOUND")
|
||||
add_custom_command(
|
||||
OUTPUT "${OUTPUT}"
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <QPushButton>
|
||||
#include <QScrollArea>
|
||||
#include <QSize>
|
||||
#include <QSizePolicy>
|
||||
#include <QSpacerItem>
|
||||
#include <QSpinBox>
|
||||
#include <QSplitter>
|
||||
@@ -808,6 +809,11 @@ void Widget::setCursor(Qt::CursorShape shape)
|
||||
access(this)->setCursor(shape);
|
||||
}
|
||||
|
||||
void Widget::setSizePolicy(const QSizePolicy &policy)
|
||||
{
|
||||
access(this)->setSizePolicy(policy);
|
||||
}
|
||||
|
||||
void Widget::activateWindow()
|
||||
{
|
||||
access(this)->activateWindow();
|
||||
|
@@ -31,6 +31,7 @@ class QObject;
|
||||
class QPushButton;
|
||||
class QScrollArea;
|
||||
class QSize;
|
||||
class QSizePolicy;
|
||||
class QSpinBox;
|
||||
class QSplitter;
|
||||
class QStackedWidget;
|
||||
@@ -253,6 +254,7 @@ public:
|
||||
void setAutoFillBackground(bool);
|
||||
void setLayout(const Layout &layout);
|
||||
void setSize(int, int);
|
||||
void setSizePolicy(const QSizePolicy &policy);
|
||||
void setFixedSize(const QSize &);
|
||||
void setWindowTitle(const QString &);
|
||||
void setWindowFlags(Qt::WindowFlags);
|
||||
@@ -541,6 +543,7 @@ QTC_DEFINE_BUILDER_SETTER(widgetAttribute, setWidgetAttribute);
|
||||
QTC_DEFINE_BUILDER_SETTER(autoFillBackground, setAutoFillBackground);
|
||||
QTC_DEFINE_BUILDER_SETTER(readOnly, setReadOnly);
|
||||
QTC_DEFINE_BUILDER_SETTER(markdown, setMarkdown);
|
||||
QTC_DEFINE_BUILDER_SETTER(sizePolicy, setSizePolicy);
|
||||
QTC_DEFINE_BUILDER_SETTER(basePath, setBasePath);
|
||||
QTC_DEFINE_BUILDER_SETTER(fixedSize, setFixedSize);
|
||||
|
||||
|
@@ -445,6 +445,9 @@ void MarkdownBrowser::setMarkdown(const QString &markdown)
|
||||
{
|
||||
document()->setMarkdown(markdown);
|
||||
postProcessDocument(true);
|
||||
// Reset cursor to start of the document, so that "show" does not
|
||||
// scroll to the end of the document.
|
||||
setTextCursor(QTextCursor(document()));
|
||||
}
|
||||
|
||||
void MarkdownBrowser::postProcessDocument(bool firstTime) const
|
||||
|
@@ -769,11 +769,17 @@ IssueListSearch IssuesWidget::searchFromUi() const
|
||||
{
|
||||
IssueListSearch search;
|
||||
QTC_ASSERT(m_currentTableInfo, return search);
|
||||
const int userIndex = m_ownerFilter->currentIndex();
|
||||
QTC_ASSERT(userIndex >= 0 && m_userNames.size() > userIndex, return search);
|
||||
const int versionStartIndex = m_versionStart->currentIndex();
|
||||
QTC_ASSERT(versionStartIndex >= 0 && m_versionDates.size() > versionStartIndex, return search);
|
||||
const int versionEndIndex = m_versionEnd->currentIndex();
|
||||
QTC_ASSERT(versionEndIndex >= 0 && m_versionDates.size() > versionEndIndex, return search);
|
||||
search.kind = m_currentPrefix; // not really ui.. but anyhow
|
||||
search.owner = m_userNames.at(m_ownerFilter->currentIndex());
|
||||
search.owner = m_userNames.at(userIndex);
|
||||
search.filter_path = m_pathGlobFilter->text();
|
||||
search.versionStart = m_versionDates.at(m_versionStart->currentIndex());
|
||||
search.versionEnd = m_versionDates.at(m_versionEnd->currentIndex());
|
||||
search.versionStart = m_versionDates.at(versionStartIndex);
|
||||
search.versionEnd = m_versionDates.at(versionEndIndex);
|
||||
// different approach: checked means disabling in webview, checked here means explicitly request
|
||||
// the checked one, having both checked is impossible (having none checked means fetch both)
|
||||
// reason for different approach: currently poor reflected inside the ui (TODO)
|
||||
|
@@ -362,7 +362,9 @@ static QUrl constructUrl(const QString &projectName, const QString &subPath, con
|
||||
{
|
||||
if (!dd->m_dashboardInfo)
|
||||
return {};
|
||||
QUrl url = dd->m_dashboardInfo->source.resolved(QString("api/projects/" + projectName + '/'));
|
||||
const QByteArray encodedProjectName = QUrl::toPercentEncoding(projectName);
|
||||
const QUrl path(QString{"api/projects/" + QString::fromUtf8(encodedProjectName) + '/'});
|
||||
QUrl url = dd->m_dashboardInfo->source.resolved(path);
|
||||
if (!subPath.isEmpty() && QTC_GUARD(!subPath.startsWith('/')))
|
||||
url = url.resolved(subPath);
|
||||
if (!query.isEmpty())
|
||||
|
@@ -225,6 +225,7 @@ AxivionSettings &settings()
|
||||
AxivionSettings::AxivionSettings()
|
||||
{
|
||||
setSettingsGroup("Axivion");
|
||||
setAutoApply(false);
|
||||
|
||||
highlightMarks.setSettingsKey("HighlightMarks");
|
||||
highlightMarks.setLabelText(Tr::tr("Highlight marks"));
|
||||
@@ -490,6 +491,7 @@ void AxivionSettingsWidget::apply()
|
||||
: servers.at(m_dashboardServers->currentIndex()).id;
|
||||
if (settings().updateDashboardServers(servers, selected))
|
||||
settings().toSettings();
|
||||
settings().apply();
|
||||
}
|
||||
|
||||
void AxivionSettingsWidget::updateDashboardServers()
|
||||
|
@@ -930,8 +930,14 @@ clang::format::FormatStyle ClangFormatBaseIndenterPrivate::customSettingsStyle(
|
||||
return currentQtStyle(preferences);
|
||||
|
||||
clang::format::FormatStyle currentSettingsStyle;
|
||||
const Utils::expected_str<void> success = parseConfigurationFile(filePath, currentSettingsStyle);
|
||||
QTC_ASSERT(success, return currentQtStyle(preferences));
|
||||
const Utils::expected_str<void> result = parseConfigurationFile(filePath, currentSettingsStyle);
|
||||
if (!result) {
|
||||
qCWarning(clangIndenterLog)
|
||||
<< QString{"Failed to parse config %1. Falling back to the Qt style."}.arg(
|
||||
filePath.toUserOutput())
|
||||
<< result.error();
|
||||
return currentQtStyle(preferences);
|
||||
};
|
||||
|
||||
return currentSettingsStyle;
|
||||
}
|
||||
|
@@ -201,7 +201,7 @@ void ClangFormatConfigWidget::initEditor()
|
||||
this);
|
||||
|
||||
connect(m_editor->document(), &TextEditor::TextDocument::contentsChanged, this, [this] {
|
||||
clang::format::FormatStyle currentSettingsStyle;
|
||||
clang::format::FormatStyle currentSettingsStyle{};
|
||||
const Utils::expected_str<void> success
|
||||
= parseConfigurationContent(m_editor->document()->contents().toStdString(),
|
||||
currentSettingsStyle);
|
||||
|
@@ -378,8 +378,8 @@ void EditorToolBar::setGoForwardMenu(QMenu *menu)
|
||||
void EditorToolBar::updateActionShortcuts()
|
||||
{
|
||||
d->m_closeEditorButton->setToolTip(ActionManager::command(Constants::CLOSE)->stringWithAppendedShortcut(Tr::tr("Close Document")));
|
||||
d->m_goBackAction->setToolTip(ActionManager::command(Constants::GO_BACK)->action()->toolTip());
|
||||
d->m_goForwardAction->setToolTip(ActionManager::command(Constants::GO_FORWARD)->action()->toolTip());
|
||||
d->m_goBackAction->setToolTip(ActionManager::command(Constants::GO_BACK)->stringWithAppendedShortcut(Tr::tr("Go Back")));
|
||||
d->m_goForwardAction->setToolTip(ActionManager::command(Constants::GO_FORWARD)->stringWithAppendedShortcut(Tr::tr("Go Forward")));
|
||||
d->m_closeSplitButton->setToolTip(ActionManager::command(Constants::REMOVE_CURRENT_SPLIT)->stringWithAppendedShortcut(Tr::tr("Remove Split")));
|
||||
}
|
||||
|
||||
|
@@ -347,11 +347,16 @@ public:
|
||||
{}
|
||||
|
||||
// IAssistProposal interface
|
||||
bool hasItemsToPropose(const QString &/*text*/, AssistReason reason) const override
|
||||
bool hasItemsToPropose(const QString &prefix, AssistReason reason) const override
|
||||
{
|
||||
if (m_model->size() <= 0 || m_document.isNull())
|
||||
return false;
|
||||
|
||||
if (!prefix.isEmpty()) {
|
||||
m_model->filter(prefix);
|
||||
m_model->setPrefilterPrefix(prefix);
|
||||
}
|
||||
|
||||
return m_model->keepPerfectMatch(reason)
|
||||
|| !Utils::anyOf(m_model->items(), [this](AssistProposalItemInterface *item){
|
||||
if (const auto lcItem = dynamic_cast<LanguageClientCompletionItem *>(item))
|
||||
|
@@ -285,6 +285,11 @@ QList<Client *> LanguageClientManager::clientsSupportingDocument(
|
||||
[doc](Client *client) { return client->isSupportedDocument(doc); });
|
||||
}
|
||||
|
||||
void LanguageClientManager::writeSettings()
|
||||
{
|
||||
LanguageClientSettings::toSettings(Core::ICore::settings(), managerInstance->m_currentSettings);
|
||||
}
|
||||
|
||||
void LanguageClientManager::applySettings()
|
||||
{
|
||||
QTC_ASSERT(managerInstance, return);
|
||||
@@ -292,7 +297,7 @@ void LanguageClientManager::applySettings()
|
||||
managerInstance->m_currentSettings
|
||||
= Utils::transform(LanguageClientSettings::pageSettings(), &BaseSettings::copy);
|
||||
const QList<BaseSettings *> restarts = LanguageClientSettings::changedSettings();
|
||||
LanguageClientSettings::toSettings(Core::ICore::settings(), managerInstance->m_currentSettings);
|
||||
writeSettings();
|
||||
|
||||
for (BaseSettings *settings : restarts)
|
||||
applySettings(settings);
|
||||
@@ -318,41 +323,31 @@ void LanguageClientManager::applySettings(BaseSettings *setting)
|
||||
managerInstance->m_clientForDocument.remove(document);
|
||||
if (!setting->isValid())
|
||||
return;
|
||||
switch (setting->m_startBehavior) {
|
||||
case BaseSettings::AlwaysOn: {
|
||||
if (setting->m_startBehavior == BaseSettings::AlwaysOn || BaseSettings::RequiresFile) {
|
||||
if (!setting->m_enabled)
|
||||
return;
|
||||
Client *client = startClient(setting);
|
||||
for (TextEditor::TextDocument *document : std::as_const(documents))
|
||||
managerInstance->m_clientForDocument[document] = client;
|
||||
break;
|
||||
}
|
||||
case BaseSettings::RequiresFile: {
|
||||
if (!setting->m_enabled)
|
||||
return;
|
||||
Client *client = nullptr;
|
||||
auto ensureClient = [setting, client = static_cast<Client *>(nullptr)]() mutable {
|
||||
if (!client)
|
||||
client = startClient(setting);
|
||||
return client;
|
||||
};
|
||||
if (setting->m_startBehavior == BaseSettings::AlwaysOn)
|
||||
ensureClient();
|
||||
|
||||
for (TextEditor::TextDocument *previousDocument : std::as_const(documents)) {
|
||||
if (setting->m_languageFilter.isSupported(previousDocument)) {
|
||||
if (!client)
|
||||
client = startClient(setting);
|
||||
openDocumentWithClient(previousDocument, client);
|
||||
}
|
||||
if (setting->m_languageFilter.isSupported(previousDocument))
|
||||
openDocumentWithClient(previousDocument, ensureClient());
|
||||
}
|
||||
const QList<Core::IDocument *> &openedDocuments = Core::DocumentModel::openedDocuments();
|
||||
for (Core::IDocument *document : openedDocuments) {
|
||||
if (documents.contains(document))
|
||||
continue; // already handled above
|
||||
if (auto textDocument = qobject_cast<TextEditor::TextDocument *>(document)) {
|
||||
if (setting->m_languageFilter.isSupported(document)) {
|
||||
if (!client)
|
||||
client = startClient(setting);
|
||||
client->openDocument(textDocument);
|
||||
}
|
||||
if (setting->m_languageFilter.isSupported(document))
|
||||
ensureClient()->openDocument(textDocument);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BaseSettings::RequiresProject: {
|
||||
} else if (setting->m_startBehavior == BaseSettings::RequiresProject) {
|
||||
const QList<Core::IDocument *> &openedDocuments = Core::DocumentModel::openedDocuments();
|
||||
QHash<ProjectExplorer::Project *, Client *> clientForProject;
|
||||
for (Core::IDocument *document : openedDocuments) {
|
||||
@@ -380,10 +375,6 @@ void LanguageClientManager::applySettings(BaseSettings *setting)
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -54,6 +54,7 @@ public:
|
||||
static void applySettings();
|
||||
static void applySettings(const QString &settingsId);
|
||||
static void applySettings(BaseSettings *settings);
|
||||
static void writeSettings();
|
||||
static QList<BaseSettings *> currentSettings();
|
||||
static void registerClientSettings(BaseSettings *settings);
|
||||
static void enableClientSettings(const QString &settingsId, bool enable = true);
|
||||
|
@@ -308,7 +308,17 @@ public:
|
||||
if (m_aspects) {
|
||||
connect(m_aspects, &AspectContainer::applied, this, [this] {
|
||||
updateOptions();
|
||||
LanguageClientManager::applySettings();
|
||||
auto settings = Utils::findOr(
|
||||
LanguageClientManager::currentSettings(), nullptr, [this](BaseSettings *s) {
|
||||
return s->m_id == m_clientSettingsId;
|
||||
});
|
||||
|
||||
if (settings) {
|
||||
LanguageClientManager::applySettings(settings);
|
||||
LanguageClientManager::writeSettings();
|
||||
} else {
|
||||
LanguageClientManager::applySettings();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -88,6 +88,7 @@ CREATE_HAS_FUNC(onTextChanged, nullptr, nullptr)
|
||||
CREATE_HAS_FUNC(onClicked, nullptr, nullptr)
|
||||
CREATE_HAS_FUNC(setText, QString())
|
||||
CREATE_HAS_FUNC(setMarkdown, QString())
|
||||
CREATE_HAS_FUNC(setSizePolicy, QSizePolicy())
|
||||
CREATE_HAS_FUNC(setReadOnly, bool())
|
||||
CREATE_HAS_FUNC(setTitle, QString())
|
||||
CREATE_HAS_FUNC(setValue, int())
|
||||
@@ -290,6 +291,19 @@ void setProperties(std::unique_ptr<T> &item, const sol::table &children, QObject
|
||||
if (markdown)
|
||||
item->setMarkdown(*markdown);
|
||||
}
|
||||
if constexpr (has_setSizePolicy<T>) {
|
||||
auto sizePolicy = children.get<sol::optional<sol::table>>("sizePolicy");
|
||||
if (sizePolicy) {
|
||||
QTC_ASSERT(
|
||||
sizePolicy->size() == 2,
|
||||
throw sol::error(
|
||||
"sizePolicy must be array of 2 elements: horizontalPolicy, verticalPolicy.")
|
||||
);
|
||||
auto horizontalPolicy = sizePolicy->get<QSizePolicy::Policy>(1);
|
||||
auto verticalPolicy = sizePolicy->get<QSizePolicy::Policy>(2);
|
||||
item->setSizePolicy(QSizePolicy(horizontalPolicy, verticalPolicy));
|
||||
}
|
||||
}
|
||||
if constexpr (has_setTitle<T>) {
|
||||
item->setTitle(children.get_or<QString>("title", ""));
|
||||
}
|
||||
@@ -552,6 +566,9 @@ void setupGuiModule()
|
||||
mirrorEnum(gui, QMetaEnum::fromType<Qt::TextInteractionFlag>());
|
||||
mirrorEnum(gui, QMetaEnum::fromType<Qt::CursorShape>());
|
||||
|
||||
auto sizePolicy = gui.create_named("QSizePolicy");
|
||||
mirrorEnum(sizePolicy, QMetaEnum::fromType<QSizePolicy::Policy>());
|
||||
|
||||
gui.new_usertype<Stack>(
|
||||
"Stack",
|
||||
sol::call_constructor,
|
||||
|
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QCursor>
|
||||
#include <QCompleter>
|
||||
#include <QDir>
|
||||
#include <QFileDevice>
|
||||
@@ -54,6 +55,12 @@ void setupQtModule()
|
||||
|
||||
qt["clipboard"] = &QApplication::clipboard;
|
||||
|
||||
qt.new_usertype<QCursor>(
|
||||
"QCursor",
|
||||
sol::no_constructor,
|
||||
"pos", sol::resolve<QPoint()>(&QCursor::pos)
|
||||
);
|
||||
|
||||
qt.new_usertype<QFontMetrics>(
|
||||
"QFontMetrics",
|
||||
"create",
|
||||
|
@@ -381,6 +381,13 @@ void setupTextEditorModule()
|
||||
"insertText",
|
||||
[](TextEditorPtr editor, const QString &text) {
|
||||
editor->editorWidget()->multiTextCursor().insertText(text);
|
||||
},
|
||||
"hasFocus",
|
||||
[](const TextEditorPtr &textEditor) {
|
||||
QTC_ASSERT(
|
||||
textEditor && textEditor->editorWidget(),
|
||||
throw sol::error("TextEditor is not valid"));
|
||||
return textEditor->editorWidget()->hasFocus();
|
||||
});
|
||||
|
||||
result.new_usertype<TextSuggestion::Data>(
|
||||
|
@@ -26,6 +26,7 @@ gui.widget = {}
|
||||
---@field windowFlags? WindowType[] The window flags of the widget.
|
||||
---@field widgetAttributes? WidgetAttributeMapT<boolean> The widget attributes of the widget.
|
||||
---@field autoFillBackground? boolean A boolean, representing whether the widget should automatically fill its background.
|
||||
---@field sizePolicy? SizePolicy.Policy[] Two size policies of the widget, horizontal and vertical.
|
||||
gui.baseWidgetOptions = {}
|
||||
|
||||
---@class (exact) WidgetOptions : BaseWidgetOptions
|
||||
@@ -463,6 +464,20 @@ gui.CursorShape = {
|
||||
CustomCursor = 0
|
||||
}
|
||||
|
||||
gui.SizePolicy = {
|
||||
--- Enum representing size policy.
|
||||
---@enum Policy
|
||||
Policy = {
|
||||
Fixed = 0,
|
||||
Minimum = 0,
|
||||
Maximum = 0,
|
||||
Preferred = 0,
|
||||
MinimumExpanding = 0,
|
||||
Expanding = 0,
|
||||
Ignored = 0
|
||||
}
|
||||
}
|
||||
|
||||
---@class Space : Layout
|
||||
gui.space = {}
|
||||
|
||||
|
@@ -34,6 +34,13 @@ qt.QClipboard = {}
|
||||
---@return QClipboard globalClipboard The global clipboard object.
|
||||
function qt.clipboard() end
|
||||
|
||||
--@class QCursor A Lua wrapper for the Qt `QCursor` class.
|
||||
qt.QCursor = {}
|
||||
|
||||
---Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
|
||||
---@return QPoint position The position of the cursor.
|
||||
function qt.QCursor.pos() end
|
||||
|
||||
---@class QFontMetrics A Lua wrapper for the Qt `QFontMetrics` class.
|
||||
qt.QFontMetrics = {}
|
||||
|
||||
|
@@ -150,6 +150,10 @@ function TextEditor:hasLockedSuggestion() end
|
||||
---@param text string The text to insert.
|
||||
function TextEditor:insertText(text) end
|
||||
|
||||
---Indicates if the editor widget has focus.
|
||||
---@return boolean hasFocus True if the editor widget has focus, false otherwise.
|
||||
function TextEditor:hasFocus() end
|
||||
|
||||
---Returns the current editor or nil.
|
||||
---@return TextEditor|nil editor The currently active editor or nil if there is none.
|
||||
function textEditor.currentEditor() end
|
||||
|
@@ -116,6 +116,7 @@ static QVariant fromSettingsTransformation(const QVariant &v)
|
||||
|
||||
QmlJsEditingSettings::QmlJsEditingSettings()
|
||||
{
|
||||
setAutoApply(false);
|
||||
const Key group = QmlJSEditor::Constants::SETTINGS_CATEGORY_QML;
|
||||
|
||||
enableContextPane.setSettingsKey(group, QML_CONTEXTPANE_KEY);
|
||||
|
@@ -110,6 +110,14 @@ macro(qtc_auto_setup_conan)
|
||||
|
||||
file(COPY "${conanfile_txt}" DESTINATION "${CMAKE_BINARY_DIR}/conan-dependencies/")
|
||||
|
||||
# conanfile should have a generator specified, when both file and conan_install
|
||||
# specifcy the CMakeDeps generator, conan_install will issue an error
|
||||
file(READ "${conanfile_txt}" conanfile_text_content)
|
||||
unset(conan_generator)
|
||||
if (NOT "${conanfile_text_content}" MATCHES ".*CMakeDeps.*")
|
||||
set(conan_generator "-g CMakeDeps")
|
||||
endif()
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/conan-dependencies/toolchain.cmake" "
|
||||
set(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")
|
||||
set(CMAKE_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\")
|
||||
@@ -143,7 +151,7 @@ macro(qtc_auto_setup_conan)
|
||||
-pr \"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\"
|
||||
--build=${QT_CREATOR_CONAN_BUILD_POLICY}
|
||||
-s build_type=\${type}
|
||||
-g CMakeDeps)
|
||||
${conan_generator})
|
||||
endforeach()
|
||||
|
||||
get_property(CONAN_INSTALL_SUCCESS GLOBAL PROPERTY CONAN_INSTALL_SUCCESS)
|
||||
|
@@ -52,6 +52,14 @@ def main():
|
||||
earlyExit("Did not find first line in function block.")
|
||||
return
|
||||
type(editorWidget, "<Return>")
|
||||
if useClang:
|
||||
codeModelInMain = lambda: object.exists(
|
||||
"{currentText='main(int, char **) -> int '"
|
||||
" type='QComboBox' unnamed='1' visible='1'"
|
||||
" window=':Qt Creator_Core::Internal::MainWindow'}")
|
||||
if not waitFor(codeModelInMain, 5000):
|
||||
test.warning("ComboBox does not display expected main function",
|
||||
"Did this slow down or did the displayed content change?")
|
||||
type(editorWidget, "re")
|
||||
triggerCompletion(editorWidget)
|
||||
functionName = "realpath"
|
||||
@@ -63,7 +71,7 @@ def main():
|
||||
test.compare(str(lineUnderCursor(editorWidget)).strip(), functionName + "()",
|
||||
"Step 3: Verifying if: The list of suggestions is opened. It is "
|
||||
"possible to select one of the suggestions.")
|
||||
# Step 4: Insert text "voi" to new line and press Tab.
|
||||
# Step 4: Insert text "unsig" to new line and press Tab.
|
||||
resetLine(editorWidget)
|
||||
type(editorWidget, "unsig")
|
||||
try:
|
||||
|
Reference in New Issue
Block a user