mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Revert "Try Clazy fix-its"
Segfault on old Qt versions!
This reverts commit dba7caed30.
This commit is contained in:
@@ -71,8 +71,7 @@ IndiTextPropertiesWidget::~IndiTextPropertiesWidget()
|
||||
void IndiTextPropertiesWidget::setText(IndependentTextItem *text)
|
||||
{
|
||||
if (m_text) {
|
||||
for (const QMetaObject::Connection& c : std::as_const(m_connect_list))
|
||||
{
|
||||
for (QMetaObject::Connection c : m_connect_list) {
|
||||
disconnect(c);
|
||||
}
|
||||
}
|
||||
@@ -90,8 +89,7 @@ void IndiTextPropertiesWidget::setText(IndependentTextItem *text)
|
||||
|
||||
void IndiTextPropertiesWidget::setText(QList<IndependentTextItem *> text_list)
|
||||
{
|
||||
for (const QMetaObject::Connection& c : std::as_const(m_connect_list))
|
||||
{
|
||||
for (QMetaObject::Connection c : m_connect_list) {
|
||||
disconnect(c);
|
||||
}
|
||||
m_connect_list.clear();
|
||||
@@ -127,9 +125,7 @@ void IndiTextPropertiesWidget::apply()
|
||||
if (m_text && m_text->diagram()) {
|
||||
d = m_text->diagram();
|
||||
} else if (!m_text_list.isEmpty()) {
|
||||
for (const QPointer<IndependentTextItem>& piti :
|
||||
std::as_const(m_text_list))
|
||||
{
|
||||
for (QPointer<IndependentTextItem> piti : m_text_list) {
|
||||
if (piti->diagram()) {
|
||||
d = piti->diagram();
|
||||
break;
|
||||
@@ -162,9 +158,7 @@ bool IndiTextPropertiesWidget::setLiveEdit(bool live_edit)
|
||||
setUpEditConnection();
|
||||
}
|
||||
else {
|
||||
for (const QMetaObject::Connection& c :
|
||||
std::as_const(m_edit_connection))
|
||||
{
|
||||
for (QMetaObject::Connection c : m_edit_connection) {
|
||||
disconnect(c);
|
||||
}
|
||||
m_edit_connection.clear();
|
||||
@@ -226,7 +220,7 @@ QUndoCommand *IndiTextPropertiesWidget::associatedUndo() const
|
||||
qreal rotation_ = m_text_list.first()->rotation();
|
||||
int size_ = m_text_list.first()->font().pointSize();
|
||||
QFont font_ = m_text_list.first()->font();
|
||||
for (const QPointer<IndependentTextItem>& piti : m_text_list)
|
||||
for (QPointer<IndependentTextItem> piti : m_text_list)
|
||||
{
|
||||
if (piti->rotation() != rotation_) {
|
||||
angle_equal = false;
|
||||
@@ -242,7 +236,7 @@ QUndoCommand *IndiTextPropertiesWidget::associatedUndo() const
|
||||
if ((angle_equal && (ui->m_angle_sb->value() != rotation_)) ||
|
||||
(!angle_equal && (ui->m_angle_sb->value() != ui->m_angle_sb->minimum())))
|
||||
{
|
||||
for (const QPointer<IndependentTextItem>& piti : m_text_list)
|
||||
for (QPointer<IndependentTextItem> piti : m_text_list)
|
||||
{
|
||||
if (piti)
|
||||
{
|
||||
@@ -257,7 +251,7 @@ QUndoCommand *IndiTextPropertiesWidget::associatedUndo() const
|
||||
else if ((size_equal && (ui->m_size_sb->value() != size_)) ||
|
||||
(!size_equal && (ui->m_size_sb->value() != ui->m_size_sb->minimum())))
|
||||
{
|
||||
for (const QPointer<IndependentTextItem>& piti : m_text_list)
|
||||
for (QPointer<IndependentTextItem> piti : m_text_list)
|
||||
{
|
||||
if (piti)
|
||||
{
|
||||
@@ -273,7 +267,7 @@ QUndoCommand *IndiTextPropertiesWidget::associatedUndo() const
|
||||
else if ((m_font_is_selected && !font_equal) ||
|
||||
(m_font_is_selected && (font_equal && (m_selected_font != font_))))
|
||||
{
|
||||
for (const QPointer<IndependentTextItem>& piti : m_text_list)
|
||||
for (QPointer<IndependentTextItem> piti : m_text_list)
|
||||
{
|
||||
if (piti)
|
||||
{
|
||||
@@ -330,8 +324,7 @@ QUndoCommand *IndiTextPropertiesWidget::associatedUndo() const
|
||||
*/
|
||||
void IndiTextPropertiesWidget::setUpEditConnection()
|
||||
{
|
||||
for (const QMetaObject::Connection& c : std::as_const(m_edit_connection))
|
||||
{
|
||||
for (QMetaObject::Connection c : m_edit_connection) {
|
||||
disconnect(c);
|
||||
}
|
||||
m_edit_connection.clear();
|
||||
@@ -361,8 +354,7 @@ void IndiTextPropertiesWidget::updateUi()
|
||||
|
||||
//Disconnect every connections of editor widgets
|
||||
//to avoid an unwanted edition (QSpinBox emit valueChanged no matter if changer by user or by program)
|
||||
for (const QMetaObject::Connection& c : std::as_const(m_edit_connection))
|
||||
{
|
||||
for (QMetaObject::Connection c : m_edit_connection) {
|
||||
disconnect(c);
|
||||
}
|
||||
m_edit_connection.clear();
|
||||
@@ -396,8 +388,7 @@ void IndiTextPropertiesWidget::updateUi()
|
||||
int size_ = m_text_list.first()->font().pointSize();
|
||||
QFont font_ = m_text_list.first()->font();
|
||||
|
||||
for (const QPointer<IndependentTextItem>& piti :
|
||||
std::as_const(m_text_list))
|
||||
for (QPointer<IndependentTextItem> piti : m_text_list)
|
||||
{
|
||||
if (piti->rotation() != rotation_) {
|
||||
angle_equal = false;
|
||||
@@ -412,9 +403,7 @@ void IndiTextPropertiesWidget::updateUi()
|
||||
ui->m_angle_sb->setValue(angle_equal ? rotation_ : 0);
|
||||
|
||||
bool valid_ = true;
|
||||
for (const QPointer<IndependentTextItem>& piti :
|
||||
std::as_const(m_text_list))
|
||||
{
|
||||
for (QPointer<IndependentTextItem> piti : m_text_list) {
|
||||
if (piti->isHtml()) {
|
||||
valid_ = false;
|
||||
}
|
||||
@@ -447,11 +436,10 @@ void IndiTextPropertiesWidget::on_m_break_html_pb_clicked()
|
||||
if (m_text) {
|
||||
m_text->setPlainText(m_text->toPlainText());
|
||||
}
|
||||
for (const QPointer<IndependentTextItem>& piti : std::as_const(m_text_list))
|
||||
{
|
||||
for (QPointer<IndependentTextItem> piti : m_text_list) {
|
||||
piti->setPlainText(piti->toPlainText());
|
||||
}
|
||||
|
||||
|
||||
updateUi();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user