mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-20 11:09:58 +01:00
Remove several QT_VERSION_CHECK
Remove several QT_VERSION_CHECK related to Qt5 and Qt4.
This commit is contained in:
@@ -765,14 +765,8 @@ void ElementsCollectionWidget::search()
|
|||||||
}
|
}
|
||||||
|
|
||||||
hideCollection(true);
|
hideCollection(true);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
|
||||||
const QStringList text_list = text.split("+", QString::SkipEmptyParts);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
const QStringList text_list = text.split("+", Qt::SkipEmptyParts);
|
const QStringList text_list = text.split("+", Qt::SkipEmptyParts);
|
||||||
#endif
|
|
||||||
QModelIndexList match_index;
|
QModelIndexList match_index;
|
||||||
for (QString txt : text_list) {
|
for (QString txt : text_list) {
|
||||||
match_index << m_model->match(m_showed_index.isValid()
|
match_index << m_model->match(m_showed_index.isValid()
|
||||||
|
|||||||
@@ -82,11 +82,7 @@ void ElementsTreeView::startElementDrag(const ElementsLocation &location)
|
|||||||
{
|
{
|
||||||
if (! location.exist()) return;
|
if (! location.exist()) return;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
auto drag = new QDrag{this};
|
||||||
QDrag* drag = new QDrag(this);
|
|
||||||
#else
|
|
||||||
QScopedPointer<QDrag> drag(new QDrag(this));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QString location_str = location.toString();
|
QString location_str = location.toString();
|
||||||
QMimeData *mime_data = new QMimeData();
|
QMimeData *mime_data = new QMimeData();
|
||||||
|
|||||||
@@ -130,12 +130,7 @@ bool PhysicalTerminal::setLevelOf(const QSharedPointer<RealTerminal> &terminal,
|
|||||||
const int i = m_real_terminal.indexOf(terminal);
|
const int i = m_real_terminal.indexOf(terminal);
|
||||||
if (i >= 0)
|
if (i >= 0)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
|
|
||||||
m_real_terminal.swapItemsAt(i, std::min(static_cast<qsizetype>(level), m_real_terminal.size()-1));
|
m_real_terminal.swapItemsAt(i, std::min(static_cast<qsizetype>(level), m_real_terminal.size()-1));
|
||||||
#else
|
|
||||||
auto j = std::min(level, m_real_terminal.size()-1);
|
|
||||||
std::swap(m_real_terminal.begin()[i], m_real_terminal.begin()[j]);
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -64,11 +64,8 @@ bool TerminalStripData::fromXml(const QDomElement &xml_element)
|
|||||||
"due to wrong tag name. Expected " << this->xmlTagName() << " used " << xml_element.tagName();
|
"due to wrong tag name. Expected " << this->xmlTagName() << " used " << xml_element.tagName();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
|
||||||
m_uuid = QUuid::fromString(xml_element.attribute(QStringLiteral("uuid")));
|
m_uuid = QUuid::fromString(xml_element.attribute(QStringLiteral("uuid")));
|
||||||
#else
|
|
||||||
m_uuid = QUuid(xml_element.attribute(QStringLiteral("uuid")));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (auto &xml_info :
|
for (auto &xml_info :
|
||||||
QETXML::findInDomElement(xml_element.firstChildElement(QStringLiteral("informations")),
|
QETXML::findInDomElement(xml_element.firstChildElement(QStringLiteral("informations")),
|
||||||
|
|||||||
@@ -35,11 +35,7 @@ TerminalStripTreeDockWidget::TerminalStripTreeDockWidget(QETProject *project, QW
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setProject(project);
|
setProject(project);
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
|
||||||
ui->m_tree_view->expandRecursively(ui->m_tree_view->rootIndex());
|
ui->m_tree_view->expandRecursively(ui->m_tree_view->rootIndex());
|
||||||
#else
|
|
||||||
ui->m_tree_view->expandAll();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TerminalStripTreeDockWidget::~TerminalStripTreeDockWidget()
|
TerminalStripTreeDockWidget::~TerminalStripTreeDockWidget()
|
||||||
@@ -93,11 +89,7 @@ void TerminalStripTreeDockWidget::reload()
|
|||||||
|
|
||||||
buildTree();
|
buildTree();
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
|
||||||
ui->m_tree_view->expandRecursively(ui->m_tree_view->rootIndex());
|
ui->m_tree_view->expandRecursively(ui->m_tree_view->rootIndex());
|
||||||
#else
|
|
||||||
ui->m_tree_view->expandAll();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//Reselect the tree widget item of the current edited strip
|
//Reselect the tree widget item of the current edited strip
|
||||||
auto item = m_item_strip_H.key(current_);
|
auto item = m_item_strip_H.key(current_);
|
||||||
|
|||||||
@@ -55,11 +55,7 @@ BorderTitleBlock::BorderTitleBlock(QObject *parent) :
|
|||||||
m_titleblock_template_renderer = new TitleBlockTemplateRenderer(this);
|
m_titleblock_template_renderer = new TitleBlockTemplateRenderer(this);
|
||||||
m_titleblock_template_renderer -> setTitleBlockTemplate(QETApp::defaultTitleBlockTemplate());
|
m_titleblock_template_renderer -> setTitleBlockTemplate(QETApp::defaultTitleBlockTemplate());
|
||||||
|
|
||||||
// disable the QPicture-based cache from Qt 4.8 to avoid rendering errors and crashes
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(4, 8, 0) // ### Qt 6: remove
|
|
||||||
#else
|
|
||||||
m_titleblock_template_renderer -> setUseCache(false);
|
m_titleblock_template_renderer -> setUseCache(false);
|
||||||
#endif
|
|
||||||
|
|
||||||
// dimensions par defaut du schema
|
// dimensions par defaut du schema
|
||||||
importBorder(BorderProperties());
|
importBorder(BorderProperties());
|
||||||
|
|||||||
@@ -72,14 +72,7 @@ bool ConductorNumExport::toCsv()
|
|||||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
|
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||||
{
|
{
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove
|
|
||||||
stream << wiresNum() << endl;
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.15 or later")
|
|
||||||
#endif
|
|
||||||
stream << wiresNum() << &Qt::endl(stream);
|
stream << wiresNum() << &Qt::endl(stream);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -811,14 +811,7 @@ void ConductorProperties::readStyle(const QString &style_string) {
|
|||||||
if (style_string.isEmpty()) return;
|
if (style_string.isEmpty()) return;
|
||||||
|
|
||||||
// recupere la liste des couples style / valeur
|
// recupere la liste des couples style / valeur
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
|
||||||
QStringList styles = style_string.split(";", QString::SkipEmptyParts);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code QString::SkipEmptyParts for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
QStringList styles = style_string.split(";", Qt::SkipEmptyParts);
|
QStringList styles = style_string.split(";", Qt::SkipEmptyParts);
|
||||||
#endif
|
|
||||||
|
|
||||||
QRegularExpression Rx("^(?<name>[a-z-]+): (?<value>[a-z-]+)$");
|
QRegularExpression Rx("^(?<name>[a-z-]+): (?<value>[a-z-]+)$");
|
||||||
if (!Rx.isValid())
|
if (!Rx.isValid())
|
||||||
|
|||||||
@@ -47,14 +47,8 @@ ElementQueryWidget::ElementQueryWidget(QWidget *parent) :
|
|||||||
m_button_group.addButton(ui->m_coil_cb, 4);
|
m_button_group.addButton(ui->m_coil_cb, 4);
|
||||||
m_button_group.addButton(ui->m_protection_cb, 5);
|
m_button_group.addButton(ui->m_protection_cb, 5);
|
||||||
m_button_group.addButton(ui->m_thumbnail_cb, 6);
|
m_button_group.addButton(ui->m_thumbnail_cb, 6);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove
|
|
||||||
connect(&m_button_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), [this](int id)
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.15 or later")
|
|
||||||
#endif
|
|
||||||
connect(&m_button_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::idClicked), [this](int id)
|
connect(&m_button_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::idClicked), [this](int id)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
auto check_box = static_cast<QCheckBox *>(m_button_group.button(0));
|
auto check_box = static_cast<QCheckBox *>(m_button_group.button(0));
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
|
|||||||
@@ -1514,14 +1514,6 @@ bool Diagram::fromXml(QDomElement &document,
|
|||||||
if (content_ptr) {
|
if (content_ptr) {
|
||||||
content_ptr -> m_elements = added_elements;
|
content_ptr -> m_elements = added_elements;
|
||||||
content_ptr -> m_conductors_to_move = added_conductors;
|
content_ptr -> m_conductors_to_move = added_conductors;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
|
||||||
content_ptr -> m_text_fields = added_texts.toSet();
|
|
||||||
content_ptr -> m_images = added_images.toSet();
|
|
||||||
content_ptr -> m_shapes = added_shapes.toSet();
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
content_ptr -> m_text_fields = QSet<IndependentTextItem *>(
|
content_ptr -> m_text_fields = QSet<IndependentTextItem *>(
|
||||||
added_texts.begin(),
|
added_texts.begin(),
|
||||||
added_texts.end());
|
added_texts.end());
|
||||||
@@ -1532,7 +1524,6 @@ bool Diagram::fromXml(QDomElement &document,
|
|||||||
added_shapes.begin(),
|
added_shapes.begin(),
|
||||||
added_shapes.end());
|
added_shapes.end());
|
||||||
content_ptr->m_terminal_strip.swap(added_strips);
|
content_ptr->m_terminal_strip.swap(added_strips);
|
||||||
#endif
|
|
||||||
content_ptr->m_tables.swap(added_tables);
|
content_ptr->m_tables.swap(added_tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,18 +203,10 @@ void DiagramView::handleElementDrop(QDropEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
diagram()->setEventInterface(
|
|
||||||
new DiagramEventAddElement(
|
|
||||||
location, diagram(), mapToScene(event->pos())));
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
diagram()->setEventInterface(
|
diagram()->setEventInterface(
|
||||||
new DiagramEventAddElement(
|
new DiagramEventAddElement(
|
||||||
location, diagram(), event->position()));
|
location, diagram(), event->position()));
|
||||||
#endif
|
|
||||||
|
|
||||||
//Set focus to the view to get event
|
//Set focus to the view to get event
|
||||||
this->setFocus();
|
this->setFocus();
|
||||||
@@ -283,17 +275,8 @@ void DiagramView::handleTextDrop(QDropEvent *e) {
|
|||||||
iti -> setHtml (e -> mimeData() -> text());
|
iti -> setHtml (e -> mimeData() -> text());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
|
|
||||||
m_diagram->undoStack().push(new AddGraphicsObjectCommand(
|
|
||||||
iti, m_diagram, mapToScene(e->pos())));
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
m_diagram->undoStack().push(new AddGraphicsObjectCommand(
|
m_diagram->undoStack().push(new AddGraphicsObjectCommand(
|
||||||
iti, m_diagram, e->position()));
|
iti, m_diagram, e->position()));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -451,14 +434,7 @@ void DiagramView::mousePressEvent(QMouseEvent *e)
|
|||||||
if (m_event_interface && m_event_interface->mousePressEvent(e)) return;
|
if (m_event_interface && m_event_interface->mousePressEvent(e)) return;
|
||||||
|
|
||||||
//Start drag view when hold the middle button
|
//Start drag view when hold the middle button
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove
|
|
||||||
if (e->button() == Qt::MidButton)
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
if (e->button() == Qt::MiddleButton)
|
if (e->button() == Qt::MiddleButton)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
m_drag_last_pos = e->pos();
|
m_drag_last_pos = e->pos();
|
||||||
viewport()->setCursor(Qt::ClosedHandCursor);
|
viewport()->setCursor(Qt::ClosedHandCursor);
|
||||||
@@ -508,14 +484,7 @@ void DiagramView::mouseMoveEvent(QMouseEvent *e)
|
|||||||
if (m_event_interface && m_event_interface->mouseMoveEvent(e)) return;
|
if (m_event_interface && m_event_interface->mouseMoveEvent(e)) return;
|
||||||
|
|
||||||
// Drag the view
|
// Drag the view
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove
|
|
||||||
if (e->buttons() == Qt::MidButton)
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
if (e->buttons() == Qt::MiddleButton)
|
if (e->buttons() == Qt::MiddleButton)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
QScrollBar *h = horizontalScrollBar();
|
QScrollBar *h = horizontalScrollBar();
|
||||||
QScrollBar *v = verticalScrollBar();
|
QScrollBar *v = verticalScrollBar();
|
||||||
@@ -576,14 +545,7 @@ void DiagramView::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
if (m_event_interface && m_event_interface->mouseReleaseEvent(e)) return;
|
if (m_event_interface && m_event_interface->mouseReleaseEvent(e)) return;
|
||||||
|
|
||||||
// Stop drag view
|
// Stop drag view
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove
|
|
||||||
if (e->button() == Qt::MidButton)
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
if (e->button() == Qt::MiddleButton)
|
if (e->button() == Qt::MiddleButton)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
viewport()->setCursor(Qt::ArrowCursor);
|
viewport()->setCursor(Qt::ArrowCursor);
|
||||||
}
|
}
|
||||||
@@ -617,14 +579,7 @@ void DiagramView::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
QMenu *menu = new QMenu(this);
|
QMenu *menu = new QMenu(this);
|
||||||
menu->addAction(act);
|
menu->addAction(act);
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
menu->popup(e->globalPos());
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
menu->popup(e->pos());
|
menu->popup(e->pos());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_free_rubberbanding = false;
|
m_free_rubberbanding = false;
|
||||||
|
|||||||
@@ -276,14 +276,7 @@ void ChangeZValueCommand::applyRaise(const QList<QGraphicsItem *> &items_list) {
|
|||||||
for (int i = my_items_list.count() - 2 ; i >= 0 ; -- i) {
|
for (int i = my_items_list.count() - 2 ; i >= 0 ; -- i) {
|
||||||
if (my_items_list[i] -> isSelected()) {
|
if (my_items_list[i] -> isSelected()) {
|
||||||
if (!my_items_list[i +1] -> isSelected()) {
|
if (!my_items_list[i +1] -> isSelected()) {
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) // ### Qt 6: remove
|
|
||||||
my_items_list.swap(i, i + 1);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.13 or later")
|
|
||||||
#endif
|
|
||||||
my_items_list.swapItemsAt(i, i + 1);
|
my_items_list.swapItemsAt(i, i + 1);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,14 +294,7 @@ void ChangeZValueCommand::applyLower(const QList<QGraphicsItem *> &items_list) {
|
|||||||
for (int i = 1 ; i < my_items_list.count() ; ++ i) {
|
for (int i = 1 ; i < my_items_list.count() ; ++ i) {
|
||||||
if (my_items_list[i] -> isSelected()) {
|
if (my_items_list[i] -> isSelected()) {
|
||||||
if (!my_items_list[i - 1] -> isSelected()) {
|
if (!my_items_list[i - 1] -> isSelected()) {
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) // ### Qt 6: remove
|
|
||||||
my_items_list.swap(i, i - 1);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.13 or later")
|
|
||||||
#endif
|
|
||||||
my_items_list.swapItemsAt(i, i - 1);
|
my_items_list.swapItemsAt(i, i - 1);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -372,14 +372,7 @@ ElementContent ElementView::pasteWithOffset(const QDomDocument &xml_document) {
|
|||||||
*/
|
*/
|
||||||
void ElementView::mousePressEvent(QMouseEvent* e)
|
void ElementView::mousePressEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove
|
|
||||||
if (e->button() == Qt::MidButton)
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
if (e->button() == Qt::MiddleButton)
|
if (e->button() == Qt::MiddleButton)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
setCursor( (Qt::ClosedHandCursor));
|
setCursor( (Qt::ClosedHandCursor));
|
||||||
reference_view_ = e->pos();
|
reference_view_ = e->pos();
|
||||||
@@ -394,14 +387,7 @@ void ElementView::mousePressEvent(QMouseEvent* e)
|
|||||||
*/
|
*/
|
||||||
void ElementView::mouseMoveEvent(QMouseEvent* e)
|
void ElementView::mouseMoveEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove
|
|
||||||
if (e->buttons() == Qt::MidButton)
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
if (e->buttons() == Qt::MiddleButton)
|
if (e->buttons() == Qt::MiddleButton)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
QScrollBar *h = horizontalScrollBar();
|
QScrollBar *h = horizontalScrollBar();
|
||||||
QScrollBar *v = verticalScrollBar();
|
QScrollBar *v = verticalScrollBar();
|
||||||
@@ -420,14 +406,7 @@ void ElementView::mouseMoveEvent(QMouseEvent* e)
|
|||||||
*/
|
*/
|
||||||
void ElementView::mouseReleaseEvent(QMouseEvent* e)
|
void ElementView::mouseReleaseEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove
|
|
||||||
if (e->button() == Qt::MidButton)
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
if (e->button() == Qt::MiddleButton)
|
if (e->button() == Qt::MiddleButton)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
setCursor(Qt::ArrowCursor);
|
setCursor(Qt::ArrowCursor);
|
||||||
adjustSceneRect();
|
adjustSceneRect();
|
||||||
|
|||||||
@@ -519,14 +519,7 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
|||||||
resetStyles();
|
resetStyles();
|
||||||
|
|
||||||
//Get the list of pair style/value
|
//Get the list of pair style/value
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
|
||||||
QStringList styles = qde.attribute("style").split(";", QString::SkipEmptyParts);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
QStringList styles = qde.attribute("style").split(";", Qt::SkipEmptyParts);
|
QStringList styles = qde.attribute("style").split(";", Qt::SkipEmptyParts);
|
||||||
#endif
|
|
||||||
|
|
||||||
//Check each pair of style
|
//Check each pair of style
|
||||||
QRegularExpression rx("^\\s*([a-z-]+)\\s*:\\s*([a-zA-Z-]+)\\s*$");
|
QRegularExpression rx("^\\s*([a-z-]+)\\s*:\\s*([a-zA-Z-]+)\\s*$");
|
||||||
|
|||||||
@@ -267,11 +267,9 @@ void ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged(int in
|
|||||||
ui->m_master_gb->setVisible(master);
|
ui->m_master_gb->setVisible(master);
|
||||||
ui->m_terminal_gb->setVisible(terminal);
|
ui->m_terminal_gb->setVisible(terminal);
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
|
|
||||||
ui->tabWidget->setTabVisible(1,
|
ui->tabWidget->setTabVisible(1,
|
||||||
(type_ == ElementData::Simple ||
|
(type_ == ElementData::Simple ||
|
||||||
type_ == ElementData::Master));
|
type_ == ElementData::Master));
|
||||||
#endif
|
|
||||||
|
|
||||||
updateTree();
|
updateTree();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -567,14 +567,7 @@ void ElementPictureFactory::setPainterStyle(const QDomElement &dom, QPainter &pa
|
|||||||
pen.setCapStyle(Qt::SquareCap);
|
pen.setCapStyle(Qt::SquareCap);
|
||||||
|
|
||||||
//Get the couples style/value
|
//Get the couples style/value
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
|
||||||
const QStringList styles = dom.attribute("style").split(";", QString::SkipEmptyParts);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
const QStringList styles = dom.attribute("style").split(";", Qt::SkipEmptyParts);
|
const QStringList styles = dom.attribute("style").split(";", Qt::SkipEmptyParts);
|
||||||
#endif
|
|
||||||
|
|
||||||
QRegularExpression rx("^(?<name>[a-z-]+):(?<value>[a-zA-Z-]+)$");
|
QRegularExpression rx("^(?<name>[a-z-]+):(?<value>[a-zA-Z-]+)$");
|
||||||
if (!rx.isValid())
|
if (!rx.isValid())
|
||||||
|
|||||||
@@ -174,24 +174,9 @@ int main(int argc, char **argv)
|
|||||||
QCoreApplication::setApplicationName("QElectroTech");
|
QCoreApplication::setApplicationName("QElectroTech");
|
||||||
//Creation and execution of the application
|
//Creation and execution of the application
|
||||||
//HighDPI
|
//HighDPI
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
qputenv("QT_ENABLE_HIGHDPI_SCALING", "1");
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 7, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFactorRoundingPolicy());
|
||||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
qputenv("QT_ENABLE_HIGHDPI_SCALING", "1");
|
|
||||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFactorRoundingPolicy());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
SingleApplication app(argc, argv, true);
|
SingleApplication app(argc, argv, true);
|
||||||
|
|||||||
@@ -183,16 +183,7 @@ bool QET::orthogonalProjection(
|
|||||||
|
|
||||||
// determine le point d'intersection des deux droites = le projete orthogonal
|
// determine le point d'intersection des deux droites = le projete orthogonal
|
||||||
QPointF intersection_point;
|
QPointF intersection_point;
|
||||||
#if TODO_LIST
|
QLineF::IntersectType it = line.intersects(perpendicular_line, &intersection_point);
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
QLineF::IntersectType it = line.
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
intersect // ### Qt 6: remove
|
|
||||||
#else
|
|
||||||
intersects
|
|
||||||
#endif
|
|
||||||
(perpendicular_line, &intersection_point);
|
|
||||||
|
|
||||||
// ne devrait pas arriver (mais bon...)
|
// ne devrait pas arriver (mais bon...)
|
||||||
if (it == QLineF::NoIntersection) return(false);
|
if (it == QLineF::NoIntersection) return(false);
|
||||||
@@ -545,16 +536,8 @@ QString QET::joinWithSpaces(const QStringList &string_list) {
|
|||||||
QStringList QET::splitWithSpaces(const QString &string) {
|
QStringList QET::splitWithSpaces(const QString &string) {
|
||||||
// les chaines sont separees par des espaces non echappes
|
// les chaines sont separees par des espaces non echappes
|
||||||
// = avec un nombre nul ou pair de backslashes devant
|
// = avec un nombre nul ou pair de backslashes devant
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
QStringList escaped_strings = string.split(QRegularExpression("[^\\]?(?:\\\\)* "),
|
QStringList escaped_strings = string.split(QRegularExpression("[^\\]?(?:\\\\)* "),
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
Qt::SkipEmptyParts);
|
||||||
QString
|
|
||||||
#else
|
|
||||||
Qt
|
|
||||||
#endif
|
|
||||||
::SkipEmptyParts);
|
|
||||||
|
|
||||||
QStringList returned_list;
|
QStringList returned_list;
|
||||||
foreach(QString escaped_string, escaped_strings) {
|
foreach(QString escaped_string, escaped_strings) {
|
||||||
@@ -684,14 +667,7 @@ bool QET::writeXmlFile(QDomDocument &xml_doc, const QString &filepath, QString *
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTextStream out(&file);
|
QTextStream out(&file);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
out.setCodec("UTF-8");
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
out.setEncoding(QStringConverter::Utf8);
|
out.setEncoding(QStringConverter::Utf8);
|
||||||
#endif
|
|
||||||
out.setGenerateByteOrderMark(false);
|
out.setGenerateByteOrderMark(false);
|
||||||
out << xml_doc.toString(4);
|
out << xml_doc.toString(4);
|
||||||
if (!file.commit())
|
if (!file.commit())
|
||||||
@@ -822,14 +798,7 @@ bool QET::writeToFile(QDomDocument &xml_doc, QFile *file, QString *error_message
|
|||||||
|
|
||||||
QTextStream out(file);
|
QTextStream out(file);
|
||||||
out.seek(0);
|
out.seek(0);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
out.setCodec("UTF-8");
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
out.setEncoding(QStringConverter::Utf8);
|
out.setEncoding(QStringConverter::Utf8);
|
||||||
#endif
|
|
||||||
out.setGenerateByteOrderMark(false);
|
out.setGenerateByteOrderMark(false);
|
||||||
out << xml_doc.toString(4);
|
out << xml_doc.toString(4);
|
||||||
if (opened_here) {
|
if (opened_here) {
|
||||||
|
|||||||
@@ -202,14 +202,7 @@ void QETApp::setLanguage(const QString &desired_language) {
|
|||||||
QString languages_path = languagesPath();
|
QString languages_path = languagesPath();
|
||||||
|
|
||||||
// load Qt library translations
|
// load Qt library translations
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
QString qt_l10n_path = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
QString qt_l10n_path = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
|
QString qt_l10n_path = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
|
||||||
#endif
|
|
||||||
if (!qtTranslator.load("qt_" + desired_language, qt_l10n_path))
|
if (!qtTranslator.load("qt_" + desired_language, qt_l10n_path))
|
||||||
{
|
{
|
||||||
qWarning() << "failed to load"
|
qWarning() << "failed to load"
|
||||||
|
|||||||
@@ -451,16 +451,8 @@ void GraphicsTablePropertiesEditor::setUpEditConnection()
|
|||||||
m_edit_connection << connect(ui->m_table_left_margin, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply);
|
m_edit_connection << connect(ui->m_table_left_margin, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply);
|
||||||
m_edit_connection << connect(ui->m_table_right_margin, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply);
|
m_edit_connection << connect(ui->m_table_right_margin, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply);
|
||||||
m_edit_connection << connect(ui->m_table_bottom_margin, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply);
|
m_edit_connection << connect(ui->m_table_bottom_margin, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove
|
m_edit_connection << connect(m_table_button_group, QOverload<int>::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply);
|
||||||
m_edit_connection << connect(m_table_button_group, QOverload<int>::of(&QButtonGroup::buttonClicked), this, &GraphicsTablePropertiesEditor::apply);
|
m_edit_connection << connect(m_header_button_group, QOverload<int>::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply);
|
||||||
m_edit_connection << connect(m_header_button_group, QOverload<int>::of(&QButtonGroup::buttonClicked), this, &GraphicsTablePropertiesEditor::apply);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.15 or later")
|
|
||||||
#endif
|
|
||||||
m_edit_connection << connect(m_table_button_group, QOverload<int>::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply);
|
|
||||||
m_edit_connection << connect(m_header_button_group, QOverload<int>::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply);
|
|
||||||
#endif
|
|
||||||
m_edit_connection << connect(ui->m_display_n_row_sb, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply);
|
m_edit_connection << connect(ui->m_display_n_row_sb, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply);
|
||||||
m_edit_connection << connect(ui->m_display_n_row_sb, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::updateInfoLabel);
|
m_edit_connection << connect(ui->m_display_n_row_sb, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::updateInfoLabel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1725,14 +1725,7 @@ QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram,
|
|||||||
for (Conductor *c : other_conductors_list_t) {
|
for (Conductor *c : other_conductors_list_t) {
|
||||||
other_conductors += c->relatedPotentialConductors(all_diagram, t_list);
|
other_conductors += c->relatedPotentialConductors(all_diagram, t_list);
|
||||||
}
|
}
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
|
||||||
other_conductors += other_conductors_list_t.toSet();
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
other_conductors += QSet<Conductor*>(other_conductors_list_t.begin(),other_conductors_list_t.end());
|
other_conductors += QSet<Conductor*>(other_conductors_list_t.begin(),other_conductors_list_t.end());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -276,14 +276,7 @@ bool QETXML::writeXmlFile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTextStream out(&file);
|
QTextStream out(&file);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
out.setCodec("UTF-8");
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
out.setEncoding(QStringConverter::Utf8);
|
out.setEncoding(QStringConverter::Utf8);
|
||||||
#endif
|
|
||||||
out.setGenerateByteOrderMark(false);
|
out.setGenerateByteOrderMark(false);
|
||||||
out << xml_document.toString(4);
|
out << xml_document.toString(4);
|
||||||
file.close();
|
file.close();
|
||||||
|
|||||||
@@ -255,14 +255,7 @@ void QTextOrientationWidget::paintEvent(QPaintEvent *event) {
|
|||||||
*/
|
*/
|
||||||
void QTextOrientationWidget::mouseMoveEvent(QMouseEvent *event) {
|
void QTextOrientationWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||||
if (read_only_) return;
|
if (read_only_) return;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
bool drawn_angle_hovered = positionIsASquare(event -> localPos(), &highlight_angle_);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
bool drawn_angle_hovered = positionIsASquare(event -> position(), &highlight_angle_);
|
bool drawn_angle_hovered = positionIsASquare(event -> position(), &highlight_angle_);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (must_highlight_angle_ != drawn_angle_hovered) {
|
if (must_highlight_angle_ != drawn_angle_hovered) {
|
||||||
must_highlight_angle_ = drawn_angle_hovered;
|
must_highlight_angle_ = drawn_angle_hovered;
|
||||||
@@ -278,14 +271,7 @@ void QTextOrientationWidget::mouseReleaseEvent(QMouseEvent *event) {
|
|||||||
if (read_only_) return;
|
if (read_only_) return;
|
||||||
|
|
||||||
double clicked_angle;
|
double clicked_angle;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
bool drawn_angle_clicked = positionIsASquare(event -> localPos(), &clicked_angle);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
#endif
|
|
||||||
bool drawn_angle_clicked = positionIsASquare(event -> position(), &clicked_angle);
|
bool drawn_angle_clicked = positionIsASquare(event -> position(), &clicked_angle);
|
||||||
#endif
|
|
||||||
if (drawn_angle_clicked) {
|
if (drawn_angle_clicked) {
|
||||||
setOrientation(clicked_angle);
|
setOrientation(clicked_angle);
|
||||||
emit(orientationChanged(clicked_angle));
|
emit(orientationChanged(clicked_angle));
|
||||||
|
|||||||
@@ -77,11 +77,7 @@
|
|||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QActionGroup>
|
#include <QActionGroup>
|
||||||
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
|
||||||
#include <QStringView>
|
#include <QStringView>
|
||||||
#else
|
|
||||||
#define QStringView QStringRef
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@@ -745,14 +741,8 @@ QString RichTextEditor::text(Qt::TextFormat format) const
|
|||||||
return m_simplifyRichText ? simplifyRichTextFilter(toHtml()) : toHtml();
|
return m_simplifyRichText ? simplifyRichTextFilter(toHtml()) : toHtml();
|
||||||
case Qt::AutoText:
|
case Qt::AutoText:
|
||||||
break;
|
break;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
case Qt::MarkdownText: //This enum value was added in Qt 5.14.
|
case Qt::MarkdownText: //This enum value was added in Qt 5.14.
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
qInfo("(RichTextEditor::text) no valid switch: %d",format);
|
qInfo("(RichTextEditor::text) no valid switch: %d",format);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -394,16 +394,9 @@ void TitleBlockTemplate::parseRows(const QString &rows_string) {
|
|||||||
QRegularExpression::CaseInsensitiveOption);
|
QRegularExpression::CaseInsensitiveOption);
|
||||||
bool conv_ok;
|
bool conv_ok;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
|
||||||
QStringList rows_descriptions =
|
|
||||||
rows_string.split(QChar(';'), QString::SkipEmptyParts);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
QStringList rows_descriptions =
|
QStringList rows_descriptions =
|
||||||
rows_string.split(QChar(';'), Qt::SkipEmptyParts);
|
rows_string.split(QChar(';'), Qt::SkipEmptyParts);
|
||||||
#endif
|
|
||||||
foreach (QString rows_description, rows_descriptions) {
|
foreach (QString rows_description, rows_descriptions) {
|
||||||
QRegularExpressionMatch match;
|
QRegularExpressionMatch match;
|
||||||
match = row_size_format.match(rows_description);
|
match = row_size_format.match(rows_description);
|
||||||
@@ -436,16 +429,9 @@ void TitleBlockTemplate::parseColumns(const QString &cols_string) {
|
|||||||
bool conv_ok;
|
bool conv_ok;
|
||||||
qDebug() <<"is QRegularExpression ok?";
|
qDebug() <<"is QRegularExpression ok?";
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
|
||||||
QStringList cols_descriptions =
|
|
||||||
cols_string.split(QChar(';'), QString::SkipEmptyParts);
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
|
||||||
#endif
|
|
||||||
QStringList cols_descriptions =
|
QStringList cols_descriptions =
|
||||||
cols_string.split(QChar(';'), Qt::SkipEmptyParts);
|
cols_string.split(QChar(';'), Qt::SkipEmptyParts);
|
||||||
#endif
|
|
||||||
foreach (QString cols_description, cols_descriptions) {
|
foreach (QString cols_description, cols_descriptions) {
|
||||||
QRegularExpressionMatch match_abc,match_rel;
|
QRegularExpressionMatch match_abc,match_rel;
|
||||||
match_abc = abs_col_size_format.match(cols_description);
|
match_abc = abs_col_size_format.match(cols_description);
|
||||||
|
|||||||
@@ -83,14 +83,7 @@ int BOMExportDialog::exec()
|
|||||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
|
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||||
{
|
{
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove
|
|
||||||
stream << getBom() << endl;
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.15 or later")
|
|
||||||
#endif
|
|
||||||
stream << getBom() << &Qt::endl(stream);
|
stream << getBom() << &Qt::endl(stream);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,9 +40,6 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
|
|||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
//Appearance tab
|
//Appearance tab
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ###Qt 6:remove
|
|
||||||
ui->m_hdpi_round_policy_widget->setDisabled(true);
|
|
||||||
#else
|
|
||||||
ui->m_hdpi_round_policy_cb->addItem(tr("Arrondi supérieur pour 0.5 et plus"), QLatin1String("Round"));
|
ui->m_hdpi_round_policy_cb->addItem(tr("Arrondi supérieur pour 0.5 et plus"), QLatin1String("Round"));
|
||||||
ui->m_hdpi_round_policy_cb->addItem(tr("Toujours arrondi supérieur"), QLatin1String("Ceil"));
|
ui->m_hdpi_round_policy_cb->addItem(tr("Toujours arrondi supérieur"), QLatin1String("Ceil"));
|
||||||
ui->m_hdpi_round_policy_cb->addItem(tr("Toujours arrondi inférieur"), QLatin1String("Floor"));
|
ui->m_hdpi_round_policy_cb->addItem(tr("Toujours arrondi inférieur"), QLatin1String("Floor"));
|
||||||
@@ -65,7 +62,6 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
|
|||||||
ui->m_hdpi_round_policy_cb->setCurrentIndex(4);
|
ui->m_hdpi_round_policy_cb->setCurrentIndex(4);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
ui->DiagramEditor_xGrid_sb->setValue(settings.value("diagrameditor/Xgrid", 10).toInt());
|
ui->DiagramEditor_xGrid_sb->setValue(settings.value("diagrameditor/Xgrid", 10).toInt());
|
||||||
ui->DiagramEditor_yGrid_sb->setValue(settings.value("diagrameditor/Ygrid", 10).toInt());
|
ui->DiagramEditor_yGrid_sb->setValue(settings.value("diagrameditor/Ygrid", 10).toInt());
|
||||||
ui->DiagramEditor_xKeyGrid_sb->setValue(settings.value("diagrameditor/key_Xgrid", 10).toInt());
|
ui->DiagramEditor_xKeyGrid_sb->setValue(settings.value("diagrameditor/key_Xgrid", 10).toInt());
|
||||||
@@ -204,10 +200,8 @@ void GeneralConfigurationPage::applyConf()
|
|||||||
settings.setValue("lang", ui->m_lang_cb->itemData(ui->m_lang_cb->currentIndex()).toString());
|
settings.setValue("lang", ui->m_lang_cb->itemData(ui->m_lang_cb->currentIndex()).toString());
|
||||||
|
|
||||||
//hdpi
|
//hdpi
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
QetSettings::setHdpiScaleFactorRoundingPolicy(ui->m_hdpi_round_policy_cb->currentData().toString());
|
QetSettings::setHdpiScaleFactorRoundingPolicy(ui->m_hdpi_round_policy_cb->currentData().toString());
|
||||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFactorRoundingPolicy());
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFactorRoundingPolicy());
|
||||||
#endif
|
|
||||||
|
|
||||||
//ELEMENT EDITOR
|
//ELEMENT EDITOR
|
||||||
settings.setValue("elementeditor/default-informations", ui->m_default_elements_info->toPlainText());
|
settings.setValue("elementeditor/default-informations", ui->m_default_elements_info->toPlainText());
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
namespace QetSettings
|
namespace QetSettings
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
/**
|
/**
|
||||||
* @brief setHdpiScaleFactorRoundingPolicy
|
* @brief setHdpiScaleFactorRoundingPolicy
|
||||||
* Write the value of HdpiScaleFactorRoundingPolicy in
|
* Write the value of HdpiScaleFactorRoundingPolicy in
|
||||||
@@ -106,5 +105,4 @@ namespace QetSettings
|
|||||||
return default_policy;
|
return default_policy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,12 +28,10 @@
|
|||||||
*/
|
*/
|
||||||
namespace QetSettings
|
namespace QetSettings
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
void setHdpiScaleFactorRoundingPolicy(const QString &policy_str);
|
void setHdpiScaleFactorRoundingPolicy(const QString &policy_str);
|
||||||
void setHdpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy);
|
void setHdpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy);
|
||||||
Qt::HighDpiScaleFactorRoundingPolicy hdpiScaleFactorRoundingPolicy(
|
Qt::HighDpiScaleFactorRoundingPolicy hdpiScaleFactorRoundingPolicy(
|
||||||
Qt::HighDpiScaleFactorRoundingPolicy default_policy = Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
Qt::HighDpiScaleFactorRoundingPolicy default_policy = Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QETSETTINGS_H
|
#endif // QETSETTINGS_H
|
||||||
|
|||||||
Reference in New Issue
Block a user