forked from qt-creator/qt-creator
Use setClipboardAndSelection more broadly
Basically everywhere besides the EmacsKeys plugin. Change-Id: Iaf2a0a5d791b5b3dd6df2c05c1b862516630d3f8 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
#include "testtreemodel.h"
|
#include "testtreemodel.h"
|
||||||
|
|
||||||
#include <aggregation/aggregate.h>
|
#include <aggregation/aggregate.h>
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
@@ -44,19 +45,21 @@
|
|||||||
#include <coreplugin/find/itemviewfind.h>
|
#include <coreplugin/find/itemviewfind.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
|
|
||||||
#include <utils/proxyaction.h>
|
#include <utils/proxyaction.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
@@ -703,12 +706,12 @@ const TestResult *TestResultsPane::getTestResult(const QModelIndex &idx)
|
|||||||
void TestResultsPane::onCopyItemTriggered(const TestResult *result)
|
void TestResultsPane::onCopyItemTriggered(const TestResult *result)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(result, return);
|
QTC_ASSERT(result, return);
|
||||||
QApplication::clipboard()->setText(result->outputString(true));
|
setClipboardAndSelection(result->outputString(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestResultsPane::onCopyWholeTriggered()
|
void TestResultsPane::onCopyWholeTriggered()
|
||||||
{
|
{
|
||||||
QApplication::clipboard()->setText(getWholeOutput());
|
setClipboardAndSelection(getWholeOutput());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestResultsPane::onSaveWholeTriggered()
|
void TestResultsPane::onSaveWholeTriggered()
|
||||||
|
@@ -39,16 +39,13 @@
|
|||||||
#include <utils/fadingindicator.h>
|
#include <utils/fadingindicator.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
#include <QApplication>
|
||||||
#include <QByteArrayMatcher>
|
#include <QByteArrayMatcher>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QVariant>
|
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QAction>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
#include <QHelpEvent>
|
#include <QHelpEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@@ -56,7 +53,9 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
#include <QTemporaryFile>
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
|
#include <QVariant>
|
||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
@@ -1488,7 +1487,7 @@ void BinEditorWidget::copy(bool raw)
|
|||||||
QByteArray data = dataMid(selStart, selectionLength);
|
QByteArray data = dataMid(selStart, selectionLength);
|
||||||
if (raw) {
|
if (raw) {
|
||||||
data.replace(0, ' ');
|
data.replace(0, ' ');
|
||||||
QApplication::clipboard()->setText(QString::fromLatin1(data));
|
setClipboardAndSelection(QString::fromLatin1(data));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString hexString;
|
QString hexString;
|
||||||
@@ -1499,7 +1498,7 @@ void BinEditorWidget::copy(bool raw)
|
|||||||
hexString.append(QLatin1Char(hex[val >> 4])).append(QLatin1Char(hex[val & 0xf])).append(QLatin1Char(' '));
|
hexString.append(QLatin1Char(hex[val >> 4])).append(QLatin1Char(hex[val & 0xf])).append(QLatin1Char(' '));
|
||||||
}
|
}
|
||||||
hexString.chop(1);
|
hexString.chop(1);
|
||||||
QApplication::clipboard()->setText(hexString);
|
setClipboardAndSelection(hexString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditorWidget::highlightSearchResults(const QByteArray &pattern, QTextDocument::FindFlags findFlags)
|
void BinEditorWidget::highlightSearchResults(const QByteArray &pattern, QTextDocument::FindFlags findFlags)
|
||||||
@@ -1646,9 +1645,9 @@ void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
else if (action == copyHexAction)
|
else if (action == copyHexAction)
|
||||||
copy(false);
|
copy(false);
|
||||||
else if (action == copyBeValue)
|
else if (action == copyBeValue)
|
||||||
QApplication::clipboard()->setText("0x" + QString::number(beAddress, 16));
|
setClipboardAndSelection("0x" + QString::number(beAddress, 16));
|
||||||
else if (action == copyLeValue)
|
else if (action == copyLeValue)
|
||||||
QApplication::clipboard()->setText("0x" + QString::number(leAddress, 16));
|
setClipboardAndSelection("0x" + QString::number(leAddress, 16));
|
||||||
else if (action == jumpToBeAddressHereAction)
|
else if (action == jumpToBeAddressHereAction)
|
||||||
jumpToAddress(beAddress);
|
jumpToAddress(beAddress);
|
||||||
else if (action == jumpToLeAddressHereAction)
|
else if (action == jumpToLeAddressHereAction)
|
||||||
|
@@ -77,10 +77,8 @@
|
|||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
#include <utils/variablechooser.h>
|
#include <utils/variablechooser.h>
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QClipboard>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -1055,7 +1053,7 @@ bool CMakeBuildSettingsWidget::eventFilter(QObject *target, QEvent *event)
|
|||||||
: m_buildSystem->buildConfiguration()->macroExpander());
|
: m_buildSystem->buildConfiguration()->macroExpander());
|
||||||
});
|
});
|
||||||
|
|
||||||
QApplication::clipboard()->setText(variableList.join('\n'), QClipboard::Clipboard);
|
setClipboardAndSelection(variableList.join('\n'));
|
||||||
});
|
});
|
||||||
|
|
||||||
menu->move(e->globalPos());
|
menu->move(e->globalPos());
|
||||||
|
@@ -2426,7 +2426,7 @@ void EditorManagerPrivate::copyFilePathFromContextMenu()
|
|||||||
{
|
{
|
||||||
if (!d->m_contextMenuEntry)
|
if (!d->m_contextMenuEntry)
|
||||||
return;
|
return;
|
||||||
QApplication::clipboard()->setText(d->m_contextMenuEntry->fileName().toUserOutput());
|
setClipboardAndSelection(d->m_contextMenuEntry->fileName().toUserOutput());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorManagerPrivate::copyLocationFromContextMenu()
|
void EditorManagerPrivate::copyLocationFromContextMenu()
|
||||||
|
@@ -45,6 +45,7 @@
|
|||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/mimeutils.h>
|
#include <utils/mimeutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
#include <utils/temporarydirectory.h>
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
@@ -325,7 +326,8 @@ void CodePasterPluginPrivate::fetch()
|
|||||||
void CodePasterPluginPrivate::finishPost(const QString &link)
|
void CodePasterPluginPrivate::finishPost(const QString &link)
|
||||||
{
|
{
|
||||||
if (m_settings.copyToClipboard.value())
|
if (m_settings.copyToClipboard.value())
|
||||||
QApplication::clipboard()->setText(link);
|
Utils::setClipboardAndSelection(link);
|
||||||
|
|
||||||
if (m_settings.displayOutput.value())
|
if (m_settings.displayOutput.value())
|
||||||
MessageManager::writeDisrupting(link);
|
MessageManager::writeDisrupting(link);
|
||||||
else
|
else
|
||||||
|
@@ -27,11 +27,10 @@
|
|||||||
#include "cppcheckdiagnostic.h"
|
#include "cppcheckdiagnostic.h"
|
||||||
#include "cppchecktextmark.h"
|
#include "cppchecktextmark.h"
|
||||||
|
|
||||||
|
#include <utils/stringutils.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QApplication>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
namespace Cppcheck {
|
namespace Cppcheck {
|
||||||
@@ -90,7 +89,7 @@ CppcheckTextMark::CppcheckTextMark (const Diagnostic &diagnostic)
|
|||||||
.arg(diagnostic.fileName.toUserOutput())
|
.arg(diagnostic.fileName.toUserOutput())
|
||||||
.arg(diagnostic.lineNumber)
|
.arg(diagnostic.lineNumber)
|
||||||
.arg(diagnostic.message);
|
.arg(diagnostic.message);
|
||||||
QApplication::clipboard()->setText(text);
|
Utils::setClipboardAndSelection(text);
|
||||||
});
|
});
|
||||||
setActions({action});
|
setActions({action});
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,6 @@
|
|||||||
#include "remotedialog.h"
|
#include "remotedialog.h"
|
||||||
#include "stashdialog.h"
|
#include "stashdialog.h"
|
||||||
#include "logchangedialog.h"
|
#include "logchangedialog.h"
|
||||||
#include "mergetool.h"
|
|
||||||
#include "gitutils.h"
|
#include "gitutils.h"
|
||||||
#include "gitgrep.h"
|
#include "gitgrep.h"
|
||||||
|
|
||||||
@@ -86,7 +85,6 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@@ -267,7 +265,7 @@ public:
|
|||||||
const QString &reference) final
|
const QString &reference) final
|
||||||
{
|
{
|
||||||
menu->addAction(tr("&Copy \"%1\"").arg(reference),
|
menu->addAction(tr("&Copy \"%1\"").arg(reference),
|
||||||
[reference] { QApplication::clipboard()->setText(reference); });
|
[reference] { setClipboardAndSelection(reference); });
|
||||||
QAction *action = menu->addAction(tr("&Describe Change %1").arg(reference),
|
QAction *action = menu->addAction(tr("&Describe Change %1").arg(reference),
|
||||||
[=] { vcsDescribe(workingDirectory, reference); });
|
[=] { vcsDescribe(workingDirectory, reference); });
|
||||||
menu->setDefaultAction(action);
|
menu->setDefaultAction(action);
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "helpplugin.h"
|
#include "helpplugin.h"
|
||||||
|
|
||||||
#include "bookmarkmanager.h"
|
#include "bookmarkmanager.h"
|
||||||
|
#include "contentwindow.h"
|
||||||
#include "docsettingspage.h"
|
#include "docsettingspage.h"
|
||||||
#include "filtersettingspage.h"
|
#include "filtersettingspage.h"
|
||||||
#include "generalsettingspage.h"
|
#include "generalsettingspage.h"
|
||||||
@@ -38,23 +39,21 @@
|
|||||||
#include "helptr.h"
|
#include "helptr.h"
|
||||||
#include "helpviewer.h"
|
#include "helpviewer.h"
|
||||||
#include "helpwidget.h"
|
#include "helpwidget.h"
|
||||||
|
#include "indexwindow.h"
|
||||||
#include "localhelpmanager.h"
|
#include "localhelpmanager.h"
|
||||||
#include "openpagesmanager.h"
|
#include "openpagesmanager.h"
|
||||||
#include "searchtaskhandler.h"
|
#include "searchtaskhandler.h"
|
||||||
#include "searchwidget.h"
|
|
||||||
#include "topicchooser.h"
|
#include "topicchooser.h"
|
||||||
|
|
||||||
#include <bookmarkmanager.h>
|
|
||||||
#include <contentwindow.h>
|
|
||||||
#include <indexwindow.h>
|
|
||||||
|
|
||||||
#include <app/app_version.h>
|
#include <app/app_version.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
|
#include <coreplugin/find/findplugin.h>
|
||||||
#include <coreplugin/findplaceholder.h>
|
#include <coreplugin/findplaceholder.h>
|
||||||
#include <coreplugin/helpitem.h>
|
#include <coreplugin/helpitem.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -62,17 +61,19 @@
|
|||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/rightpane.h>
|
#include <coreplugin/rightpane.h>
|
||||||
#include <coreplugin/sidebar.h>
|
#include <coreplugin/sidebar.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <coreplugin/find/findplugin.h>
|
|
||||||
#include <texteditor/texteditorconstants.h>
|
#include <texteditor/texteditorconstants.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/styledbar.h>
|
#include <utils/styledbar.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
#include <utils/tooltip/tooltip.h>
|
#include <utils/tooltip/tooltip.h>
|
||||||
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@@ -644,8 +645,7 @@ void HelpPluginPrivate::slotSystemInformation()
|
|||||||
connect(buttonBox, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
|
connect(buttonBox, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
|
||||||
layout->addWidget(buttonBox);
|
layout->addWidget(buttonBox);
|
||||||
connect(dialog, &QDialog::accepted, info, [info]() {
|
connect(dialog, &QDialog::accepted, info, [info]() {
|
||||||
if (QApplication::clipboard())
|
setClipboardAndSelection(info->toPlainText());
|
||||||
QApplication::clipboard()->setText(info->toPlainText());
|
|
||||||
});
|
});
|
||||||
connect(dialog, &QDialog::rejected, dialog, [dialog]{ dialog->close(); });
|
connect(dialog, &QDialog::rejected, dialog, [dialog]{ dialog->close(); });
|
||||||
dialog->resize(700, 400);
|
dialog->resize(700, 400);
|
||||||
|
@@ -48,7 +48,8 @@
|
|||||||
#include <QHelpEngine>
|
#include <QHelpEngine>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Help::Internal;
|
|
||||||
|
namespace Help::Internal {
|
||||||
|
|
||||||
// -- OpenPagesManager
|
// -- OpenPagesManager
|
||||||
|
|
||||||
@@ -252,5 +253,7 @@ void OpenPagesManager::openPagesContextMenu(const QPoint &point)
|
|||||||
QMenu menu;
|
QMenu menu;
|
||||||
menu.addAction(Tr::tr("Copy Full Path to Clipboard"));
|
menu.addAction(Tr::tr("Copy Full Path to Clipboard"));
|
||||||
if (menu.exec(m_comboBox->mapToGlobal(point)))
|
if (menu.exec(m_comboBox->mapToGlobal(point)))
|
||||||
QApplication::clipboard()->setText(fileName);
|
Utils::setClipboardAndSelection(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // Help::Internal
|
||||||
|
@@ -24,11 +24,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "searchwidget.h"
|
#include "searchwidget.h"
|
||||||
|
|
||||||
#include "helpconstants.h"
|
#include "helpconstants.h"
|
||||||
#include "helpplugin.h"
|
|
||||||
#include "helptr.h"
|
#include "helptr.h"
|
||||||
#include "localhelpmanager.h"
|
#include "localhelpmanager.h"
|
||||||
#include "openpagesmanager.h"
|
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -40,7 +39,6 @@
|
|||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
|
||||||
#include <QHelpEngine>
|
#include <QHelpEngine>
|
||||||
#include <QHelpSearchEngine>
|
#include <QHelpSearchEngine>
|
||||||
#include <QHelpSearchQueryWidget>
|
#include <QHelpSearchQueryWidget>
|
||||||
@@ -56,7 +54,7 @@
|
|||||||
#include <QTextBrowser>
|
#include <QTextBrowser>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
using namespace Help::Internal;
|
namespace Help::Internal {
|
||||||
|
|
||||||
SearchWidget::SearchWidget() = default;
|
SearchWidget::SearchWidget() = default;
|
||||||
|
|
||||||
@@ -264,7 +262,7 @@ void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent)
|
|||||||
else if (usedAction == openLinkInNewTab)
|
else if (usedAction == openLinkInNewTab)
|
||||||
emit linkActivated(link, currentSearchTerms(), true/*newPage*/);
|
emit linkActivated(link, currentSearchTerms(), true/*newPage*/);
|
||||||
else if (usedAction == copyAnchorAction)
|
else if (usedAction == copyAnchorAction)
|
||||||
QApplication::clipboard()->setText(link.toString());
|
Utils::setClipboardAndSelection(link.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList SearchWidget::currentSearchTerms() const
|
QStringList SearchWidget::currentSearchTerms() const
|
||||||
@@ -291,3 +289,5 @@ QList<QToolButton *> SearchSideBarItem::createToolBarWidgets()
|
|||||||
static_cast<SearchWidget *>(widget()), &SearchWidget::reindexDocumentation);
|
static_cast<SearchWidget *>(widget()), &SearchWidget::reindexDocumentation);
|
||||||
return {reindexButton};
|
return {reindexButton};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // Help::Internal
|
||||||
|
@@ -30,11 +30,11 @@
|
|||||||
#include "localhelpmanager.h"
|
#include "localhelpmanager.h"
|
||||||
|
|
||||||
#include <coreplugin/find/findplugin.h>
|
#include <coreplugin/find/findplugin.h>
|
||||||
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QContextMenuEvent>
|
#include <QContextMenuEvent>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@@ -43,8 +43,7 @@
|
|||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
using namespace Help;
|
namespace Help::Internal {
|
||||||
using namespace Help::Internal;
|
|
||||||
|
|
||||||
// -- HelpViewer
|
// -- HelpViewer
|
||||||
|
|
||||||
@@ -342,7 +341,7 @@ void TextBrowserHelpWidget::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (copyAnchorAction == menu.exec(event->globalPos()))
|
if (copyAnchorAction == menu.exec(event->globalPos()))
|
||||||
QApplication::clipboard()->setText(link.toString());
|
Utils::setClipboardAndSelection(link.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextBrowserHelpWidget::eventFilter(QObject *obj, QEvent *event)
|
bool TextBrowserHelpWidget::eventFilter(QObject *obj, QEvent *event)
|
||||||
@@ -409,3 +408,5 @@ void TextBrowserHelpWidget::resizeEvent(QResizeEvent *e)
|
|||||||
QTextBrowser::resizeEvent(e);
|
QTextBrowser::resizeEvent(e);
|
||||||
scrollToTextPosition(topTextPosition);
|
scrollToTextPosition(topTextPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // Help::Internal
|
||||||
|
@@ -28,18 +28,20 @@
|
|||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/documentmodel.h>
|
#include <coreplugin/editormanager/documentmodel.h>
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
|
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
#include <texteditor/textmark.h>
|
#include <texteditor/textmark.h>
|
||||||
#include <texteditor/textstyles.h>
|
#include <texteditor/textstyles.h>
|
||||||
|
|
||||||
|
#include <utils/stringutils.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QApplication>
|
|
||||||
#include <QClipboard>
|
|
||||||
|
|
||||||
using namespace LanguageServerProtocol;
|
using namespace LanguageServerProtocol;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -147,7 +149,7 @@ TextEditor::TextMark *DiagnosticManager::createTextMark(const FilePath &filePath
|
|||||||
action->setIcon(icon);
|
action->setIcon(icon);
|
||||||
action->setToolTip(tooltip);
|
action->setToolTip(tooltip);
|
||||||
QObject::connect(action, &QAction::triggered, [text = diagnostic.message()]() {
|
QObject::connect(action, &QAction::triggered, [text = diagnostic.message()]() {
|
||||||
QApplication::clipboard()->setText(text);
|
setClipboardAndSelection(text);
|
||||||
});
|
});
|
||||||
auto mark = new TextMark(filePath, diagnostic, m_client->id());
|
auto mark = new TextMark(filePath, diagnostic, m_client->id());
|
||||||
mark->setActions({action});
|
mark->setActions({action});
|
||||||
|
@@ -27,12 +27,11 @@
|
|||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <utils/stringutils.h>
|
||||||
#include <QApplication>
|
|
||||||
#include <QClipboard>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
#include <QAction>
|
||||||
using namespace ProjectExplorer::Internal;
|
|
||||||
|
namespace ProjectExplorer::Internal {
|
||||||
|
|
||||||
void CopyTaskHandler::handle(const Tasks &tasks)
|
void CopyTaskHandler::handle(const Tasks &tasks)
|
||||||
{
|
{
|
||||||
@@ -54,7 +53,7 @@ void CopyTaskHandler::handle(const Tasks &tasks)
|
|||||||
lines << task.file.toUserOutput() + ':' + QString::number(task.line)
|
lines << task.file.toUserOutput() + ':' + QString::number(task.line)
|
||||||
+ ": " + type + task.description();
|
+ ": " + type + task.description();
|
||||||
}
|
}
|
||||||
QApplication::clipboard()->setText(lines.join('\n'));
|
Utils::setClipboardAndSelection(lines.join('\n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::Id CopyTaskHandler::actionManagerId() const
|
Utils::Id CopyTaskHandler::actionManagerId() const
|
||||||
@@ -66,3 +65,5 @@ QAction *CopyTaskHandler::createAction(QObject *parent) const
|
|||||||
{
|
{
|
||||||
return new QAction(parent);
|
return new QAction(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // ProjectExplorer::Internal
|
||||||
|
@@ -36,28 +36,29 @@
|
|||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projecttree.h>
|
#include <projectexplorer/projecttree.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/parameteraction.h>
|
#include <utils/parameteraction.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
#include <utils/threadutils.h>
|
#include <utils/threadutils.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QFormLayout>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFormLayout>
|
|
||||||
#include <QDialogButtonBox>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QApplication>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -356,14 +357,14 @@ void ResourceEditorPluginPrivate::copyPathContextMenu()
|
|||||||
{
|
{
|
||||||
auto node = dynamic_cast<ResourceFileNode *>(ProjectTree::currentNode());
|
auto node = dynamic_cast<ResourceFileNode *>(ProjectTree::currentNode());
|
||||||
QTC_ASSERT(node, return);
|
QTC_ASSERT(node, return);
|
||||||
QApplication::clipboard()->setText(QLatin1String(resourcePrefix) + node->qrcPath());
|
setClipboardAndSelection(QLatin1String(resourcePrefix) + node->qrcPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceEditorPluginPrivate::copyUrlContextMenu()
|
void ResourceEditorPluginPrivate::copyUrlContextMenu()
|
||||||
{
|
{
|
||||||
auto node = dynamic_cast<ResourceFileNode *>(ProjectTree::currentNode());
|
auto node = dynamic_cast<ResourceFileNode *>(ProjectTree::currentNode());
|
||||||
QTC_ASSERT(node, return);
|
QTC_ASSERT(node, return);
|
||||||
QApplication::clipboard()->setText(QLatin1String(urlPrefix) + node->qrcPath());
|
setClipboardAndSelection(QLatin1String(urlPrefix) + node->qrcPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceEditorPluginPrivate::renamePrefixContextMenu()
|
void ResourceEditorPluginPrivate::renamePrefixContextMenu()
|
||||||
|
@@ -24,27 +24,25 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "resourceeditorw.h"
|
#include "resourceeditorw.h"
|
||||||
#include "resourceeditorplugin.h"
|
|
||||||
#include "resourceeditorconstants.h"
|
#include "resourceeditorconstants.h"
|
||||||
|
#include "resourceeditorplugin.h"
|
||||||
|
|
||||||
#include <resourceeditor/qrceditor/resourcefile_p.h>
|
|
||||||
#include <resourceeditor/qrceditor/qrceditor.h>
|
#include <resourceeditor/qrceditor/qrceditor.h>
|
||||||
|
#include <resourceeditor/qrceditor/resourcefile_p.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/commandbutton.h>
|
#include <coreplugin/actionmanager/commandbutton.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <utils/reloadpromptutils.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/fileutils.h>
|
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <utils/filepath.h>
|
||||||
#include <QDir>
|
#include <utils/reloadpromptutils.h>
|
||||||
#include <qdebug.h>
|
#include <utils/stringutils.h>
|
||||||
#include <QHBoxLayout>
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
#include <QInputDialog>
|
|
||||||
#include <QClipboard>
|
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -319,7 +317,7 @@ void ResourceEditorW::renameCurrentFile()
|
|||||||
|
|
||||||
void ResourceEditorW::copyCurrentResourcePath()
|
void ResourceEditorW::copyCurrentResourcePath()
|
||||||
{
|
{
|
||||||
QApplication::clipboard()->setText(m_resourceEditor->currentResourcePath());
|
setClipboardAndSelection(m_resourceEditor->currentResourcePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceEditorW::orderList()
|
void ResourceEditorW::orderList()
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
@@ -575,7 +576,7 @@ void ObjectsMapEditorWidget::onPasteSymbolicNameTriggered()
|
|||||||
void ObjectsMapEditorWidget::onCopyRealNameTriggered()
|
void ObjectsMapEditorWidget::onCopyRealNameTriggered()
|
||||||
{
|
{
|
||||||
if (ObjectsMapTreeItem *item = selectedObjectItem())
|
if (ObjectsMapTreeItem *item = selectedObjectItem())
|
||||||
QApplication::clipboard()->setText(QLatin1String(item->propertiesToByteArray()));
|
Utils::setClipboardAndSelection(QLatin1String(item->propertiesToByteArray()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectsMapEditorWidget::onCutSymbolicNameTriggered()
|
void ObjectsMapEditorWidget::onCutSymbolicNameTriggered()
|
||||||
|
@@ -36,37 +36,41 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/patchtool.h>
|
#include <coreplugin/patchtool.h>
|
||||||
#include <coreplugin/vcsmanager.h>
|
#include <coreplugin/vcsmanager.h>
|
||||||
|
|
||||||
#include <cpaster/codepasterservice.h>
|
#include <cpaster/codepasterservice.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <projectexplorer/editorconfiguration.h>
|
#include <projectexplorer/editorconfiguration.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
|
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
#include <texteditor/textdocumentlayout.h>
|
#include <texteditor/textdocumentlayout.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/progressindicator.h>
|
#include <utils/progressindicator.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/shellcommand.h>
|
#include <utils/shellcommand.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QFile>
|
|
||||||
#include <QRegularExpression>
|
|
||||||
#include <QSet>
|
|
||||||
#include <QTextCodec>
|
|
||||||
#include <QUrl>
|
|
||||||
#include <QTextBlock>
|
|
||||||
#include <QDesktopServices>
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <QComboBox>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
#include <QSet>
|
||||||
|
#include <QTextBlock>
|
||||||
|
#include <QTextCodec>
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QComboBox>
|
#include <QUrl>
|
||||||
#include <QClipboard>
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum VcsBase::EditorContentType
|
\enum VcsBase::EditorContentType
|
||||||
@@ -337,7 +341,7 @@ void ChangeTextCursorHandler::slotDescribe()
|
|||||||
|
|
||||||
void ChangeTextCursorHandler::slotCopyRevision()
|
void ChangeTextCursorHandler::slotCopyRevision()
|
||||||
{
|
{
|
||||||
QApplication::clipboard()->setText(m_currentChange);
|
setClipboardAndSelection(m_currentChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeTextCursorHandler::addDescribeAction(QMenu *menu, const QString &change) const
|
void ChangeTextCursorHandler::addDescribeAction(QMenu *menu, const QString &change) const
|
||||||
@@ -486,7 +490,7 @@ void UrlTextCursorHandler::setUrlPattern(const QString &pattern)
|
|||||||
|
|
||||||
void UrlTextCursorHandler::slotCopyUrl()
|
void UrlTextCursorHandler::slotCopyUrl()
|
||||||
{
|
{
|
||||||
QApplication::clipboard()->setText(m_urlData.url);
|
setClipboardAndSelection(m_urlData.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UrlTextCursorHandler::slotOpenUrl()
|
void UrlTextCursorHandler::slotOpenUrl()
|
||||||
|
@@ -21,15 +21,15 @@
|
|||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vcsoutputformatter.h"
|
#include "vcsoutputformatter.h"
|
||||||
|
|
||||||
#include <coreplugin/iversioncontrol.h>
|
#include <coreplugin/iversioncontrol.h>
|
||||||
#include <coreplugin/vcsmanager.h>
|
#include <coreplugin/vcsmanager.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
@@ -90,11 +90,11 @@ void VcsOutputLineParser::fillLinkContextMenu(
|
|||||||
[href] { QDesktopServices::openUrl(QUrl(href)); });
|
[href] { QDesktopServices::openUrl(QUrl(href)); });
|
||||||
menu->setDefaultAction(action);
|
menu->setDefaultAction(action);
|
||||||
menu->addAction(tr("&Copy to clipboard: \"%1\"").arg(href),
|
menu->addAction(tr("&Copy to clipboard: \"%1\"").arg(href),
|
||||||
[href] { QApplication::clipboard()->setText(href); });
|
[href] { setClipboardAndSelection(href); });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Core::IVersionControl *vcs = Core::VcsManager::findVersionControlForDirectory(workingDirectory))
|
if (Core::IVersionControl *vcs = Core::VcsManager::findVersionControlForDirectory(workingDirectory))
|
||||||
vcs->fillLinkContextMenu(menu, workingDirectory, href);
|
vcs->fillLinkContextMenu(menu, workingDirectory, href);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // VcsBase
|
||||||
|
@@ -24,12 +24,15 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "crashhandlerdialog.h"
|
#include "crashhandlerdialog.h"
|
||||||
|
|
||||||
#include "crashhandler.h"
|
#include "crashhandler.h"
|
||||||
#include "ui_crashhandlerdialog.h"
|
#include "ui_crashhandlerdialog.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include <app/app_version.h>
|
#include <app/app_version.h>
|
||||||
|
|
||||||
#include <utils/checkablemessagebox.h>
|
#include <utils/checkablemessagebox.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
@@ -250,7 +253,7 @@ void CrashHandlerDialog::selectLineWithContents(const QString &text)
|
|||||||
|
|
||||||
void CrashHandlerDialog::copyToClipboardClicked()
|
void CrashHandlerDialog::copyToClipboardClicked()
|
||||||
{
|
{
|
||||||
QApplication::clipboard()->setText(m_ui->debugInfoEdit->toPlainText());
|
Utils::setClipboardAndSelection(m_ui->debugInfoEdit->toPlainText());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrashHandlerDialog::close()
|
void CrashHandlerDialog::close()
|
||||||
|
Reference in New Issue
Block a user