mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Revert "Try Clazy fix-its"
Segfault on old Qt versions!
This reverts commit dba7caed30.
This commit is contained in:
@@ -121,7 +121,7 @@ void ShapeGraphicsItemPropertiesWidget::apply()
|
||||
}
|
||||
else if (!m_shapes_list.isEmpty())
|
||||
{
|
||||
for (const QPointer<QetShapeItem>& qsi : std::as_const(m_shapes_list))
|
||||
for (QPointer<QetShapeItem> qsi : m_shapes_list)
|
||||
{
|
||||
if (qsi->diagram()) {
|
||||
d = qsi->diagram();
|
||||
@@ -222,7 +222,7 @@ QUndoCommand* ShapeGraphicsItemPropertiesWidget::associatedUndo() const
|
||||
if (ui->m_style_cb->currentIndex() != -1 &&
|
||||
Qt::PenStyle(ui->m_style_cb->currentIndex() + 1) != shape_->pen().style())
|
||||
{
|
||||
for (const QPointer<QetShapeItem>& qsi : m_shapes_list)
|
||||
for (QPointer<QetShapeItem> qsi : m_shapes_list)
|
||||
{
|
||||
QPen pen = qsi->pen();
|
||||
|
||||
@@ -239,7 +239,7 @@ QUndoCommand* ShapeGraphicsItemPropertiesWidget::associatedUndo() const
|
||||
if (ui->m_size_dsb->value() > 0 &&
|
||||
ui->m_size_dsb->value() != shape_->pen().widthF())
|
||||
{
|
||||
for (const QPointer<QetShapeItem>& qsi : m_shapes_list)
|
||||
for (QPointer<QetShapeItem> qsi : m_shapes_list)
|
||||
{
|
||||
QPen pen = pen_H.contains(qsi) ? pen_H.value(qsi) : qsi->pen();
|
||||
pen.setWidthF(ui->m_size_dsb->value());
|
||||
@@ -250,7 +250,7 @@ QUndoCommand* ShapeGraphicsItemPropertiesWidget::associatedUndo() const
|
||||
QColor c =ui->m_color_kpb->color();
|
||||
if (c != QPalette().color(QPalette::Button) && shape_->pen().color() != c)
|
||||
{
|
||||
for (const QPointer<QetShapeItem>& qsi : m_shapes_list)
|
||||
for (QPointer<QetShapeItem> qsi : m_shapes_list)
|
||||
{
|
||||
QPen pen = pen_H.contains(qsi) ? pen_H.value(qsi) : qsi->pen();
|
||||
pen.setColor(c);
|
||||
@@ -258,7 +258,7 @@ QUndoCommand* ShapeGraphicsItemPropertiesWidget::associatedUndo() const
|
||||
}
|
||||
}
|
||||
|
||||
for (const QPointer<QetShapeItem>& qsi : pen_H.keys())
|
||||
for (QPointer<QetShapeItem> qsi : pen_H.keys())
|
||||
{
|
||||
if (!parent_undo) {
|
||||
parent_undo = new QUndoCommand(tr("Modifier une forme simple"));
|
||||
@@ -271,7 +271,7 @@ QUndoCommand* ShapeGraphicsItemPropertiesWidget::associatedUndo() const
|
||||
if (ui->m_brush_style_cb->currentIndex() != -1 &&
|
||||
shape_->brush().style() != Qt::BrushStyle(ui->m_brush_style_cb->currentIndex()))
|
||||
{
|
||||
for (const QPointer<QetShapeItem>& qsi : m_shapes_list)
|
||||
for (QPointer<QetShapeItem> qsi : m_shapes_list)
|
||||
{
|
||||
QBrush brush = qsi->brush();
|
||||
brush.setStyle(Qt::BrushStyle(ui->m_brush_style_cb->currentIndex()));
|
||||
@@ -282,7 +282,7 @@ QUndoCommand* ShapeGraphicsItemPropertiesWidget::associatedUndo() const
|
||||
c = ui->m_brush_color_kpb->color();
|
||||
if (c != QPalette().color(QPalette::Button) && shape_->brush().color() != c)
|
||||
{
|
||||
for (const QPointer<QetShapeItem>& qsi : m_shapes_list)
|
||||
for (QPointer<QetShapeItem> qsi : m_shapes_list)
|
||||
{
|
||||
QBrush brush = brush_H.contains(qsi) ? brush_H.value(qsi) : qsi->brush();
|
||||
brush.setColor(c);
|
||||
@@ -290,7 +290,7 @@ QUndoCommand* ShapeGraphicsItemPropertiesWidget::associatedUndo() const
|
||||
}
|
||||
}
|
||||
|
||||
for (const QPointer<QetShapeItem>& qsi : brush_H.keys())
|
||||
for (QPointer<QetShapeItem> qsi : brush_H.keys())
|
||||
{
|
||||
if (!parent_undo) {
|
||||
parent_undo = new QUndoCommand(tr("Modifier une forme simple"));
|
||||
@@ -383,8 +383,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
|
||||
bool same = true;
|
||||
//Pen
|
||||
Qt::PenStyle ps = m_shapes_list.first()->pen().style();
|
||||
for (QetShapeItem* qsi : std::as_const(m_shapes_list))
|
||||
{
|
||||
for (QetShapeItem *qsi : m_shapes_list) {
|
||||
if (qsi->pen().style() != ps) {
|
||||
same = false;
|
||||
break;
|
||||
@@ -394,8 +393,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
|
||||
|
||||
same = true;
|
||||
qreal pw = m_shapes_list.first()->pen().widthF();
|
||||
for (QetShapeItem* qsi : std::as_const(m_shapes_list))
|
||||
{
|
||||
for (QetShapeItem *qsi : m_shapes_list) {
|
||||
if (qsi->pen().widthF() != pw) {
|
||||
same = false;
|
||||
break;
|
||||
@@ -405,8 +403,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
|
||||
|
||||
same = true;
|
||||
QColor pc = m_shapes_list.first()->pen().color();
|
||||
for (QetShapeItem* qsi : std::as_const(m_shapes_list))
|
||||
{
|
||||
for (QetShapeItem *qsi : m_shapes_list) {
|
||||
if (qsi->pen().color() != pc) {
|
||||
same = false;
|
||||
break;
|
||||
@@ -419,8 +416,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
|
||||
|
||||
same = true;
|
||||
Qt::BrushStyle bs = m_shapes_list.first()->brush().style();
|
||||
for (QetShapeItem* qsi : std::as_const(m_shapes_list))
|
||||
{
|
||||
for (QetShapeItem *qsi : m_shapes_list) {
|
||||
if (qsi->brush().style() != bs) {
|
||||
same = false;
|
||||
break;
|
||||
@@ -430,8 +426,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
|
||||
|
||||
same = true;
|
||||
QColor bc = m_shapes_list.first()->brush().color();
|
||||
for (QetShapeItem* qsi : std::as_const(m_shapes_list))
|
||||
{
|
||||
for (QetShapeItem *qsi : m_shapes_list) {
|
||||
if (qsi->brush().color() != bc) {
|
||||
same = false;
|
||||
break;
|
||||
@@ -521,8 +516,7 @@ void ShapeGraphicsItemPropertiesWidget::on_m_lock_pos_cb_clicked()
|
||||
m_shape->setMovable(!ui->m_lock_pos_cb->isChecked());
|
||||
}
|
||||
else if (!m_shapes_list.isEmpty()) {
|
||||
for (const QPointer<QetShapeItem>& qsi : std::as_const(m_shapes_list))
|
||||
{
|
||||
for (QPointer<QetShapeItem> qsi : m_shapes_list) {
|
||||
qsi->setMovable(!ui->m_lock_pos_cb->isChecked());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user