Merge branch 'master' of ssh://git.tuxfamily.org/gitroot/qet/qet

This commit is contained in:
David Varley
2020-09-07 22:14:07 +10:00
52 changed files with 25276 additions and 33438 deletions
+931 -1232
View File
File diff suppressed because it is too large Load Diff
+932 -1234
View File
File diff suppressed because it is too large Load Diff
+928 -1229
View File
File diff suppressed because it is too large Load Diff
+932 -1233
View File
File diff suppressed because it is too large Load Diff
+933 -1234
View File
File diff suppressed because it is too large Load Diff
+932 -1233
View File
File diff suppressed because it is too large Load Diff
+932 -1233
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+931 -1232
View File
File diff suppressed because it is too large Load Diff
+929 -1230
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+926 -1227
View File
File diff suppressed because it is too large Load Diff
+925 -1226
View File
File diff suppressed because it is too large Load Diff
+933 -1234
View File
File diff suppressed because it is too large Load Diff
+929 -1230
View File
File diff suppressed because it is too large Load Diff
+936 -1237
View File
File diff suppressed because it is too large Load Diff
+930 -1231
View File
File diff suppressed because it is too large Load Diff
+935 -1236
View File
File diff suppressed because it is too large Load Diff
+932 -1233
View File
File diff suppressed because it is too large Load Diff
+932 -1234
View File
File diff suppressed because it is too large Load Diff
+927 -1228
View File
File diff suppressed because it is too large Load Diff
+932 -1233
View File
File diff suppressed because it is too large Load Diff
+927 -1228
View File
File diff suppressed because it is too large Load Diff
+928 -1229
View File
File diff suppressed because it is too large Load Diff
+930 -1231
View File
File diff suppressed because it is too large Load Diff
+925 -1226
View File
File diff suppressed because it is too large Load Diff
+925 -1226
View File
File diff suppressed because it is too large Load Diff
+929 -1230
View File
File diff suppressed because it is too large Load Diff
+925 -1226
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -75,6 +75,7 @@ include(sources/QWidgetAnimation/QWidgetAnimation.pri)
DEFINES += QAPPLICATION_CLASS=QApplication DEFINES += QAPPLICATION_CLASS=QApplication
DEFINES += QT_MESSAGELOGCONTEXT DEFINES += QT_MESSAGELOGCONTEXT
DEFINES += GIT_COMMIT_SHA="\\\"$(shell git -C \""$$_PRO_FILE_PWD_"\" rev-parse --verify HEAD)\\\""
TEMPLATE = app TEMPLATE = app
DEPENDPATH += . DEPENDPATH += .
+4 -13
View File
@@ -606,20 +606,13 @@ void BorderTitleBlock::draw(QPainter *painter)
/** /**
@brief BorderTitleBlock::drawDxf @brief BorderTitleBlock::drawDxf
@param width
@param height
@param keep_aspect_ratio
@param file_path @param file_path
@param color @param color
*/ */
void BorderTitleBlock::drawDxf( void BorderTitleBlock::drawDxf(
int width,
int height,
bool keep_aspect_ratio,
QString &file_path, QString &file_path,
int color) { int color)
Q_UNUSED (width); Q_UNUSED (height); Q_UNUSED (keep_aspect_ratio); {
// Transform to DXF scale. // Transform to DXF scale.
columns_header_height_ *= Createdxf::yScale; columns_header_height_ *= Createdxf::yScale;
rows_height_ *= Createdxf::yScale; rows_height_ *= Createdxf::yScale;
@@ -675,8 +668,7 @@ void BorderTitleBlock::drawDxf(
2, 2,
xCoord+recWidth/2, xCoord+recWidth/2,
1, 1,
color, color);
0);
} }
} }
@@ -710,8 +702,7 @@ void BorderTitleBlock::drawDxf(
2, 2,
xCoord+recWidth/2, xCoord+recWidth/2,
1, 1,
color, color);
0);
row_string = incrementLetters(row_string); row_string = incrementLetters(row_string);
} }
} }
+1 -1
View File
@@ -47,7 +47,7 @@ class BorderTitleBlock : public QObject
//METHODS //METHODS
public: public:
void draw(QPainter *painter); void draw(QPainter *painter);
void drawDxf(int, int, bool, QString &, int); void drawDxf(QString &, int);
//METHODS TO GET DIMENSION //METHODS TO GET DIMENSION
//COLUMNS //COLUMNS
+7 -8
View File
@@ -104,7 +104,7 @@ void SingleLineProperties::draw(QPainter *painter,
if (hasGround && i == 1) { if (hasGround && i == 1) {
drawGround(painter, direction, symbol_p2, symbol_width * 2.0); drawGround(painter, direction, symbol_p2, symbol_width * 2.0);
} else if (hasNeutral && ((i == 1 && !hasGround) || (i == 2 && hasGround))) { } 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 Dessine le cercle correspondant au symbole du neutre sur un conducteur unifilaire
@param painter QPainter a utiliser pour dessiner le segment @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 center centre du cercle
@param size diametre du cercle @param size diametre du cercle
*/ */
void SingleLineProperties::drawNeutral(QPainter *painter, void SingleLineProperties::drawNeutral(
QET::ConductorSegmentType direction, QPainter *painter,
QPointF center, QPointF center,
qreal size) { qreal size)
Q_UNUSED(direction); {
painter -> save(); painter -> save();
// prepare le QPainter // prepare le QPainter
@@ -199,7 +198,7 @@ void SingleLineProperties::drawPen(QPainter *painter,
// QSizeF(size * 1.5, size * 1.5) // 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); 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)); QPointF pos = center + (direction == QET::Horizontal ? QPointF(0.0, -offset - 0.5) : QPointF(offset + 0.5, 0.0));
+1 -1
View File
@@ -55,7 +55,7 @@ class SingleLineProperties {
private: private:
unsigned short int phases; unsigned short int phases;
void drawGround (QPainter *, QET::ConductorSegmentType, QPointF, qreal); 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); void drawPen(QPainter *, QET::ConductorSegmentType, QPointF, qreal);
}; };
+13 -16
View File
@@ -798,23 +798,20 @@ void Createdxf::drawText(const QString& fileName,
/* draw aligned text in DXF Format */ /* draw aligned text in DXF Format */
// leftAlign flag added. If the alignment requested is 'fit to width' and the text length is very small, // 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. // then the text is either centered or left-aligned, depnding on the value of leftAlign.
void Createdxf::drawTextAligned(const QString& fileName, void Createdxf::drawTextAligned(
const QString& text, const QString& fileName,
double x, const QString& text,
double y, double x,
double height, double y,
double rotation, double height,
double oblique, double rotation,
int hAlign, double oblique,
int vAlign, int hAlign,
double xAlign, int vAlign,
double xScale, double xAlign,
int colour, double xScale,
bool leftAlign, int colour)
float scale)
{ {
Q_UNUSED(scale);
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
QFile file(fileName); QFile file(fileName);
if (!file.open(QFile::Append)) { if (!file.open(QFile::Append)) {
+1 -3
View File
@@ -102,9 +102,7 @@ class Createdxf
int vAlign, int vAlign,
double xAlign, double xAlign,
double xScale, double xScale,
int colour, int colour);
bool leftAlign = false,
float scale = 0);
static int getcolorCode (const long red, static int getcolorCode (const long red,
+4 -6
View File
@@ -288,18 +288,16 @@ void ElementScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
\~French Dessine l'arriere-plan de l'editeur, cad l'indicateur de hotspot. \~French Dessine l'arriere-plan de l'editeur, cad l'indicateur de hotspot.
\~ @param p : The QPainter to use for drawing \~ @param p : The QPainter to use for drawing
\~French Le QPainter a utiliser pour dessiner \~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) { void ElementScene::drawForeground(QPainter *p, const QRectF &)
Q_UNUSED(rect); {
p -> save(); p -> save();
// desactive tout antialiasing, sauf pour le texte // desactive tout antialiasing, sauf pour le texte
p -> setRenderHint(QPainter::Antialiasing, false); p -> setRenderHint(QPainter::Antialiasing, false);
p -> setRenderHint(QPainter::TextAntialiasing, true); p -> setRenderHint(QPainter::TextAntialiasing, true);
p -> setRenderHint(QPainter::SmoothPixmapTransform, false); p -> setRenderHint(QPainter::SmoothPixmapTransform, false);
QPen pen(Qt::red); QPen pen(Qt::red);
pen.setCosmetic(true); pen.setCosmetic(true);
p -> setPen(pen); p -> setPen(pen);
+2 -3
View File
@@ -215,9 +215,8 @@ bool ElementsPanel::matchesFilter(const QTreeWidgetItem *item,
@param reload_collections : @param reload_collections :
true for read all collections since their sources (files, projects ...) true for read all collections since their sources (files, projects ...)
*/ */
void ElementsPanel::reload(bool reload_collections) { void ElementsPanel::reload()
Q_UNUSED(reload_collections); {
QIcon system_icon(":/ico/16x16/qet.png"); QIcon system_icon(":/ico/16x16/qet.png");
QIcon user_icon(":/ico/16x16/go-home.png"); QIcon user_icon(":/ico/16x16/go-home.png");
+1 -1
View File
@@ -57,7 +57,7 @@ class ElementsPanel : public GenericPanel {
public slots: public slots:
void slot_doubleClick(QTreeWidgetItem *, int); void slot_doubleClick(QTreeWidgetItem *, int);
void reload(bool = false); void reload();
void filter(const QString &, QET::Filtering = QET::RegularFilter); void filter(const QString &, QET::Filtering = QET::RegularFilter);
void projectWasOpened(QETProject *); void projectWasOpened(QETProject *);
void projectWasClosed(QETProject *); void projectWasClosed(QETProject *);
+8 -1
View File
@@ -25,6 +25,13 @@
#include "templatedeleter.h" #include "templatedeleter.h"
/* /*
When the ENABLE_PANEL_WIDGET_DND_CHECKS flag is set, the panel
performs checks during drag'n drop of items and categories.
For example, it checks that a target category is writable
before authorizing the drop of an element.
Removing this flag allows you to test the behavior of management functions
items (copy, move, etc.).
Lorsque le flag ENABLE_PANEL_WIDGET_DND_CHECKS est defini, le panel Lorsque le flag ENABLE_PANEL_WIDGET_DND_CHECKS est defini, le panel
effectue des verifications lors des drag'n drop d'elements et categories. effectue des verifications lors des drag'n drop d'elements et categories.
Par exemple, il verifie qu'une categorie cible est accessible en ecriture Par exemple, il verifie qu'une categorie cible est accessible en ecriture
@@ -152,7 +159,7 @@ void ElementsPanelWidget::copyPathForSelectedItem() {
*/ */
void ElementsPanelWidget::reloadAndFilter() { void ElementsPanelWidget::reloadAndFilter() {
// recharge tous les elements // recharge tous les elements
elements_panel -> reload(true); elements_panel -> reload();
// reapplique le filtre // reapplique le filtre
if (!filter_textfield -> text().isEmpty()) { if (!filter_textfield -> text().isEmpty()) {
elements_panel -> filter(filter_textfield -> text()); elements_panel -> filter(filter_textfield -> text());
+1 -7
View File
@@ -397,13 +397,11 @@ void ExportDialog::generateSvg(Diagram *diagram, int width, int height, bool kee
@param diagram Schema a exporter en DXF @param diagram Schema a exporter en DXF
@param width Largeur de l'export DXF @param width Largeur de l'export DXF
@param height Hauteur 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 @param file_path
*/ */
void ExportDialog::generateDxf(Diagram *diagram, void ExportDialog::generateDxf(Diagram *diagram,
int width, int width,
int height, int height,
bool keep_aspect_ratio,
QString &file_path) { QString &file_path) {
saveReloadDiagramParameters(diagram, true); saveReloadDiagramParameters(diagram, true);
@@ -427,10 +425,7 @@ void ExportDialog::generateDxf(Diagram *diagram,
double(height)*Createdxf::yScale, double(height)*Createdxf::yScale,
0); 0);
} }
diagram -> border_and_titleblock.drawDxf(width, diagram -> border_and_titleblock.drawDxf(file_path,
height,
keep_aspect_ratio,
file_path,
0); 0);
// Build the lists of elements. // Build the lists of elements.
@@ -809,7 +804,6 @@ void ExportDialog::exportDiagram(ExportDiagramLine *diagram_line) {
diagram_line -> diagram, diagram_line -> diagram,
diagram_line -> width -> value(), diagram_line -> width -> value(),
diagram_line -> height -> value(), diagram_line -> height -> value(),
diagram_line -> keep_ratio -> isChecked(),
diagram_path diagram_path
); );
} else { } else {
+1 -1
View File
@@ -89,7 +89,7 @@ class ExportDialog : public QDialog {
QWidget *initDiagramsListPart(); QWidget *initDiagramsListPart();
void saveReloadDiagramParameters(Diagram *, bool = true); void saveReloadDiagramParameters(Diagram *, bool = true);
void generateSvg(Diagram *, int, int, bool, QIODevice &); 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); QImage generateImage(Diagram *, int, int, bool);
void exportDiagram(ExportDiagramLine *); void exportDiagram(ExportDiagramLine *);
qreal diagramRatio(Diagram *); qreal diagramRatio(Diagram *);
+6 -7
View File
@@ -291,7 +291,7 @@ QTreeWidgetItem *GenericPanel::addDiagram(Diagram *diagram,
&creation_required); &creation_required);
updateDiagramItem(diagram_qtwi, diagram, options, creation_required); updateDiagramItem(diagram_qtwi, diagram, options, creation_required);
reparent(diagram_qtwi, parent_item); reparent(diagram_qtwi, parent_item);
fillDiagramItem(diagram_qtwi, diagram, options, creation_required); fillDiagramItem(diagram_qtwi, options, creation_required);
return(diagram_qtwi); return(diagram_qtwi);
} }
@@ -394,16 +394,15 @@ QTreeWidgetItem *GenericPanel::updateDiagramItem(QTreeWidgetItem *diagram_qtwi,
/** /**
@brief GenericPanel::fillDiagramItem @brief GenericPanel::fillDiagramItem
@param diagram_qtwi @param diagram_qtwi
@param diagram (unused)
@param options @param options
@param freshly_created @param freshly_created
@return fillItem(diagram_qtwi, options, freshly_created) @return fillItem(diagram_qtwi, options, freshly_created)
*/ */
QTreeWidgetItem *GenericPanel::fillDiagramItem(QTreeWidgetItem *diagram_qtwi, QTreeWidgetItem *GenericPanel::fillDiagramItem(
Diagram *diagram, QTreeWidgetItem *diagram_qtwi,
PanelOptions options, PanelOptions options,
bool freshly_created) { bool freshly_created)
Q_UNUSED(diagram) {
return(fillItem(diagram_qtwi, options, freshly_created)); return(fillItem(diagram_qtwi, options, freshly_created));
} }
+4 -4
View File
@@ -101,10 +101,10 @@ class GenericPanel : public QTreeWidget {
Diagram *, Diagram *,
PanelOptions = AddAllChild, PanelOptions = AddAllChild,
bool = false); bool = false);
virtual QTreeWidgetItem *fillDiagramItem (QTreeWidgetItem *, virtual QTreeWidgetItem *fillDiagramItem(
Diagram *, QTreeWidgetItem *,
PanelOptions = AddAllChild, PanelOptions = AddAllChild,
bool = false); bool = false);
// title block templates collections methods // title block templates collections methods
public: public:
+1
View File
@@ -81,6 +81,7 @@ void Machine_info::send_info_to_debug()
qInfo()<< "Qt library location Qt settings:" qInfo()<< "Qt library location Qt settings:"
<< QLibraryInfo::location(QLibraryInfo::SettingsPath); << QLibraryInfo::location(QLibraryInfo::SettingsPath);
#endif #endif
qInfo()<< "GitRevision " + QString(GIT_COMMIT_SHA);
qInfo()<< "QElectroTech V " + QET::displayedVersion; qInfo()<< "QElectroTech V " + QET::displayedVersion;
qInfo()<< tr("Compilation : ") + pc.built.version; qInfo()<< tr("Compilation : ") + pc.built.version;
qInfo()<< "Built with Qt " + pc.built.QT qInfo()<< "Built with Qt " + pc.built.QT
+29
View File
@@ -22,6 +22,9 @@
#include "machine_info.h" #include "machine_info.h"
#include <QStyleFactory> #include <QStyleFactory>
#include <QtCore>
#include <QtWidgets>
/** /**
@brief myMessageOutput @brief myMessageOutput
for debugging for debugging
@@ -204,6 +207,32 @@ int main(int argc, char **argv)
delete my_ma; delete my_ma;
} }
if(! QET::FileFormatStable){
QMessageBox::StandardButton btn = QMessageBox::critical(
nullptr,
QCoreApplication::translate(
"main",
"Unstable file format!"),
QCoreApplication::translate(
"main",
"<p><b>ATTENTION: This application version is UNSTABLE!</b></p>"
"<p>Everything you do with this application can break your "
"workspace, libraries or projects! Saved files will not be "
"readable with stable releases of QElectroTech. It's highly "
"recommended to create a backup before proceeding. If you are "
"unsure, please download an official stable release instead.</p>"
// "<p>For details, please take a look at QElectroTech's "
// "<a href=\"%1\">versioning concept</a>.</p>"
"<p>Are you really sure to continue with the risk of breaking your "
"files?!</p>","this text is not finished yet, expect changes!")
.arg("doc_release_workflow"),
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
if (!(btn == QMessageBox::Yes))
return 1;
}
return app.exec(); return app.exec();
} }
+9
View File
@@ -28,10 +28,19 @@ class QActionGroup;
anywhere else within the QElectroTech application. anywhere else within the QElectroTech application.
*/ */
namespace QET { namespace QET {
/// Read the release workflow documentation
/// before making changes here!!!
/// QElectroTech version (as string, used to mark projects and elements XML documents) /// QElectroTech version (as string, used to mark projects and elements XML documents)
const QString version = "0.80"; const QString version = "0.80";
/// QElectroTech displayed version /// QElectroTech displayed version
const QString displayedVersion = "0.80-DEV"; const QString displayedVersion = "0.80-DEV";
/**
@brief FileFormatStable
- On all non-release branches: false
- On release branches: true
*/
const bool FileFormatStable = false;
QString license(); QString license();
//Describe the current state of a graphic item //Describe the current state of a graphic item
+56 -102
View File
@@ -2306,110 +2306,64 @@ void QETDiagramEditor::generateTerminalBlock()
} }
#endif #endif
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
if ( !success ) { QString message=QObject::tr(
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) "To install the plugin qet_tb_generator"
QMessageBox::warning(nullptr, "<br>Visit :"
tr("Error launching qet_tb_generator plugin"), "<br>"
QObject::tr("To install the plugin qet_tb_generator" "<a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a>"
"<br>" "<br>Requires python 3.5 or above."
"Visit :" "<br><B><U> First install on Windows</B></U>"
"<br>" "<br>1. Install, if required, python 3.5 or above"
"<a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a>" "<br> Visit :"
"<br>" "<br>"
"Requires python 3.5 or above." "<a href='https://www.python.org/downloads/'>python.org</a>"
"<br>" "<br>2. pip install qet_tb_generator"
"<B>""<U>" "<br><B><U> Update on Windows</B></U>"
" First install on Windows" "<br>python -m pip install --upgrade qet_tb_generator"
"</B>""</U>" "<br>"
"<br>" ">>user could launch in a terminal this script in this directory"
"1. Install, if required, python 3.5 or above" "<br>"
"<br>" " C:\\users\\XXXX\\AppData\\Local\\Programs\\Python\\Python36-32\\Scripts "
" Visit :" "<br>");
"<br>"
"<a href='https://www.python.org/downloads/'>python.org</a>"
"<br>"
"2. pip install qet_tb_generator"
"<br>"
"<B>""<U>"
" Update on Windows"
"</B>""</U>"
"<br>"
"python -m pip install --upgrade qet_tb_generator"
"<br>"
">>user could launch in a terminal this script in this directory"
"<br>"
" C:\\users\\XXXX\\AppData\\Local\\Programs\\Python\\Python36-32\\Scripts "
"<br>"
));
}
}
#elif defined(Q_OS_MAC) #elif defined(Q_OS_MAC)
QMessageBox::warning(nullptr, QString message=QObject::tr(
QObject::tr("Error launching qet_tb_generator plugin"), "To install the plugin qet_tb_generator"
QObject::tr("To install the plugin qet_tb_generator" "<br>Visit :"
"<br>" "<br>"
"Visit :" "<a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a>"
"<br>" "<br><B><U> First install on macOSX</B></U>"
"<a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a>" "<br>1. Install, if required, python 3.8 bundle only, "
"<br>" "because program use hardcoded PATH for localise qet-tb-generator plugin "
"<B>""<U>" "<br> Visit :"
" First install on macOSX" "<br>"
"</B>""</U>" "<a href='https://qelectrotech.org/forum/viewtopic.php?pid=5674#p5674'>howto</a>"
"<br>" "<br>2. pip3 install qet_tb_generator"
"1. Install, if required, python 3.8 bundle only, because program use hardcoded PATH for localise qet-tb-generator plugin " "<br><B><U> Update on macOSX</B></U>"
"<br>" "<br> pip3 install --upgrade qet_tb_generator"
" Visit :" "<br>");
"<br>"
"<a href='https://qelectrotech.org/forum/viewtopic.php?pid=5674#p5674'>howto</a>"
"<br>"
"2. pip3 install qet_tb_generator"
"<br>"
"<B>""<U>"
" Update on macOSX"
"</B>""</U>"
"<br>"
" pip3 install --upgrade qet_tb_generator"
"<br>"
));
}
}
#else #else
QString message=QObject::tr(
"To install the plugin qet_tb_generator"
"<br>Visit :"
"<br>"
"<a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a>"
"<br>"
"<br>Requires python 3.5 or above."
"<br>"
"<br><B><U> First install on Linux</B>""</U>"
"<br>1. check you have pip3 installed: pip3 --version"
"<br>If not install with: sudo apt-get install python3-pip"
"<br>2. Install the program: sudo pip3 install qet_tb_generator"
"<br>3. Run the program: qet_tb_generator"
"<br>"
"<br><B>""<U> Update on Linux</B>""</U>"
"<br>sudo pip3 install --upgrade qet_tb_generator"
"<br>");
#endif
if ( !success ) {
QMessageBox::warning(nullptr, QMessageBox::warning(nullptr,
QObject::tr("Error launching qet_tb_generator plugin"), QObject::tr("Error launching qet_tb_generator plugin"),
QObject::tr("To install the plugin qet_tb_generator" message);
"<br>"
"Visit : "
"<br>"
"<a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a>"
"<br>"
"<br>"
"Requires python 3.5 or above."
"<br>"
"<br>"
"<B>""<U>"
" First install on Linux"
"</B>""</U>"
"<br>"
"1. check you have pip3 installed: pip3 --version"
"<br>"
"If not install with: sudo apt-get install python3-pip"
"<br>"
"2. Install the program: sudo pip3 install qet_tb_generator"
"<br>"
"3. Run the program: qet_tb_generator"
"<br>"
"<br>"
"<B>""<U>"
" Update on Linux"
"</B>""</U>"
"<br>"
"sudo pip3 install --upgrade qet_tb_generator"
"<br>"
));
} }
} }
#endif
@@ -243,9 +243,10 @@ void ConductorTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *e) {
change m_mouse_hover to false(used in paint() function ) change m_mouse_hover to false(used in paint() function )
@param e QGraphicsSceneHoverEvent @param e QGraphicsSceneHoverEvent
*/ */
void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) { void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e)
{
Q_UNUSED(e); Q_UNUSED(e);
//qDebug() << "Leave mouse over"; qDebug() << "Leave mouse over";
m_mouse_hover = false; m_mouse_hover = false;
update(); update();
} }
@@ -254,7 +255,7 @@ void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) {
Do nothing default function . Do nothing default function .
@param e QGraphicsSceneHoverEvent @param e QGraphicsSceneHoverEvent
*/ */
void ConductorTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *e) { void ConductorTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *e)
Q_UNUSED(e); {
QGraphicsTextItem::hoverMoveEvent(e); QGraphicsTextItem::hoverMoveEvent(e);
} }
+10 -18
View File
@@ -295,9 +295,10 @@ QPainterPath QetShapeItem::shape() const
@param option @param option
@param widget @param widget
*/ */
void QetShapeItem::paint(QPainter *painter, void QetShapeItem::paint(
const QStyleOptionGraphicsItem *option, QPainter *painter,
QWidget *widget) const QStyleOptionGraphicsItem *option,
QWidget *widget)
{ {
Q_UNUSED(option) Q_UNUSED(option)
Q_UNUSED(widget) Q_UNUSED(widget)
@@ -425,17 +426,17 @@ bool QetShapeItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{ {
if(event->type() == QEvent::GraphicsSceneMousePress) //Click if(event->type() == QEvent::GraphicsSceneMousePress) //Click
{ {
handlerMousePressEvent(qghi, static_cast<QGraphicsSceneMouseEvent *>(event)); handlerMousePressEvent();
return true; return true;
} }
else if(event->type() == QEvent::GraphicsSceneMouseMove) //Move else if(event->type() == QEvent::GraphicsSceneMouseMove) //Move
{ {
handlerMouseMoveEvent(qghi, static_cast<QGraphicsSceneMouseEvent *>(event)); handlerMouseMoveEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
return true; return true;
} }
else if (event->type() == QEvent::GraphicsSceneMouseRelease) //Release else if (event->type() == QEvent::GraphicsSceneMouseRelease) //Release
{ {
handlerMouseReleaseEvent(qghi, static_cast<QGraphicsSceneMouseEvent *>(event)); handlerMouseReleaseEvent();
return true; return true;
} }
} }
@@ -703,11 +704,8 @@ void QetShapeItem::removePoint()
@param qghi @param qghi
@param event @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_P1 = m_P1;
m_old_P2 = m_P2; m_old_P2 = m_P2;
m_old_polygon = m_polygon; m_old_polygon = m_polygon;
@@ -720,13 +718,10 @@ void QetShapeItem::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphic
/** /**
@brief QetShapeItem::handlerMouseMoveEvent @brief QetShapeItem::handlerMouseMoveEvent
@param qghi
@param event @param event
*/ */
void QetShapeItem::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event) void QetShapeItem::handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
Q_UNUSED(qghi)
QPointF new_pos = event->scenePos(); QPointF new_pos = event->scenePos();
if (event->modifiers() != Qt::ControlModifier) if (event->modifiers() != Qt::ControlModifier)
new_pos = Diagram::snapToGrid(event->scenePos()); new_pos = Diagram::snapToGrid(event->scenePos());
@@ -787,11 +782,8 @@ void QetShapeItem::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphics
@param qghi @param qghi
@param event @param event
*/ */
void QetShapeItem::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event) void QetShapeItem::handlerMouseReleaseEvent()
{ {
Q_UNUSED(qghi);
Q_UNUSED(event);
m_modifie_radius_equaly = false; m_modifie_radius_equaly = false;
if (diagram()) if (diagram())
+3 -3
View File
@@ -121,9 +121,9 @@ class QetShapeItem : public QetGraphicsItem
void insertPoint(); void insertPoint();
void removePoint(); void removePoint();
void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMousePressEvent();
void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event);
void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseReleaseEvent();
///ATTRIBUTES ///ATTRIBUTES
private: private:
+1 -3
View File
@@ -1858,9 +1858,7 @@ void TitleBlockTemplate::renderTextCellDxf(QString &file_path,
vAlign, vAlign,
x2, x2,
ratio, ratio,
color, color);
cell.alignment & Qt::AlignLeft,
0);
} }
/** /**