mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Removed some Q_UNUSED
This commit is contained in:
@@ -606,20 +606,13 @@ void BorderTitleBlock::draw(QPainter *painter)
|
||||
|
||||
/**
|
||||
@brief BorderTitleBlock::drawDxf
|
||||
@param width
|
||||
@param height
|
||||
@param keep_aspect_ratio
|
||||
@param file_path
|
||||
@param color
|
||||
*/
|
||||
void BorderTitleBlock::drawDxf(
|
||||
int width,
|
||||
int height,
|
||||
bool keep_aspect_ratio,
|
||||
QString &file_path,
|
||||
int color) {
|
||||
Q_UNUSED (width); Q_UNUSED (height); Q_UNUSED (keep_aspect_ratio);
|
||||
|
||||
int color)
|
||||
{
|
||||
// Transform to DXF scale.
|
||||
columns_header_height_ *= Createdxf::yScale;
|
||||
rows_height_ *= Createdxf::yScale;
|
||||
@@ -675,8 +668,7 @@ void BorderTitleBlock::drawDxf(
|
||||
2,
|
||||
xCoord+recWidth/2,
|
||||
1,
|
||||
color,
|
||||
0);
|
||||
color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,8 +702,7 @@ void BorderTitleBlock::drawDxf(
|
||||
2,
|
||||
xCoord+recWidth/2,
|
||||
1,
|
||||
color,
|
||||
0);
|
||||
color);
|
||||
row_string = incrementLetters(row_string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class BorderTitleBlock : public QObject
|
||||
//METHODS
|
||||
public:
|
||||
void draw(QPainter *painter);
|
||||
void drawDxf(int, int, bool, QString &, int);
|
||||
void drawDxf(QString &, int);
|
||||
|
||||
//METHODS TO GET DIMENSION
|
||||
//COLUMNS
|
||||
|
||||
@@ -104,7 +104,7 @@ void SingleLineProperties::draw(QPainter *painter,
|
||||
if (hasGround && i == 1) {
|
||||
drawGround(painter, direction, symbol_p2, symbol_width * 2.0);
|
||||
} else if (hasNeutral && ((i == 1 && !hasGround) || (i == 2 && hasGround))) {
|
||||
drawNeutral(painter, direction, symbol_p2, symbol_width * 1.5);
|
||||
drawNeutral(painter, symbol_p2, symbol_width * 1.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,15 +149,14 @@ void SingleLineProperties::drawGround(QPainter *painter,
|
||||
/**
|
||||
Dessine le cercle correspondant au symbole du neutre sur un conducteur unifilaire
|
||||
@param painter QPainter a utiliser pour dessiner le segment
|
||||
@param direction direction du segment sur lequel le symbole apparaitra
|
||||
@param center centre du cercle
|
||||
@param size diametre du cercle
|
||||
*/
|
||||
void SingleLineProperties::drawNeutral(QPainter *painter,
|
||||
QET::ConductorSegmentType direction,
|
||||
QPointF center,
|
||||
qreal size) {
|
||||
Q_UNUSED(direction);
|
||||
void SingleLineProperties::drawNeutral(
|
||||
QPainter *painter,
|
||||
QPointF center,
|
||||
qreal size)
|
||||
{
|
||||
painter -> save();
|
||||
|
||||
// prepare le QPainter
|
||||
@@ -199,7 +198,7 @@ void SingleLineProperties::drawPen(QPainter *painter,
|
||||
// QSizeF(size * 1.5, size * 1.5)
|
||||
// )
|
||||
//);
|
||||
drawNeutral(painter, direction, center, size * 1.5);
|
||||
drawNeutral(painter, center, size * 1.5);
|
||||
|
||||
int offset = (size * 1.5 / 2.0);
|
||||
QPointF pos = center + (direction == QET::Horizontal ? QPointF(0.0, -offset - 0.5) : QPointF(offset + 0.5, 0.0));
|
||||
|
||||
@@ -55,7 +55,7 @@ class SingleLineProperties {
|
||||
private:
|
||||
unsigned short int phases;
|
||||
void drawGround (QPainter *, QET::ConductorSegmentType, QPointF, qreal);
|
||||
void drawNeutral(QPainter *, QET::ConductorSegmentType, QPointF, qreal);
|
||||
void drawNeutral(QPainter *, QPointF, qreal);
|
||||
void drawPen(QPainter *, QET::ConductorSegmentType, QPointF, qreal);
|
||||
};
|
||||
|
||||
|
||||
@@ -778,23 +778,20 @@ void Createdxf::drawText(const QString& fileName,
|
||||
/* draw aligned text in DXF Format */
|
||||
// leftAlign flag added. If the alignment requested is 'fit to width' and the text length is very small,
|
||||
// then the text is either centered or left-aligned, depnding on the value of leftAlign.
|
||||
void Createdxf::drawTextAligned(const QString& fileName,
|
||||
const QString& text,
|
||||
double x,
|
||||
double y,
|
||||
double height,
|
||||
double rotation,
|
||||
double oblique,
|
||||
int hAlign,
|
||||
int vAlign,
|
||||
double xAlign,
|
||||
double xScale,
|
||||
int colour,
|
||||
bool leftAlign,
|
||||
float scale)
|
||||
void Createdxf::drawTextAligned(
|
||||
const QString& fileName,
|
||||
const QString& text,
|
||||
double x,
|
||||
double y,
|
||||
double height,
|
||||
double rotation,
|
||||
double oblique,
|
||||
int hAlign,
|
||||
int vAlign,
|
||||
double xAlign,
|
||||
double xScale,
|
||||
int colour)
|
||||
{
|
||||
Q_UNUSED(scale);
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
QFile file(fileName);
|
||||
if (!file.open(QFile::Append)) {
|
||||
|
||||
@@ -98,9 +98,7 @@ class Createdxf
|
||||
int vAlign,
|
||||
double xAlign,
|
||||
double xScale,
|
||||
int colour,
|
||||
bool leftAlign = false,
|
||||
float scale = 0);
|
||||
int colour);
|
||||
|
||||
|
||||
static int getcolorCode (const long red,
|
||||
|
||||
@@ -288,18 +288,16 @@ void ElementScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
\~French Dessine l'arriere-plan de l'editeur, cad l'indicateur de hotspot.
|
||||
\~ @param p : The QPainter to use for drawing
|
||||
\~French Le QPainter a utiliser pour dessiner
|
||||
\~ @param rect : The rectangle of the area to be drawn
|
||||
\~French Le rectangle de la zone a dessiner
|
||||
*/
|
||||
void ElementScene::drawForeground(QPainter *p, const QRectF &rect) {
|
||||
Q_UNUSED(rect);
|
||||
void ElementScene::drawForeground(QPainter *p, const QRectF &)
|
||||
{
|
||||
p -> save();
|
||||
|
||||
|
||||
// desactive tout antialiasing, sauf pour le texte
|
||||
p -> setRenderHint(QPainter::Antialiasing, false);
|
||||
p -> setRenderHint(QPainter::TextAntialiasing, true);
|
||||
p -> setRenderHint(QPainter::SmoothPixmapTransform, false);
|
||||
|
||||
|
||||
QPen pen(Qt::red);
|
||||
pen.setCosmetic(true);
|
||||
p -> setPen(pen);
|
||||
|
||||
@@ -215,9 +215,8 @@ bool ElementsPanel::matchesFilter(const QTreeWidgetItem *item,
|
||||
@param reload_collections :
|
||||
true for read all collections since their sources (files, projects ...)
|
||||
*/
|
||||
void ElementsPanel::reload(bool reload_collections) {
|
||||
Q_UNUSED(reload_collections);
|
||||
|
||||
void ElementsPanel::reload()
|
||||
{
|
||||
QIcon system_icon(":/ico/16x16/qet.png");
|
||||
QIcon user_icon(":/ico/16x16/go-home.png");
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class ElementsPanel : public GenericPanel {
|
||||
|
||||
public slots:
|
||||
void slot_doubleClick(QTreeWidgetItem *, int);
|
||||
void reload(bool = false);
|
||||
void reload();
|
||||
void filter(const QString &, QET::Filtering = QET::RegularFilter);
|
||||
void projectWasOpened(QETProject *);
|
||||
void projectWasClosed(QETProject *);
|
||||
|
||||
@@ -159,7 +159,7 @@ void ElementsPanelWidget::copyPathForSelectedItem() {
|
||||
*/
|
||||
void ElementsPanelWidget::reloadAndFilter() {
|
||||
// recharge tous les elements
|
||||
elements_panel -> reload(true);
|
||||
elements_panel -> reload();
|
||||
// reapplique le filtre
|
||||
if (!filter_textfield -> text().isEmpty()) {
|
||||
elements_panel -> filter(filter_textfield -> text());
|
||||
|
||||
@@ -396,13 +396,11 @@ void ExportDialog::generateSvg(Diagram *diagram, int width, int height, bool kee
|
||||
@param diagram Schema a exporter en DXF
|
||||
@param width Largeur de l'export DXF
|
||||
@param height Hauteur de l'export DXF
|
||||
@param keep_aspect_ratio True pour conserver le ratio, false sinon
|
||||
@param file_path
|
||||
*/
|
||||
void ExportDialog::generateDxf(Diagram *diagram,
|
||||
int width,
|
||||
int height,
|
||||
bool keep_aspect_ratio,
|
||||
QString &file_path) {
|
||||
saveReloadDiagramParameters(diagram, true);
|
||||
|
||||
@@ -426,10 +424,7 @@ void ExportDialog::generateDxf(Diagram *diagram,
|
||||
double(height)*Createdxf::yScale,
|
||||
0);
|
||||
}
|
||||
diagram -> border_and_titleblock.drawDxf(width,
|
||||
height,
|
||||
keep_aspect_ratio,
|
||||
file_path,
|
||||
diagram -> border_and_titleblock.drawDxf(file_path,
|
||||
0);
|
||||
|
||||
// Build the lists of elements.
|
||||
@@ -800,7 +795,6 @@ void ExportDialog::exportDiagram(ExportDiagramLine *diagram_line) {
|
||||
diagram_line -> diagram,
|
||||
diagram_line -> width -> value(),
|
||||
diagram_line -> height -> value(),
|
||||
diagram_line -> keep_ratio -> isChecked(),
|
||||
diagram_path
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -89,7 +89,7 @@ class ExportDialog : public QDialog {
|
||||
QWidget *initDiagramsListPart();
|
||||
void saveReloadDiagramParameters(Diagram *, bool = true);
|
||||
void generateSvg(Diagram *, int, int, bool, QIODevice &);
|
||||
void generateDxf(Diagram *, int, int, bool, QString &);
|
||||
void generateDxf(Diagram *, int, int, QString &);
|
||||
QImage generateImage(Diagram *, int, int, bool);
|
||||
void exportDiagram(ExportDiagramLine *);
|
||||
qreal diagramRatio(Diagram *);
|
||||
|
||||
@@ -291,7 +291,7 @@ QTreeWidgetItem *GenericPanel::addDiagram(Diagram *diagram,
|
||||
&creation_required);
|
||||
updateDiagramItem(diagram_qtwi, diagram, options, creation_required);
|
||||
reparent(diagram_qtwi, parent_item);
|
||||
fillDiagramItem(diagram_qtwi, diagram, options, creation_required);
|
||||
fillDiagramItem(diagram_qtwi, options, creation_required);
|
||||
|
||||
return(diagram_qtwi);
|
||||
}
|
||||
@@ -394,16 +394,15 @@ QTreeWidgetItem *GenericPanel::updateDiagramItem(QTreeWidgetItem *diagram_qtwi,
|
||||
/**
|
||||
@brief GenericPanel::fillDiagramItem
|
||||
@param diagram_qtwi
|
||||
@param diagram (unused)
|
||||
@param options
|
||||
@param freshly_created
|
||||
@return fillItem(diagram_qtwi, options, freshly_created)
|
||||
*/
|
||||
QTreeWidgetItem *GenericPanel::fillDiagramItem(QTreeWidgetItem *diagram_qtwi,
|
||||
Diagram *diagram,
|
||||
PanelOptions options,
|
||||
bool freshly_created) {
|
||||
Q_UNUSED(diagram)
|
||||
QTreeWidgetItem *GenericPanel::fillDiagramItem(
|
||||
QTreeWidgetItem *diagram_qtwi,
|
||||
PanelOptions options,
|
||||
bool freshly_created)
|
||||
{
|
||||
return(fillItem(diagram_qtwi, options, freshly_created));
|
||||
}
|
||||
|
||||
|
||||
@@ -101,10 +101,10 @@ class GenericPanel : public QTreeWidget {
|
||||
Diagram *,
|
||||
PanelOptions = AddAllChild,
|
||||
bool = false);
|
||||
virtual QTreeWidgetItem *fillDiagramItem (QTreeWidgetItem *,
|
||||
Diagram *,
|
||||
PanelOptions = AddAllChild,
|
||||
bool = false);
|
||||
virtual QTreeWidgetItem *fillDiagramItem(
|
||||
QTreeWidgetItem *,
|
||||
PanelOptions = AddAllChild,
|
||||
bool = false);
|
||||
|
||||
// title block templates collections methods
|
||||
public:
|
||||
|
||||
@@ -243,9 +243,10 @@ void ConductorTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *e) {
|
||||
change m_mouse_hover to false(used in paint() function )
|
||||
@param e QGraphicsSceneHoverEvent
|
||||
*/
|
||||
void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) {
|
||||
void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e)
|
||||
{
|
||||
Q_UNUSED(e);
|
||||
//qDebug() << "Leave mouse over";
|
||||
qDebug() << "Leave mouse over";
|
||||
m_mouse_hover = false;
|
||||
update();
|
||||
}
|
||||
@@ -254,7 +255,7 @@ void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) {
|
||||
Do nothing default function .
|
||||
@param e QGraphicsSceneHoverEvent
|
||||
*/
|
||||
void ConductorTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *e) {
|
||||
Q_UNUSED(e);
|
||||
QGraphicsTextItem::hoverMoveEvent(e);
|
||||
void ConductorTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *e)
|
||||
{
|
||||
QGraphicsTextItem::hoverMoveEvent(e);
|
||||
}
|
||||
|
||||
@@ -295,9 +295,10 @@ QPainterPath QetShapeItem::shape() const
|
||||
@param option
|
||||
@param widget
|
||||
*/
|
||||
void QetShapeItem::paint(QPainter *painter,
|
||||
const QStyleOptionGraphicsItem *option,
|
||||
QWidget *widget)
|
||||
void QetShapeItem::paint(
|
||||
QPainter *painter,
|
||||
const QStyleOptionGraphicsItem *option,
|
||||
QWidget *widget)
|
||||
{
|
||||
Q_UNUSED(option)
|
||||
Q_UNUSED(widget)
|
||||
@@ -425,17 +426,17 @@ bool QetShapeItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::GraphicsSceneMousePress) //Click
|
||||
{
|
||||
handlerMousePressEvent(qghi, static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||
handlerMousePressEvent();
|
||||
return true;
|
||||
}
|
||||
else if(event->type() == QEvent::GraphicsSceneMouseMove) //Move
|
||||
{
|
||||
handlerMouseMoveEvent(qghi, static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||
handlerMouseMoveEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||
return true;
|
||||
}
|
||||
else if (event->type() == QEvent::GraphicsSceneMouseRelease) //Release
|
||||
{
|
||||
handlerMouseReleaseEvent(qghi, static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||
handlerMouseReleaseEvent();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -703,11 +704,8 @@ void QetShapeItem::removePoint()
|
||||
@param qghi
|
||||
@param event
|
||||
*/
|
||||
void QetShapeItem::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
|
||||
void QetShapeItem::handlerMousePressEvent()
|
||||
{
|
||||
Q_UNUSED(qghi)
|
||||
Q_UNUSED(event)
|
||||
|
||||
m_old_P1 = m_P1;
|
||||
m_old_P2 = m_P2;
|
||||
m_old_polygon = m_polygon;
|
||||
@@ -720,13 +718,10 @@ void QetShapeItem::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphic
|
||||
|
||||
/**
|
||||
@brief QetShapeItem::handlerMouseMoveEvent
|
||||
@param qghi
|
||||
@param event
|
||||
*/
|
||||
void QetShapeItem::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
|
||||
void QetShapeItem::handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(qghi)
|
||||
|
||||
QPointF new_pos = event->scenePos();
|
||||
if (event->modifiers() != Qt::ControlModifier)
|
||||
new_pos = Diagram::snapToGrid(event->scenePos());
|
||||
@@ -787,11 +782,8 @@ void QetShapeItem::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphics
|
||||
@param qghi
|
||||
@param event
|
||||
*/
|
||||
void QetShapeItem::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
|
||||
void QetShapeItem::handlerMouseReleaseEvent()
|
||||
{
|
||||
Q_UNUSED(qghi);
|
||||
Q_UNUSED(event);
|
||||
|
||||
m_modifie_radius_equaly = false;
|
||||
|
||||
if (diagram())
|
||||
|
||||
@@ -121,9 +121,9 @@ class QetShapeItem : public QetGraphicsItem
|
||||
void insertPoint();
|
||||
void removePoint();
|
||||
|
||||
void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
|
||||
void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
|
||||
void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
|
||||
void handlerMousePressEvent();
|
||||
void handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
void handlerMouseReleaseEvent();
|
||||
|
||||
///ATTRIBUTES
|
||||
private:
|
||||
|
||||
@@ -1858,9 +1858,7 @@ void TitleBlockTemplate::renderTextCellDxf(QString &file_path,
|
||||
vAlign,
|
||||
x2,
|
||||
ratio,
|
||||
color,
|
||||
cell.alignment & Qt::AlignLeft,
|
||||
0);
|
||||
color);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user