forked from qt-creator/qt-creator
Even more Qt6 porting
Task-number: QTCREATORBUG-24098 Change-Id: Ib6ef0e521483153c9716c9a1870072e836d6b026 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -933,7 +933,11 @@ void PreviewDialog::setPixmap(const QPixmap &p, int zoom)
|
|||||||
m_label->adjustSize();
|
m_label->adjustSize();
|
||||||
m_zoom = zoom;
|
m_zoom = zoom;
|
||||||
m_label->setZoom(m_zoom);
|
m_label->setZoom(m_zoom);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QSize size = m_label->pixmap().size() + QSize(54, 44);
|
||||||
|
#else
|
||||||
QSize size = m_label->pixmap()->size() + QSize(54, 44);
|
QSize size = m_label->pixmap()->size() + QSize(54, 44);
|
||||||
|
#endif
|
||||||
if (size.width() < 180)
|
if (size.width() < 180)
|
||||||
size.setWidth(180);
|
size.setWidth(180);
|
||||||
resize(size);
|
resize(size);
|
||||||
|
@@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
|
|
||||||
|
#include <QFile>
|
||||||
|
|
||||||
using namespace LanguageServerProtocol;
|
using namespace LanguageServerProtocol;
|
||||||
|
|
||||||
namespace LanguageClient {
|
namespace LanguageClient {
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
#include <utils/treeviewcombobox.h>
|
#include <utils/treeviewcombobox.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
|
#include <QActionGroup>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
@@ -224,7 +225,7 @@ void updateEditorToolBar(Core::IEditor *editor)
|
|||||||
actions[widget] = widget->toolBar()->addAction(
|
actions[widget] = widget->toolBar()->addAction(
|
||||||
icon, client->name(), [document]() {
|
icon, client->name(), [document]() {
|
||||||
auto menu = new QMenu;
|
auto menu = new QMenu;
|
||||||
auto *clientsGroup = new QActionGroup(menu);
|
auto clientsGroup = new QActionGroup(menu);
|
||||||
clientsGroup->setExclusive(true);
|
clientsGroup->setExclusive(true);
|
||||||
for (auto client : LanguageClientManager::clientsSupportingDocument(document)) {
|
for (auto client : LanguageClientManager::clientsSupportingDocument(document)) {
|
||||||
auto action = clientsGroup->addAction(client->name());
|
auto action = clientsGroup->addAction(client->name());
|
||||||
|
@@ -27,13 +27,12 @@
|
|||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QtEndian>
|
#include <QtEndian>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QRegExp>
|
#include <QRegularExpression>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
@@ -456,7 +455,7 @@ Abi Abi::abiFromTargetTriplet(const QString &triple)
|
|||||||
if (machine.isEmpty())
|
if (machine.isEmpty())
|
||||||
return Abi();
|
return Abi();
|
||||||
|
|
||||||
const QVector<QStringRef> parts = machine.splitRef(QRegExp("[ /-]"));
|
const QVector<QStringRef> parts = machine.splitRef(QRegularExpression("[ /-]"));
|
||||||
|
|
||||||
Architecture arch = UnknownArchitecture;
|
Architecture arch = UnknownArchitecture;
|
||||||
OS os = UnknownOS;
|
OS os = UnknownOS;
|
||||||
|
@@ -461,11 +461,14 @@ QWidget *SpacerField::createWidget(const QString &displayName, JsonFieldPage *pa
|
|||||||
{
|
{
|
||||||
Q_UNUSED(displayName)
|
Q_UNUSED(displayName)
|
||||||
Q_UNUSED(page)
|
Q_UNUSED(page)
|
||||||
int size = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing) * m_factor;
|
int hspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
|
||||||
|
int vspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing);
|
||||||
|
int hsize = hspace * m_factor;
|
||||||
|
int vsize = vspace * m_factor;
|
||||||
|
|
||||||
auto w = new QWidget();
|
auto w = new QWidget();
|
||||||
w->setMinimumSize(size, size);
|
w->setMinimumSize(hsize, vsize);
|
||||||
w->setMaximumSize(size, size);
|
w->setMaximumSize(hsize, vsize);
|
||||||
w->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
w->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
@@ -85,7 +85,7 @@ ProjectExplorerSettingsWidget::ProjectExplorerSettingsWidget(QWidget *parent) :
|
|||||||
m_ui.directoryButtonGroup->setId(m_ui.currentDirectoryRadioButton, UseCurrentDirectory);
|
m_ui.directoryButtonGroup->setId(m_ui.currentDirectoryRadioButton, UseCurrentDirectory);
|
||||||
m_ui.directoryButtonGroup->setId(m_ui.directoryRadioButton, UseProjectDirectory);
|
m_ui.directoryButtonGroup->setId(m_ui.directoryRadioButton, UseProjectDirectory);
|
||||||
|
|
||||||
connect(m_ui.directoryButtonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked),
|
connect(m_ui.directoryButtonGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
|
||||||
this, &ProjectExplorerSettingsWidget::slotDirectoryButtonGroupChanged);
|
this, &ProjectExplorerSettingsWidget::slotDirectoryButtonGroupChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -509,7 +509,8 @@ public:
|
|||||||
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid);
|
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid);
|
||||||
});
|
});
|
||||||
targetDirLayout->addWidget(m_targetDirChooser);
|
targetDirLayout->addWidget(m_targetDirChooser);
|
||||||
connect(m_buttonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked), this, [this] {
|
connect(m_buttonGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
|
||||||
|
this, [this] {
|
||||||
switch (dropAction()) {
|
switch (dropAction()) {
|
||||||
case DropAction::CopyWithFiles:
|
case DropAction::CopyWithFiles:
|
||||||
case DropAction::MoveWithFiles:
|
case DropAction::MoveWithFiles:
|
||||||
|
@@ -42,6 +42,8 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace ProjectExplorer::Internal;
|
using namespace ProjectExplorer::Internal;
|
||||||
@@ -195,7 +197,7 @@ namespace {
|
|||||||
static QString generateSuffix(const QString &suffix)
|
static QString generateSuffix(const QString &suffix)
|
||||||
{
|
{
|
||||||
QString result = suffix;
|
QString result = suffix;
|
||||||
result.replace(QRegExp("[^a-zA-Z0-9_.-]"), QString('_')); // replace fishy character
|
result.replace(QRegularExpression("[^a-zA-Z0-9_.-]"), QString('_')); // replace fishy character
|
||||||
if (!result.startsWith('.'))
|
if (!result.startsWith('.'))
|
||||||
result.prepend('.');
|
result.prepend('.');
|
||||||
return result;
|
return result;
|
||||||
|
@@ -31,6 +31,10 @@
|
|||||||
|
|
||||||
#include <QProcessEnvironment>
|
#include <QProcessEnvironment>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QTextCodec;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core { class IDocument; }
|
namespace Core { class IDocument; }
|
||||||
namespace Utils { class FilePath; }
|
namespace Utils { class FilePath; }
|
||||||
|
|
||||||
|
@@ -47,6 +47,8 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
|
|
||||||
|
#include <utils/porting.h>
|
||||||
|
|
||||||
// Enable compilation with older header that doesn't contain this constant
|
// Enable compilation with older header that doesn't contain this constant
|
||||||
// for running on newer libraries that do support it
|
// for running on newer libraries that do support it
|
||||||
#ifndef PR_SET_PTRACER
|
#ifndef PR_SET_PTRACER
|
||||||
@@ -101,7 +103,7 @@ CrashHandlerSetup::CrashHandlerSetup(const QString &appName,
|
|||||||
return;
|
return;
|
||||||
if (!QStringList{"1", "all", "yes"}.contains(value)) {
|
if (!QStringList{"1", "all", "yes"}.contains(value)) {
|
||||||
const QString binaryName = QFileInfo(QCoreApplication::applicationFilePath()).fileName();
|
const QString binaryName = QFileInfo(QCoreApplication::applicationFilePath()).fileName();
|
||||||
if (!value.split(",", QString::SkipEmptyParts).contains(binaryName))
|
if (!value.split(",", Utils::SkipEmptyParts).contains(binaryName))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user