Merge remote-tracking branch 'gerrit/12.0'

Conflicts:
	src/plugins/texteditor/texteditor.cpp

Change-Id: I76620975760a8f9e64f6d381c948d457e949a87c
This commit is contained in:
Eike Ziller
2023-11-15 10:32:59 +01:00
12 changed files with 41 additions and 13 deletions

View File

@@ -268,6 +268,7 @@ void InfoBarDisplay::update()
{
for (QWidget *widget : std::as_const(m_infoWidgets)) {
widget->disconnect(this); // We want no destroyed() signal now
widget->hide(); // Late deletion can cause duplicate infos. Hide immediately to prevent it.
widget->deleteLater();
}
m_infoWidgets.clear();

View File

@@ -17,6 +17,7 @@
#include <utils/qtcassert.h>
#include <utils/theme/theme.h>
#include <utils/fancylineedit.h>
#include <utils/infolabel.h>
#include <QFrame>
#include <QLabel>
@@ -93,8 +94,6 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
topLayout->addWidget(m_topReplaceWidget);
m_messageWidget = new QFrame;
pal.setColor(QPalette::WindowText, creatorTheme()->color(Theme::TextColorError));
m_messageWidget->setPalette(pal);
if (creatorTheme()->flag(Theme::DrawSearchResultWidgetFrame)) {
m_messageWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
m_messageWidget->setLineWidth(1);
@@ -103,8 +102,9 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
auto messageLayout = new QHBoxLayout(m_messageWidget);
messageLayout->setContentsMargins(2, 2, 2, 2);
m_messageWidget->setLayout(messageLayout);
m_messageLabel = new QLabel;
m_messageLabel->setPalette(pal);
m_messageLabel = new InfoLabel;
m_messageLabel->setType(InfoLabel::Error);
m_messageLabel->setFilled(true);
messageLayout->addWidget(m_messageLabel);
layout->addWidget(m_messageWidget);
m_messageWidget->setVisible(false);

View File

@@ -18,6 +18,7 @@ class QToolButton;
class QCheckBox;
QT_END_NAMESPACE
namespace Utils { class InfoLabel; }
namespace Core {
namespace Internal {
@@ -123,7 +124,7 @@ private:
QWidget *m_descriptionContainer = nullptr;
QLabel *m_label = nullptr;
QLabel *m_searchTerm = nullptr;
QLabel *m_messageLabel = nullptr;
Utils::InfoLabel *m_messageLabel = nullptr;
QToolButton *m_cancelButton = nullptr;
QLabel *m_matchesFoundLabel = nullptr;
bool m_preserveCaseSupported = true;

View File

@@ -1953,25 +1953,30 @@ LookupResult lookUpDefinition(const CppQuickFixInterface &interface, const NameA
// Try to find the class/template definition
const Name *name = nameAst->name;
const QList<LookupItem> results = interface.context().lookup(name, scope);
LookupResult best = LookupResult::NotDeclared;
for (const LookupItem &item : results) {
if (Symbol *declaration = item.declaration()) {
if (declaration->asClass())
return LookupResult::Declared;
if (declaration->asForwardClassDeclaration())
return LookupResult::ForwardDeclared;
if (declaration->asForwardClassDeclaration()) {
best = LookupResult::ForwardDeclared;
continue;
}
if (Template *templ = declaration->asTemplate()) {
if (Symbol *declaration = templ->declaration()) {
if (declaration->asClass())
return LookupResult::Declared;
if (declaration->asForwardClassDeclaration())
return LookupResult::ForwardDeclared;
if (declaration->asForwardClassDeclaration()) {
best = LookupResult::ForwardDeclared;
continue;
}
}
}
return LookupResult::Declared;
}
}
return LookupResult::NotDeclared;
return best;
}
QString templateNameAsString(const TemplateNameId *templateName)

View File

@@ -1,6 +1,7 @@
extend_qtc_plugin(McuSupport
CONDITION WITH_TESTS AND TARGET Googletest
DEPENDS Googletest
DEFINES GOOGLE_TEST_IS_FOUND
SOURCES
unittest.h unittest.cpp
packagemock.h

View File

@@ -821,7 +821,11 @@ void Project::createTargetFromMap(const Store &map, int index)
}
Kit *k = KitManager::kit(id);
if (!k && !ICore::isQtDesignStudio()) {
if (!k) {
// QDS does not want replacement kits.
if (ICore::isQtDesignStudio())
return;
Id deviceTypeId = Id::fromSetting(targetMap.value(Target::deviceTypeKey()));
if (!deviceTypeId.isValid())
deviceTypeId = Constants::DESKTOP_DEVICE_TYPE;

View File

@@ -15,5 +15,6 @@ constexpr char CLEARSELECTION[] = "Terminal.ClearSelection";
constexpr char MOVECURSORWORDLEFT[] = "Terminal.MoveCursorWordLeft";
constexpr char MOVECURSORWORDRIGHT[] = "Terminal.MoveCursorWordRight";
constexpr char CLEAR_TERMINAL[] = "Terminal.ClearTerminal";
constexpr char TOGGLE_KEYBOARD_LOCK[] = "Terminal.ToggleKeyboardLock";
} // namespace Terminal::Constants

View File

@@ -125,6 +125,8 @@ TerminalPane::TerminalPane(QObject *parent)
updateLockButton();
connect(&toggleKeyboardLock, &QAction::triggered, m_lockKeyboardButton, &QToolButton::toggle);
connect(m_lockKeyboardButton, &QToolButton::toggled, this, [this, updateLockButton] {
settings().lockKeyboard.setValue(m_lockKeyboardButton->isChecked());
updateLockButton();
@@ -292,6 +294,8 @@ void TerminalPane::initActions()
closeTerminal.setIcon(CLOSE_TERMINAL_ICON.icon());
closeTerminal.setToolTip(Tr::tr("Close the current Terminal."));
toggleKeyboardLock.setText(Tr::tr("Toggle Keyboard Lock"));
using namespace Constants;
Command *cmd = ActionManager::registerAction(&newTerminal, NEWTERMINAL, m_selfContext);
@@ -310,6 +314,10 @@ void TerminalPane::initActions()
QKeySequence(HostOsInfo::isMacHost() ? QLatin1String("Ctrl+Shift+]")
: QLatin1String("Ctrl+PgDown"))});
ActionManager::registerAction(&toggleKeyboardLock,
TOGGLE_KEYBOARD_LOCK,
m_selfContext);
connect(&newTerminal, &QAction::triggered, this, [this] { openTerminal({}); });
connect(&closeTerminal, &QAction::triggered, this, [this] {
removeTab(m_tabWidget.currentIndex());

View File

@@ -66,6 +66,7 @@ private:
QAction nextTerminal;
QAction prevTerminal;
QAction closeTerminal;
QAction toggleKeyboardLock;
QMenu m_shellMenu;

View File

@@ -571,6 +571,12 @@ bool TerminalWidget::event(QEvent *event)
return true;
}
if (settings().lockKeyboard()
&& QKeySequence(keyEvent->keyCombination())
== ActionManager::command(Constants::TOGGLE_KEYBOARD_LOCK)->keySequence()) {
return false;
}
if (settings().lockKeyboard()) {
event->accept();
return true;