mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
fix deprecated warning QMap
This function is obsolete. Use QMultiMap instead. This function was introduced in Qt 4.3 - 5.14
This commit is contained in:
committed by
Laurent Trinques
parent
573a36b93f
commit
b9ed45c8a3
@@ -681,7 +681,7 @@ QRectF CrossRefItem::drawContact(QPainter &painter, int flags, Element *elmt)
|
|||||||
|
|
||||||
if (m_hovered_contacts_map.contains(elmt))
|
if (m_hovered_contacts_map.contains(elmt))
|
||||||
{
|
{
|
||||||
m_hovered_contacts_map.insertMulti(elmt, bounding_rect);
|
m_hovered_contacts_map.insert(elmt, bounding_rect);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -740,7 +740,7 @@ QRectF CrossRefItem::drawContact(QPainter &painter, int flags, Element *elmt)
|
|||||||
bounding_rect = bounding_rect.united(text_rect);
|
bounding_rect = bounding_rect.united(text_rect);
|
||||||
|
|
||||||
if (m_hovered_contacts_map.contains(elmt)) {
|
if (m_hovered_contacts_map.contains(elmt)) {
|
||||||
m_hovered_contacts_map.insertMulti(elmt, bounding_rect);
|
m_hovered_contacts_map.insert(elmt, bounding_rect);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_hovered_contacts_map.insert(elmt, bounding_rect);
|
m_hovered_contacts_map.insert(elmt, bounding_rect);
|
||||||
@@ -778,7 +778,7 @@ void CrossRefItem::fillCrossRef(QPainter &painter)
|
|||||||
|
|
||||||
if (m_hovered_contacts_map.contains(elmt))
|
if (m_hovered_contacts_map.contains(elmt))
|
||||||
{
|
{
|
||||||
m_hovered_contacts_map.insertMulti(elmt, bounding);
|
m_hovered_contacts_map.insert(elmt, bounding);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -802,7 +802,7 @@ void CrossRefItem::fillCrossRef(QPainter &painter)
|
|||||||
|
|
||||||
if (m_hovered_contacts_map.contains(elmt))
|
if (m_hovered_contacts_map.contains(elmt))
|
||||||
{
|
{
|
||||||
m_hovered_contacts_map.insertMulti(elmt, bounding);
|
m_hovered_contacts_map.insert(elmt, bounding);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,8 +19,10 @@
|
|||||||
#define CROSSREFITEM_H
|
#define CROSSREFITEM_H
|
||||||
|
|
||||||
#include <QGraphicsObject>
|
#include <QGraphicsObject>
|
||||||
#include"properties/xrefproperties.h"
|
|
||||||
#include <QPicture>
|
#include <QPicture>
|
||||||
|
#include <QMultiMap>
|
||||||
|
|
||||||
|
#include"properties/xrefproperties.h"
|
||||||
|
|
||||||
class Element;
|
class Element;
|
||||||
class DynamicElementTextItem;
|
class DynamicElementTextItem;
|
||||||
@@ -104,7 +106,7 @@ class CrossRefItem : public QGraphicsObject
|
|||||||
QPainterPath m_shape_path;
|
QPainterPath m_shape_path;
|
||||||
XRefProperties m_properties;
|
XRefProperties m_properties;
|
||||||
int m_drawed_contacts;
|
int m_drawed_contacts;
|
||||||
QMap <Element *, QRectF> m_hovered_contacts_map;
|
QMultiMap <Element *, QRectF> m_hovered_contacts_map;
|
||||||
Element *m_hovered_contact = nullptr;
|
Element *m_hovered_contact = nullptr;
|
||||||
DynamicElementTextItem *m_text = nullptr;
|
DynamicElementTextItem *m_text = nullptr;
|
||||||
ElementTextItemGroup *m_group = nullptr;
|
ElementTextItemGroup *m_group = nullptr;
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <QMultiMap>
|
||||||
|
|
||||||
#include "templatecellsset.h"
|
#include "templatecellsset.h"
|
||||||
#include "templatevisualcell.h"
|
#include "templatevisualcell.h"
|
||||||
#include "templateview.h"
|
#include "templateview.h"
|
||||||
@@ -100,7 +103,7 @@ TitleBlockTemplateVisualCell *TitleBlockTemplateCellsSet::topLeftCell() const {
|
|||||||
QMultiMap<int, TitleBlockTemplateVisualCell *> top_cells;
|
QMultiMap<int, TitleBlockTemplateVisualCell *> top_cells;
|
||||||
foreach (TitleBlockTemplateVisualCell *cell_view, *this) {
|
foreach (TitleBlockTemplateVisualCell *cell_view, *this) {
|
||||||
if (TitleBlockCell *cell = cell_view -> cell()) {
|
if (TitleBlockCell *cell = cell_view -> cell()) {
|
||||||
top_cells.insertMulti(cell -> num_row, cell_view);
|
top_cells.insert(cell -> num_row, cell_view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QList<TitleBlockTemplateVisualCell *> candidates = top_cells.values(top_cells.keys().first());
|
QList<TitleBlockTemplateVisualCell *> candidates = top_cells.values(top_cells.keys().first());
|
||||||
@@ -130,7 +133,7 @@ TitleBlockTemplateVisualCell *TitleBlockTemplateCellsSet::bottomRightCell() cons
|
|||||||
// look for cells at the bottom
|
// look for cells at the bottom
|
||||||
QMultiMap<qreal, TitleBlockTemplateVisualCell *> bottom_cells;
|
QMultiMap<qreal, TitleBlockTemplateVisualCell *> bottom_cells;
|
||||||
foreach (TitleBlockTemplateVisualCell *cell_view, *this) {
|
foreach (TitleBlockTemplateVisualCell *cell_view, *this) {
|
||||||
bottom_cells.insertMulti(cell_view -> geometry().bottom(), cell_view);
|
bottom_cells.insert(cell_view -> geometry().bottom(), cell_view);
|
||||||
}
|
}
|
||||||
QList<TitleBlockTemplateVisualCell *> candidates = bottom_cells.values(bottom_cells.keys().last());
|
QList<TitleBlockTemplateVisualCell *> candidates = bottom_cells.values(bottom_cells.keys().last());
|
||||||
if (candidates.count() == 1) return(candidates.first());
|
if (candidates.count() == 1) return(candidates.first());
|
||||||
|
|||||||
Reference in New Issue
Block a user