forked from qt-creator/qt-creator
Remove dead code "< QT_VERSION_CHECK(5, 14, 0)"
Qt Creator required Qt 5.14 or higher. Let's removed the #idef-ed code for building against lower Qt versions. Add a comment in porting.h where we still need such code for sdktool. Change-Id: Ib330275208eec4a2f285b4b9f480530c171f538a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -151,11 +151,7 @@ namespace ADS {
|
|||||||
return QLabel::minimumSizeHint();
|
return QLabel::minimumSizeHint();
|
||||||
|
|
||||||
const QFontMetrics &fm = fontMetrics();
|
const QFontMetrics &fm = fontMetrics();
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
|
||||||
QSize size(fm.horizontalAdvance(d->m_text.left(2) + "…"), fm.height());
|
QSize size(fm.horizontalAdvance(d->m_text.left(2) + "…"), fm.height());
|
||||||
#else
|
|
||||||
QSize size(fm.width(d->m_text.left(2) + "…"), fm.height());
|
|
||||||
#endif
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,11 +161,7 @@ namespace ADS {
|
|||||||
return QLabel::sizeHint();
|
return QLabel::sizeHint();
|
||||||
|
|
||||||
const QFontMetrics &fm = fontMetrics();
|
const QFontMetrics &fm = fontMetrics();
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
|
||||||
QSize size(fm.horizontalAdvance(d->m_text), QLabel::sizeHint().height());
|
QSize size(fm.horizontalAdvance(d->m_text), QLabel::sizeHint().height());
|
||||||
#else
|
|
||||||
QSize size(fm.width(d->m_text), QLabel::sizeHint().height());
|
|
||||||
#endif
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -878,13 +878,8 @@ bool FloatingDockContainer::event(QEvent *event)
|
|||||||
// is clicked.
|
// is clicked.
|
||||||
// It is really great to work around the whole NonClientMouseArea
|
// It is really great to work around the whole NonClientMouseArea
|
||||||
// bugs
|
// bugs
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 2))
|
|
||||||
if (event->type() == QEvent::NonClientAreaMouseButtonPress
|
if (event->type() == QEvent::NonClientAreaMouseButtonPress
|
||||||
/*&& QGuiApplication::mouseButtons().testFlag(Qt::LeftButton)*/)
|
/*&& QGuiApplication::mouseButtons().testFlag(Qt::LeftButton)*/)
|
||||||
#else
|
|
||||||
if (event->type() == QEvent::NonClientAreaMouseButtonPress
|
|
||||||
&& QGuiApplication::mouseButtons().testFlag(Qt::LeftButton))
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
qCInfo(adsLog) << Q_FUNC_INFO << "QEvent::NonClientAreaMouseButtonPress"
|
qCInfo(adsLog) << Q_FUNC_INFO << "QEvent::NonClientAreaMouseButtonPress"
|
||||||
<< event->type();
|
<< event->type();
|
||||||
|
@@ -64,11 +64,7 @@ bool GeometryUtilities::intersect(const QPolygonF &polygon, const QLineF &line,
|
|||||||
for (int i = 0; i <= polygon.size() - 2; ++i) {
|
for (int i = 0; i <= polygon.size() - 2; ++i) {
|
||||||
QLineF polygonLine(polygon.at(i), polygon.at(i+1));
|
QLineF polygonLine(polygon.at(i), polygon.at(i+1));
|
||||||
QPointF point;
|
QPointF point;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
QLineF::IntersectType intersectionType = polygonLine.intersect(line, &point);
|
|
||||||
#else
|
|
||||||
QLineF::IntersectType intersectionType = polygonLine.intersects(line, &point);
|
QLineF::IntersectType intersectionType = polygonLine.intersects(line, &point);
|
||||||
#endif
|
|
||||||
if (intersectionType == QLineF::BoundedIntersection) {
|
if (intersectionType == QLineF::BoundedIntersection) {
|
||||||
qreal dist = QLineF(point, nearestPoint <= 0 ? line.p1() : line.p2()).length();
|
qreal dist = QLineF(point, nearestPoint <= 0 ? line.p1() : line.p2()).length();
|
||||||
if (!found || dist < mindist) {
|
if (!found || dist < mindist) {
|
||||||
@@ -102,11 +98,7 @@ bool GeometryUtilities::intersect(const QList<QPolygonF> &polygons, const QLineF
|
|||||||
for (int i = 0; i <= polygon.size() - 2; ++i) {
|
for (int i = 0; i <= polygon.size() - 2; ++i) {
|
||||||
const QLineF polygonLine(polygon.at(i), polygon.at(i + 1));
|
const QLineF polygonLine(polygon.at(i), polygon.at(i + 1));
|
||||||
QPointF point;
|
QPointF point;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
QLineF::IntersectType intersectionType = polygonLine.intersect(line, &point);
|
|
||||||
#else
|
|
||||||
QLineF::IntersectType intersectionType = polygonLine.intersects(line, &point);
|
QLineF::IntersectType intersectionType = polygonLine.intersects(line, &point);
|
||||||
#endif
|
|
||||||
if (intersectionType == QLineF::BoundedIntersection) {
|
if (intersectionType == QLineF::BoundedIntersection) {
|
||||||
qreal dist = QLineF(point, nearestPoint <= 0 ? line.p1() : line.p2()).length();
|
qreal dist = QLineF(point, nearestPoint <= 0 ? line.p1() : line.p2()).length();
|
||||||
if (!found || dist < mindist) {
|
if (!found || dist < mindist) {
|
||||||
|
@@ -352,13 +352,8 @@ void PropertiesView::MView::visitMElement(const MElement *element)
|
|||||||
m_stereotypeComboBox->addItems(m_propertiesView->stereotypeController()->knownStereotypes(m_stereotypeElement));
|
m_stereotypeComboBox->addItems(m_propertiesView->stereotypeController()->knownStereotypes(m_stereotypeElement));
|
||||||
connect(m_stereotypeComboBox->lineEdit(), &QLineEdit::textEdited,
|
connect(m_stereotypeComboBox->lineEdit(), &QLineEdit::textEdited,
|
||||||
this, &PropertiesView::MView::onStereotypesChanged);
|
this, &PropertiesView::MView::onStereotypesChanged);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
connect(m_stereotypeComboBox, QOverload<const QString &>::of(&QComboBox::activated),
|
|
||||||
this, &PropertiesView::MView::onStereotypesChanged);
|
|
||||||
#else
|
|
||||||
connect(m_stereotypeComboBox, &QComboBox::textActivated,
|
connect(m_stereotypeComboBox, &QComboBox::textActivated,
|
||||||
this, &PropertiesView::MView::onStereotypesChanged);
|
this, &PropertiesView::MView::onStereotypesChanged);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (!m_stereotypeComboBox->hasFocus()) {
|
if (!m_stereotypeComboBox->hasFocus()) {
|
||||||
QList<QString> stereotypeList;
|
QList<QString> stereotypeList;
|
||||||
|
@@ -209,13 +209,8 @@ void TimelineRenderer::wheelEvent(QWheelEvent *event)
|
|||||||
|
|
||||||
int degrees = (event->angleDelta().x() + event->angleDelta().y()) / 8;
|
int degrees = (event->angleDelta().x() + event->angleDelta().y()) / 8;
|
||||||
const qint64 circle = 360;
|
const qint64 circle = 360;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
qint64 mouseTime = event->pos().x() * zoom->windowDuration() / width() +
|
|
||||||
zoom->windowStart();
|
|
||||||
#else
|
|
||||||
qint64 mouseTime = event->position().toPoint().x() * zoom->windowDuration() / width() +
|
qint64 mouseTime = event->position().toPoint().x() * zoom->windowDuration() / width() +
|
||||||
zoom->windowStart();
|
zoom->windowStart();
|
||||||
#endif
|
|
||||||
qint64 beforeMouse = (mouseTime - zoom->rangeStart()) * (circle - degrees) / circle;
|
qint64 beforeMouse = (mouseTime - zoom->rangeStart()) * (circle - degrees) / circle;
|
||||||
qint64 afterMouse = (zoom->rangeEnd() - mouseTime) * (circle - degrees) / circle;
|
qint64 afterMouse = (zoom->rangeEnd() - mouseTime) * (circle - degrees) / circle;
|
||||||
|
|
||||||
|
@@ -1283,37 +1283,21 @@ OutputIterator set_union(InputIterator1 first1,
|
|||||||
template <class T>
|
template <class T>
|
||||||
QSet<T> toSet(const QList<T> &list)
|
QSet<T> toSet(const QList<T> &list)
|
||||||
{
|
{
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
|
||||||
return list.toSet();
|
|
||||||
#else
|
|
||||||
return QSet<T>(list.begin(), list.end());
|
return QSet<T>(list.begin(), list.end());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
template<class T>
|
template<class T>
|
||||||
QSet<T> toSet(const QVector<T> &vec)
|
QSet<T> toSet(const QVector<T> &vec)
|
||||||
{
|
{
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
|
||||||
QSet<T> result;
|
|
||||||
for (const T &p : vec) {
|
|
||||||
result.insert(p);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
#else
|
|
||||||
return QSet<T>(vec.begin(), vec.end());
|
return QSet<T>(vec.begin(), vec.end());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
QList<T> toList(const QSet<T> &set)
|
QList<T> toList(const QSet<T> &set)
|
||||||
{
|
{
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
|
||||||
return set.toList();
|
|
||||||
#else
|
|
||||||
return QList<T>(set.begin(), set.end());
|
return QList<T>(set.begin(), set.end());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Key, class T>
|
template <class Key, class T>
|
||||||
|
@@ -35,6 +35,7 @@
|
|||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
|
// Keep the support code for lower Qt versions for sdktool
|
||||||
constexpr QString::SplitBehavior SkipEmptyParts = QString::SkipEmptyParts;
|
constexpr QString::SplitBehavior SkipEmptyParts = QString::SkipEmptyParts;
|
||||||
#else
|
#else
|
||||||
constexpr Qt::SplitBehaviorFlags SkipEmptyParts = Qt::SkipEmptyParts;
|
constexpr Qt::SplitBehaviorFlags SkipEmptyParts = Qt::SkipEmptyParts;
|
||||||
|
@@ -94,9 +94,6 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q)
|
|||||||
tr("Show keyboard shortcuts in context menus (default: %1)")
|
tr("Show keyboard shortcuts in context menus (default: %1)")
|
||||||
.arg(q->m_defaultShowShortcutsInContextMenu ? tr("on") : tr("off")));
|
.arg(q->m_defaultShowShortcutsInContextMenu ? tr("on") : tr("off")));
|
||||||
m_ui.showShortcutsInContextMenus->setChecked(GeneralSettings::showShortcutsInContextMenu());
|
m_ui.showShortcutsInContextMenus->setChecked(GeneralSettings::showShortcutsInContextMenu());
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 13, 0))
|
|
||||||
m_ui.showShortcutsInContextMenus->setVisible(false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (Utils::HostOsInfo::isMacHost()) {
|
if (Utils::HostOsInfo::isMacHost()) {
|
||||||
m_ui.dpiCheckbox->setVisible(false);
|
m_ui.dpiCheckbox->setVisible(false);
|
||||||
@@ -250,9 +247,7 @@ void GeneralSettings::setShowShortcutsInContextMenu(bool show)
|
|||||||
ICore::settings()->setValueWithDefault(settingsKeyShortcutsInContextMenu,
|
ICore::settings()->setValueWithDefault(settingsKeyShortcutsInContextMenu,
|
||||||
show,
|
show,
|
||||||
m_defaultShowShortcutsInContextMenu);
|
m_defaultShowShortcutsInContextMenu);
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
|
|
||||||
QGuiApplication::styleHints()->setShowShortcutsInContextMenus(show);
|
QGuiApplication::styleHints()->setShowShortcutsInContextMenus(show);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralSettings::GeneralSettings()
|
GeneralSettings::GeneralSettings()
|
||||||
|
@@ -36,20 +36,6 @@
|
|||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
|
||||||
namespace std {
|
|
||||||
template<> struct hash<QString>
|
|
||||||
{
|
|
||||||
using argument_type = QString;
|
|
||||||
using result_type = size_t;
|
|
||||||
result_type operator()(const argument_type &v) const
|
|
||||||
{
|
|
||||||
return hash<string>()(v.toStdString());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} // namespace std
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using ExtensionMap = std::unordered_map<QString, Core::JsExpander::ObjectFactory>;
|
using ExtensionMap = std::unordered_map<QString, Core::JsExpander::ObjectFactory>;
|
||||||
Q_GLOBAL_STATIC(ExtensionMap, globalJsExtensions);
|
Q_GLOBAL_STATIC(ExtensionMap, globalJsExtensions);
|
||||||
|
|
||||||
|
@@ -33,10 +33,8 @@
|
|||||||
|
|
||||||
#ifdef QTC_WEBENGINE_HELPVIEWER
|
#ifdef QTC_WEBENGINE_HELPVIEWER
|
||||||
#include "webenginehelpviewer.h"
|
#include "webenginehelpviewer.h"
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
|
||||||
#include <QWebEngineUrlScheme>
|
#include <QWebEngineUrlScheme>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#ifdef QTC_LITEHTML_HELPVIEWER
|
#ifdef QTC_LITEHTML_HELPVIEWER
|
||||||
#include "litehtmlhelpviewer.h"
|
#include "litehtmlhelpviewer.h"
|
||||||
#endif
|
#endif
|
||||||
|
@@ -152,11 +152,7 @@ WebEngineHelpViewer::WebEngineHelpViewer(QWidget *parent) :
|
|||||||
QTC_ASSERT(viewProfile, return);
|
QTC_ASSERT(viewProfile, return);
|
||||||
if (!viewProfile->urlSchemeHandler("qthelp"))
|
if (!viewProfile->urlSchemeHandler("qthelp"))
|
||||||
viewProfile->installUrlSchemeHandler("qthelp", helpUrlSchemeHandler());
|
viewProfile->installUrlSchemeHandler("qthelp", helpUrlSchemeHandler());
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
|
|
||||||
viewProfile->setUrlRequestInterceptor(helpurlRequestInterceptor());
|
viewProfile->setUrlRequestInterceptor(helpurlRequestInterceptor());
|
||||||
#else
|
|
||||||
viewProfile->setRequestInterceptor(helpurlRequestInterceptor());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebEngineHelpViewer::setViewerFont(const QFont &font)
|
void WebEngineHelpViewer::setViewerFont(const QFont &font)
|
||||||
|
@@ -72,11 +72,7 @@ void EditorDiagramView::wheelEvent(QWheelEvent *wheelEvent)
|
|||||||
{
|
{
|
||||||
if (wheelEvent->modifiers() == Qt::ControlModifier) {
|
if (wheelEvent->modifiers() == Qt::ControlModifier) {
|
||||||
int degree = wheelEvent->angleDelta().y() / 8;
|
int degree = wheelEvent->angleDelta().y() / 8;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
QPoint zoomOrigin = wheelEvent->pos();
|
|
||||||
#else
|
|
||||||
QPoint zoomOrigin = wheelEvent->position().toPoint();
|
QPoint zoomOrigin = wheelEvent->position().toPoint();
|
||||||
#endif
|
|
||||||
if (degree > 0)
|
if (degree > 0)
|
||||||
emit zoomIn(zoomOrigin);
|
emit zoomIn(zoomOrigin);
|
||||||
else if (degree < 0)
|
else if (degree < 0)
|
||||||
|
@@ -192,11 +192,7 @@ bool BuildStepList::removeStep(int position)
|
|||||||
|
|
||||||
void BuildStepList::moveStepUp(int position)
|
void BuildStepList::moveStepUp(int position)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
|
||||||
m_steps.swapItemsAt(position - 1, position);
|
m_steps.swapItemsAt(position - 1, position);
|
||||||
#else
|
|
||||||
m_steps.swap(position - 1, position);
|
|
||||||
#endif
|
|
||||||
emit stepMoved(position, position - 1);
|
emit stepMoved(position, position - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -91,11 +91,7 @@ QWidget *ChangeStyleWidgetAction::createWidget(QWidget *parent)
|
|||||||
});
|
});
|
||||||
|
|
||||||
connect(comboBox,
|
connect(comboBox,
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
QOverload<const QString &>::of(&QComboBox::activated),
|
|
||||||
#else
|
|
||||||
&QComboBox::textActivated,
|
&QComboBox::textActivated,
|
||||||
#endif
|
|
||||||
this,
|
this,
|
||||||
[this](const QString &style) {
|
[this](const QString &style) {
|
||||||
|
|
||||||
|
@@ -167,12 +167,7 @@ QString GradientPresetItem::getNameByPreset(Preset value)
|
|||||||
|
|
||||||
QGradient GradientPresetItem::createGradientFromPreset(Preset value)
|
QGradient GradientPresetItem::createGradientFromPreset(Preset value)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
|
||||||
return QGradient(value);
|
return QGradient(value);
|
||||||
#else
|
|
||||||
Q_UNUSED(value)
|
|
||||||
return {};
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QDebug &operator<<(QDebug &stream, const GradientPresetItem &gradient)
|
QDebug &operator<<(QDebug &stream, const GradientPresetItem &gradient)
|
||||||
|
@@ -39,17 +39,8 @@ class GradientPresetItem
|
|||||||
Q_PROPERTY(int presetID READ presetID FINAL)
|
Q_PROPERTY(int presetID READ presetID FINAL)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
|
||||||
using Preset = QGradient::Preset;
|
using Preset = QGradient::Preset;
|
||||||
#else
|
|
||||||
enum Preset {};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
static const int numPresets = Preset::NumPresets;
|
static const int numPresets = Preset::NumPresets;
|
||||||
#else
|
|
||||||
static const int numPresets = 181;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
explicit GradientPresetItem();
|
explicit GradientPresetItem();
|
||||||
explicit GradientPresetItem(const QGradient &value, const QString &name = QString());
|
explicit GradientPresetItem(const QGradient &value, const QString &name = QString());
|
||||||
|
@@ -579,11 +579,7 @@ void RichTextEditor::setupTableActions()
|
|||||||
tableFormat.setCellSpacing(2.0);
|
tableFormat.setCellSpacing(2.0);
|
||||||
tableFormat.setCellPadding(2.0);
|
tableFormat.setCellPadding(2.0);
|
||||||
tableFormat.setBorder(1.0);
|
tableFormat.setBorder(1.0);
|
||||||
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
|
||||||
tableFormat.setBorderCollapse(true);
|
tableFormat.setBorderCollapse(true);
|
||||||
#endif
|
|
||||||
|
|
||||||
cursor.insertTable(1, 1, tableFormat);
|
cursor.insertTable(1, 1, tableFormat);
|
||||||
|
|
||||||
//move cursor into the first cell of the table:
|
//move cursor into the first cell of the table:
|
||||||
|
@@ -56,9 +56,7 @@ FloatControl::FloatControl()
|
|||||||
setValue(0.0);
|
setValue(0.0);
|
||||||
setButtonSymbols(QAbstractSpinBox::NoButtons);
|
setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||||
setFrame(false);
|
setFrame(false);
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
|
||||||
setStepType(QAbstractSpinBox::AdaptiveDecimalStepType);
|
setStepType(QAbstractSpinBox::AdaptiveDecimalStepType);
|
||||||
#endif
|
|
||||||
|
|
||||||
setMinimum(std::numeric_limits<float>::lowest());
|
setMinimum(std::numeric_limits<float>::lowest());
|
||||||
setMaximum(std::numeric_limits<float>::max());
|
setMaximum(std::numeric_limits<float>::max());
|
||||||
|
@@ -186,22 +186,12 @@ void DesignerMcuManager::readVersionData(const DesignerMcuManager::Version &vers
|
|||||||
//handling banned properties:
|
//handling banned properties:
|
||||||
const QStringList bannedProperties = readPropertyList("bannedProperties", child);
|
const QStringList bannedProperties = readPropertyList("bannedProperties", child);
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
m_bannedProperties.unite(QSet<QString>(bannedProperties.begin(), bannedProperties.end()));
|
m_bannedProperties.unite(QSet<QString>(bannedProperties.begin(), bannedProperties.end()));
|
||||||
#elif
|
|
||||||
m_bannedProperties.unite(QSet<QString>::fromList(bannedProperties));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<QString> bannedItems = readPropertyList("bannedItems", versionData);
|
const QList<QString> bannedItems = readPropertyList("bannedItems", versionData);
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
m_bannedItems = QSet<QString>(bannedItems.begin(), bannedItems.end());
|
||||||
m_bannedItems = QSet<QString>(bannedItems.begin(), bannedItems.end());
|
|
||||||
#elif
|
|
||||||
m_bannedItems = QSet<QString>::fromList(bannedItems);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_allowedImports = readPropertyList("allowedImports", versionData);
|
m_allowedImports = readPropertyList("allowedImports", versionData);
|
||||||
m_bannedImports = readPropertyList("bannedImports", versionData);
|
m_bannedImports = readPropertyList("bannedImports", versionData);
|
||||||
m_currentVersion = version;
|
m_currentVersion = version;
|
||||||
|
@@ -76,13 +76,7 @@ void DesignerSettings::fromSettings(QSettings *settings)
|
|||||||
restoreValue(settings, DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS, true);
|
restoreValue(settings, DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS, true);
|
||||||
restoreValue(settings, DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER, false);
|
restoreValue(settings, DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER, false);
|
||||||
restoreValue(settings, DesignerSettingsKey::STANDALONE_MODE, false);
|
restoreValue(settings, DesignerSettingsKey::STANDALONE_MODE, false);
|
||||||
restoreValue(settings, DesignerSettingsKey::ENABLE_TIMELINEVIEW,
|
restoreValue(settings, DesignerSettingsKey::ENABLE_TIMELINEVIEW, true);
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
|
||||||
false
|
|
||||||
#else
|
|
||||||
true
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
restoreValue(settings, DesignerSettingsKey::SIMPLE_COLOR_PALETTE_CONTENT, QStringList());
|
restoreValue(settings, DesignerSettingsKey::SIMPLE_COLOR_PALETTE_CONTENT, QStringList());
|
||||||
restoreValue(settings, DesignerSettingsKey::ALWAYS_DESIGN_MODE, true);
|
restoreValue(settings, DesignerSettingsKey::ALWAYS_DESIGN_MODE, true);
|
||||||
restoreValue(settings, DesignerSettingsKey::DISABLE_ITEM_LIBRARY_UPDATE_TIMER, true);
|
restoreValue(settings, DesignerSettingsKey::DISABLE_ITEM_LIBRARY_UPDATE_TIMER, true);
|
||||||
|
@@ -80,11 +80,7 @@ void NavigatorGraphicsView::wheelEvent(QWheelEvent *event)
|
|||||||
else
|
else
|
||||||
emit zoomOut();
|
emit zoomOut();
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
emit moveMainViewTo(mapToScene(event->pos()));
|
|
||||||
#else
|
|
||||||
emit moveMainViewTo(mapToScene(event->position().toPoint()));
|
emit moveMainViewTo(mapToScene(event->position().toPoint()));
|
||||||
#endif
|
|
||||||
} else
|
} else
|
||||||
QGraphicsView::wheelEvent(event);
|
QGraphicsView::wheelEvent(event);
|
||||||
}
|
}
|
||||||
|
@@ -225,11 +225,7 @@ void layout(const QList<QGraphicsItem*> &items)
|
|||||||
firstItem = initialItem->outputTransitions().constFirst()->connectedItem(initialItem);
|
firstItem = initialItem->outputTransitions().constFirst()->connectedItem(initialItem);
|
||||||
int index = childItems.indexOf(firstItem);
|
int index = childItems.indexOf(firstItem);
|
||||||
if (index > 0)
|
if (index > 0)
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
|
||||||
childItems.swap(index, 0);
|
|
||||||
#else
|
|
||||||
childItems.swapItemsAt(index, 0);
|
childItems.swapItemsAt(index, 0);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search final-item
|
// Search final-item
|
||||||
|
@@ -306,19 +306,11 @@ void TransitionItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
QPointF intersPoint;
|
QPointF intersPoint;
|
||||||
QLineF line2(p, p + QPointF(SELECTION_DISTANCE, SELECTION_DISTANCE));
|
QLineF line2(p, p + QPointF(SELECTION_DISTANCE, SELECTION_DISTANCE));
|
||||||
line2.setAngle(line.angle() + 90);
|
line2.setAngle(line.angle() + 90);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection) {
|
||||||
if (line.intersect(line2, &intersPoint) == QLineF::BoundedIntersection)
|
|
||||||
#else
|
|
||||||
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection)
|
|
||||||
#endif
|
|
||||||
sel = true;
|
sel = true;
|
||||||
else {
|
} else {
|
||||||
line2.setAngle(line.angle() - 90);
|
line2.setAngle(line.angle() - 90);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
sel = line.intersect(line2, &intersPoint) == QLineF::BoundedIntersection;
|
|
||||||
#else
|
|
||||||
sel = line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection;
|
sel = line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sel)
|
if (sel)
|
||||||
@@ -805,11 +797,7 @@ QPointF TransitionItem::findIntersectionPoint(ConnectableItem *item, const QLine
|
|||||||
for (int i = 1; i < itemPolygon.count(); ++i) {
|
for (int i = 1; i < itemPolygon.count(); ++i) {
|
||||||
p2 = itemPolygon.at(i) + item->scenePos();
|
p2 = itemPolygon.at(i) + item->scenePos();
|
||||||
checkLine = QLineF(p1, p2);
|
checkLine = QLineF(p1, p2);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
if (checkLine.intersect(line, &intersectPoint) == QLineF::BoundedIntersection)
|
|
||||||
#else
|
|
||||||
if (checkLine.intersects(line, &intersectPoint) == QLineF::BoundedIntersection)
|
if (checkLine.intersects(line, &intersectPoint) == QLineF::BoundedIntersection)
|
||||||
#endif
|
|
||||||
return intersectPoint;
|
return intersectPoint;
|
||||||
p1 = p2;
|
p1 = p2;
|
||||||
}
|
}
|
||||||
@@ -1096,19 +1084,11 @@ bool TransitionItem::containsScenePoint(const QPointF &p) const
|
|||||||
QPointF intersPoint;
|
QPointF intersPoint;
|
||||||
QLineF line2(pp, pp + QPointF(SELECTION_DISTANCE, SELECTION_DISTANCE));
|
QLineF line2(pp, pp + QPointF(SELECTION_DISTANCE, SELECTION_DISTANCE));
|
||||||
line2.setAngle(line.angle() + 90);
|
line2.setAngle(line.angle() + 90);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
if (line.intersect(line2, &intersPoint) == QLineF::BoundedIntersection) {
|
|
||||||
#else
|
|
||||||
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection) {
|
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection) {
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
line2.setAngle(line.angle() - 90);
|
line2.setAngle(line.angle() - 90);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
if (line.intersect(line2, &intersPoint) == QLineF::BoundedIntersection)
|
|
||||||
#else
|
|
||||||
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection)
|
if (line.intersects(line2, &intersPoint) == QLineF::BoundedIntersection)
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1214,11 +1214,7 @@ void TextEditorWidgetPrivate::print(QPrinter *printer)
|
|||||||
QAbstractTextDocumentLayout *layout = doc->documentLayout();
|
QAbstractTextDocumentLayout *layout = doc->documentLayout();
|
||||||
layout->setPaintDevice(p.device());
|
layout->setPaintDevice(p.device());
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
int dpiy = p.device()->logicalDpiY();
|
|
||||||
#else
|
|
||||||
int dpiy = qRound(QGuiApplication::primaryScreen()->logicalDotsPerInchY());
|
int dpiy = qRound(QGuiApplication::primaryScreen()->logicalDotsPerInchY());
|
||||||
#endif
|
|
||||||
int margin = int((2/2.54)*dpiy); // 2 cm margins
|
int margin = int((2/2.54)*dpiy); // 2 cm margins
|
||||||
|
|
||||||
QTextFrameFormat fmt = doc->rootFrame()->frameFormat();
|
QTextFrameFormat fmt = doc->rootFrame()->frameFormat();
|
||||||
|
@@ -4709,7 +4709,6 @@ void tst_TestCore::testImplicitComponents()
|
|||||||
|
|
||||||
void tst_TestCore::testRevisionedProperties()
|
void tst_TestCore::testRevisionedProperties()
|
||||||
{
|
{
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
|
||||||
const char* qmlString
|
const char* qmlString
|
||||||
= "import QtQuick 2.12\n"
|
= "import QtQuick 2.12\n"
|
||||||
"import QtQuick.Controls 2.0\n"
|
"import QtQuick.Controls 2.0\n"
|
||||||
@@ -4761,8 +4760,6 @@ void tst_TestCore::testRevisionedProperties()
|
|||||||
|
|
||||||
QVERIFY(metaInfo12.hasProperty("orientation"));
|
QVERIFY(metaInfo12.hasProperty("orientation"));
|
||||||
QVERIFY(metaInfoU.hasProperty("orientation"));
|
QVERIFY(metaInfoU.hasProperty("orientation"));
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_TestCore::testStatesRewriter()
|
void tst_TestCore::testStatesRewriter()
|
||||||
|
Reference in New Issue
Block a user