mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Add TODO compile var + Fix doxygen issue
You can make your code warn on compile time for the TODO's In order to do so, uncomment the following line. in pro file DEFINES += TODO_LIST
This commit is contained in:
@@ -27,7 +27,9 @@
|
||||
#include <QtCore/QSharedMemory>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) // ### Qt 6: remove
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.10 or later")
|
||||
#endif
|
||||
#include <QRandomGenerator>
|
||||
#endif
|
||||
#include "singleapplication.h"
|
||||
@@ -107,7 +109,9 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
|
||||
qsrand( QDateTime::currentMSecsSinceEpoch() % std::numeric_limits<uint>::max() );
|
||||
QThread::sleep( 8 + static_cast <unsigned long>( static_cast <float>( qrand() ) / RAND_MAX * 10 ) );
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.10 or later")
|
||||
#endif
|
||||
quint32 value = QRandomGenerator::global()->generate();
|
||||
QThread::sleep( 8 + static_cast <unsigned long>( static_cast <float>( value ) / RAND_MAX * 10 ) );
|
||||
#endif
|
||||
|
||||
109
qelectrotech.pro
109
qelectrotech.pro
@@ -4,51 +4,51 @@
|
||||
|
||||
# Chemins utilises pour la compilation et l'installation de QET
|
||||
unix {
|
||||
# Chemins UNIX
|
||||
COMPIL_PREFIX = '/usr/local/'
|
||||
INSTALL_PREFIX = '/usr/local/'
|
||||
QET_BINARY_PATH = 'bin/'
|
||||
QET_COMMON_COLLECTION_PATH = 'share/qelectrotech/elements/'
|
||||
QET_COMMON_TBT_PATH = 'share/qelectrotech/titleblocks/'
|
||||
QET_LANG_PATH = 'share/qelectrotech/lang/'
|
||||
QET_EXAMPLES_PATH = 'share/qelectrotech/examples/'
|
||||
QET_LICENSE_PATH = 'doc/qelectrotech/'
|
||||
QET_MIME_XML_PATH = '../share/mime/application/'
|
||||
QET_MIME_DESKTOP_PATH = '../share/mimelnk/application/'
|
||||
QET_MIME_PACKAGE_PATH = '../share/mime/packages/'
|
||||
QET_DESKTOP_PATH = 'share/applications/'
|
||||
QET_ICONS_PATH = 'share/icons/hicolor/'
|
||||
QET_MAN_PATH = 'man/'
|
||||
QET_APPDATA_PATH = 'share/appdata'
|
||||
# Chemins UNIX
|
||||
COMPIL_PREFIX = '/usr/local/'
|
||||
INSTALL_PREFIX = '/usr/local/'
|
||||
QET_BINARY_PATH = 'bin/'
|
||||
QET_COMMON_COLLECTION_PATH = 'share/qelectrotech/elements/'
|
||||
QET_COMMON_TBT_PATH = 'share/qelectrotech/titleblocks/'
|
||||
QET_LANG_PATH = 'share/qelectrotech/lang/'
|
||||
QET_EXAMPLES_PATH = 'share/qelectrotech/examples/'
|
||||
QET_LICENSE_PATH = 'doc/qelectrotech/'
|
||||
QET_MIME_XML_PATH = '../share/mime/application/'
|
||||
QET_MIME_DESKTOP_PATH = '../share/mimelnk/application/'
|
||||
QET_MIME_PACKAGE_PATH = '../share/mime/packages/'
|
||||
QET_DESKTOP_PATH = 'share/applications/'
|
||||
QET_ICONS_PATH = 'share/icons/hicolor/'
|
||||
QET_MAN_PATH = 'man/'
|
||||
QET_APPDATA_PATH = 'share/appdata'
|
||||
}
|
||||
win32 {
|
||||
# Chemins Windows
|
||||
COMPIL_PREFIX = './'
|
||||
INSTALL_PREFIX = './'
|
||||
QET_BINARY_PATH = './'
|
||||
QET_COMMON_COLLECTION_PATH = 'elements/'
|
||||
QET_COMMON_TBT_PATH = 'titleblocks/'
|
||||
QET_LANG_PATH = 'lang/'
|
||||
QET_LICENSE_PATH = './'
|
||||
# Liste des ressources Windows
|
||||
# Chemins Windows
|
||||
COMPIL_PREFIX = './'
|
||||
INSTALL_PREFIX = './'
|
||||
QET_BINARY_PATH = './'
|
||||
QET_COMMON_COLLECTION_PATH = 'elements/'
|
||||
QET_COMMON_TBT_PATH = 'titleblocks/'
|
||||
QET_LANG_PATH = 'lang/'
|
||||
QET_LICENSE_PATH = './'
|
||||
# Liste des ressources Windows
|
||||
#RC_FILE = qelectrotech.rc
|
||||
}
|
||||
macx {
|
||||
# Chemins MacOS X
|
||||
COMPIL_PREFIX = './'
|
||||
INSTALL_PREFIX = '/usr/local/'
|
||||
QET_BINARY_PATH = 'bin/'
|
||||
QET_COMMON_COLLECTION_PATH = '../Resources/elements/'
|
||||
QET_COMMON_TBT_PATH = '../Resources/titleblocks/'
|
||||
QET_LANG_PATH = '../Resources/lang/'
|
||||
QET_EXAMPLES_PATH = 'share/qelectrotech/examples/'
|
||||
QET_LICENSE_PATH = 'doc/qelectrotech/'
|
||||
QET_MIME_XML_PATH = '../share/mime/application/'
|
||||
QET_MIME_DESKTOP_PATH = '../share/mimelnk/application/'
|
||||
QET_DESKTOP_PATH = 'share/applications/'
|
||||
QET_ICONS_PATH = 'share/icons/hicolor/'
|
||||
QET_MAN_PATH = 'man/'
|
||||
ICON = 'ico/mac_icon/qelectrotech.icns'
|
||||
# Chemins MacOS X
|
||||
COMPIL_PREFIX = './'
|
||||
INSTALL_PREFIX = '/usr/local/'
|
||||
QET_BINARY_PATH = 'bin/'
|
||||
QET_COMMON_COLLECTION_PATH = '../Resources/elements/'
|
||||
QET_COMMON_TBT_PATH = '../Resources/titleblocks/'
|
||||
QET_LANG_PATH = '../Resources/lang/'
|
||||
QET_EXAMPLES_PATH = 'share/qelectrotech/examples/'
|
||||
QET_LICENSE_PATH = 'doc/qelectrotech/'
|
||||
QET_MIME_XML_PATH = '../share/mime/application/'
|
||||
QET_MIME_DESKTOP_PATH = '../share/mimelnk/application/'
|
||||
QET_DESKTOP_PATH = 'share/applications/'
|
||||
QET_ICONS_PATH = 'share/icons/hicolor/'
|
||||
QET_MAN_PATH = 'man/'
|
||||
ICON = 'ico/mac_icon/qelectrotech.icns'
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,14 @@ include(sources/QWidgetAnimation/QWidgetAnimation.pri)
|
||||
DEFINES += QAPPLICATION_CLASS=QApplication
|
||||
DEFINES += QT_MESSAGELOGCONTEXT
|
||||
DEFINES += GIT_COMMIT_SHA="\\\"$(shell git -C \""$$_PRO_FILE_PWD_"\" rev-parse --verify HEAD)\\\""
|
||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000
|
||||
|
||||
# You can make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
# You can make your code warn on compile time for the TODO's
|
||||
# In order to do so, uncomment the following line.
|
||||
#DEFINES += TODO_LIST
|
||||
|
||||
TEMPLATE = app
|
||||
DEPENDPATH += .
|
||||
@@ -268,28 +275,28 @@ man.extra = sh man/compress_man_pages.sh
|
||||
INSTALLS += target elements tbt lang copyright
|
||||
# Sous Unix, on installe egalement l'icone, un fichier .desktop, des fichiers mime et les pages de manuel
|
||||
unix {
|
||||
INSTALLS += desktop mime_xml mime_desktop mime_package icons man examples appdata
|
||||
INSTALLS += desktop mime_xml mime_desktop mime_package icons man examples appdata
|
||||
}
|
||||
|
||||
# Options de compilation communes a Unix et MacOS X
|
||||
unix {
|
||||
# Chemin des fichiers de traduction ; par defaut : lang/ dans le repertoire d'execution
|
||||
DEFINES += QET_LANG_PATH=$$join(COMPIL_PREFIX,,,$${QET_LANG_PATH})
|
||||
# Chemin des fichiers de traduction ; par defaut : lang/ dans le repertoire d'execution
|
||||
DEFINES += QET_LANG_PATH=$$join(COMPIL_PREFIX,,,$${QET_LANG_PATH})
|
||||
|
||||
# Chemin de la collection commune ; par defaut : elements/ dans le repertoire d'execution
|
||||
DEFINES += QET_COMMON_COLLECTION_PATH=$$join(COMPIL_PREFIX,,,$${QET_COMMON_COLLECTION_PATH})
|
||||
# Chemin de la collection commune ; par defaut : elements/ dans le repertoire d'execution
|
||||
DEFINES += QET_COMMON_COLLECTION_PATH=$$join(COMPIL_PREFIX,,,$${QET_COMMON_COLLECTION_PATH})
|
||||
|
||||
DEFINES += QET_COMMON_TBT_PATH=$$join(COMPIL_PREFIX,,,$${QET_COMMON_TBT_PATH})
|
||||
DEFINES += QET_COMMON_TBT_PATH=$$join(COMPIL_PREFIX,,,$${QET_COMMON_TBT_PATH})
|
||||
}
|
||||
|
||||
# Options de compilation specifiques a MacOS X
|
||||
macx {
|
||||
# les chemins definis precedemment sont relatifs au dossier contenant le binaire executable
|
||||
DEFINES += QET_LANG_PATH_RELATIVE_TO_BINARY_PATH
|
||||
DEFINES += QET_COMMON_COLLECTION_PATH_RELATIVE_TO_BINARY_PATH
|
||||
# les chemins definis precedemment sont relatifs au dossier contenant le binaire executable
|
||||
DEFINES += QET_LANG_PATH_RELATIVE_TO_BINARY_PATH
|
||||
DEFINES += QET_COMMON_COLLECTION_PATH_RELATIVE_TO_BINARY_PATH
|
||||
}
|
||||
|
||||
# Compilers-specific options
|
||||
unix {
|
||||
QMAKE_COPY_DIR = 'cp -f -r --preserve=timestamps'
|
||||
QMAKE_COPY_DIR = 'cp -f -r --preserve=timestamps'
|
||||
}
|
||||
|
||||
@@ -744,7 +744,9 @@ void ElementsCollectionWidget::search()
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QStringList text_list = text.split("+", QString::SkipEmptyParts);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
QStringList text_list = text.split("+", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
QModelIndexList match_index;
|
||||
|
||||
@@ -70,7 +70,9 @@ bool ConductorNumExport::toCsv()
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove
|
||||
stream << wiresNum() << endl;
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.15 or later")
|
||||
#endif
|
||||
stream << wiresNum() << &Qt::endl(stream);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -368,7 +368,9 @@ void ConductorProperties::fromXml(QDomElement &e)
|
||||
//Keep retrocompatible with version older than 0,4
|
||||
//If the propertie @type is simple (removed since QET 0,4), we set text no visible.
|
||||
//@TODO remove this code for qet 0.6 or later
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove this code for qet 0.6 or later")
|
||||
#endif
|
||||
if (e.attribute("type") == "simple") m_show_text = false;
|
||||
}
|
||||
|
||||
@@ -786,7 +788,9 @@ void ConductorProperties::readStyle(const QString &style_string) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QStringList styles = style_string.split(";", QString::SkipEmptyParts);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code QString::SkipEmptyParts for QT 5.14 or later")
|
||||
#endif
|
||||
QStringList styles = style_string.split(";", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -687,51 +687,51 @@ void Createdxf::drawArc(
|
||||
@param height
|
||||
@param rotation
|
||||
@param colour
|
||||
@param xScale=1
|
||||
@param xScaleW = 1
|
||||
*/
|
||||
void Createdxf::drawText(
|
||||
const QString& fileName,
|
||||
const QString& text,
|
||||
double x,
|
||||
double y,
|
||||
double height,
|
||||
double rotation,
|
||||
int colour,
|
||||
double xScaleW)
|
||||
const QString& fileName,
|
||||
const QString& text,
|
||||
double x,
|
||||
double y,
|
||||
double height,
|
||||
double rotation,
|
||||
int colour,
|
||||
double xScaleW)
|
||||
{
|
||||
if (!fileName.isEmpty()) {
|
||||
QFile file(fileName);
|
||||
if (!file.open(QFile::Append)) {
|
||||
// error message
|
||||
QMessageBox errorFileOpen;
|
||||
errorFileOpen.setText("Error: File "+fileName+" was not written correctly.");
|
||||
errorFileOpen.setInformativeText("Close all Files and Re-Run");
|
||||
errorFileOpen.exec();
|
||||
} else {
|
||||
QTextStream To_Dxf(&file);
|
||||
// Draw the text
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "TEXT" << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n"; // Layer number (default layer in autocad)
|
||||
To_Dxf << 62 << "\r\n";
|
||||
To_Dxf << colour << "\r\n"; // Colour Code
|
||||
To_Dxf << 10 << "\r\n"; // XYZ
|
||||
To_Dxf << x << "\r\n"; // X in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 20 << "\r\n";
|
||||
To_Dxf << y << "\r\n"; // Y in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 30 << "\r\n";
|
||||
To_Dxf << 0.0 << "\r\n"; // Z in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 40 << "\r\n";
|
||||
To_Dxf << height << "\r\n"; // Text Height
|
||||
To_Dxf << 41 << "\r\n";
|
||||
To_Dxf << xScaleW << "\r\n"; // X Scale
|
||||
To_Dxf << 1 << "\r\n";
|
||||
To_Dxf << text << "\r\n"; // Text Value
|
||||
To_Dxf << 50 << "\r\n";
|
||||
To_Dxf << rotation << "\r\n"; // Text Rotation
|
||||
file.close();
|
||||
}
|
||||
QFile file(fileName);
|
||||
if (!file.open(QFile::Append)) {
|
||||
// error message
|
||||
QMessageBox errorFileOpen;
|
||||
errorFileOpen.setText("Error: File "+fileName+" was not written correctly.");
|
||||
errorFileOpen.setInformativeText("Close all Files and Re-Run");
|
||||
errorFileOpen.exec();
|
||||
} else {
|
||||
QTextStream To_Dxf(&file);
|
||||
// Draw the text
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "TEXT" << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n"; // Layer number (default layer in autocad)
|
||||
To_Dxf << 62 << "\r\n";
|
||||
To_Dxf << colour << "\r\n"; // Colour Code
|
||||
To_Dxf << 10 << "\r\n"; // XYZ
|
||||
To_Dxf << x << "\r\n"; // X in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 20 << "\r\n";
|
||||
To_Dxf << y << "\r\n"; // Y in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 30 << "\r\n";
|
||||
To_Dxf << 0.0 << "\r\n"; // Z in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 40 << "\r\n";
|
||||
To_Dxf << height << "\r\n"; // Text Height
|
||||
To_Dxf << 41 << "\r\n";
|
||||
To_Dxf << xScaleW << "\r\n"; // X Scale
|
||||
To_Dxf << 1 << "\r\n";
|
||||
To_Dxf << text << "\r\n"; // Text Value
|
||||
To_Dxf << 50 << "\r\n";
|
||||
To_Dxf << rotation << "\r\n"; // Text Rotation
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -749,7 +749,7 @@ void Createdxf::drawTextAligned(
|
||||
int hAlign,
|
||||
int vAlign,
|
||||
double xAlign,
|
||||
double xScaleW,
|
||||
double xScaleW,
|
||||
int colour)
|
||||
{
|
||||
if (!fileName.isEmpty()) {
|
||||
@@ -778,7 +778,7 @@ void Createdxf::drawTextAligned(
|
||||
To_Dxf << 40 << "\r\n";
|
||||
To_Dxf << height << "\r\n"; // Text Height
|
||||
To_Dxf << 41 << "\r\n";
|
||||
To_Dxf << xScaleW << "\r\n"; // X Scale
|
||||
To_Dxf << xScaleW << "\r\n"; // X Scale
|
||||
To_Dxf << 1 << "\r\n";
|
||||
To_Dxf << text << "\r\n"; // Text Value
|
||||
To_Dxf << 50 << "\r\n";
|
||||
@@ -819,76 +819,78 @@ void Createdxf::drawTextAligned(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Createdxf::drawPolyline
|
||||
Convenience function for draw polyline
|
||||
@param filepath
|
||||
@param poly
|
||||
@param colorcode
|
||||
@brief Createdxf::drawPolyline
|
||||
Convenience function for draw polyline
|
||||
@param filepath
|
||||
@param poly
|
||||
@param colorcode
|
||||
@param preScaled
|
||||
*/
|
||||
void Createdxf::drawPolyline(const QString &filepath,
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode, bool preScaled)
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode, bool preScaled)
|
||||
{
|
||||
qreal x,y;
|
||||
if (!filepath.isEmpty()) {
|
||||
QFile file(filepath);
|
||||
if (!file.open(QFile::Append)) {
|
||||
// error message
|
||||
QMessageBox errorFileOpen;
|
||||
errorFileOpen.setText("Error: File "+filepath+" was not written correctly.");
|
||||
errorFileOpen.setInformativeText("Close all Files and Re-Run");
|
||||
errorFileOpen.exec();
|
||||
} else {
|
||||
QTextStream To_Dxf(&file);
|
||||
// Draw the Line
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "POLYLINE" << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n"; // Layer number (default layer in autocad)
|
||||
To_Dxf << 62 << "\r\n";
|
||||
To_Dxf << colorcode << "\r\n"; // Colour Code
|
||||
To_Dxf << 66 << "\r\n";
|
||||
To_Dxf << 1 << "\r\n";
|
||||
To_Dxf << 70 << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 10 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << 20 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << 30 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n";
|
||||
foreach(QPointF p, poly)
|
||||
{
|
||||
if(preScaled) {
|
||||
x = p.x();
|
||||
y = p.y();
|
||||
} else {
|
||||
x = p.x() * xScale;
|
||||
y = sheetHeight - (p.y() * yScale);
|
||||
}
|
||||
QFile file(filepath);
|
||||
if (!file.open(QFile::Append)) {
|
||||
// error message
|
||||
QMessageBox errorFileOpen;
|
||||
errorFileOpen.setText("Error: File "+filepath+" was not written correctly.");
|
||||
errorFileOpen.setInformativeText("Close all Files and Re-Run");
|
||||
errorFileOpen.exec();
|
||||
} else {
|
||||
QTextStream To_Dxf(&file);
|
||||
// Draw the Line
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "POLYLINE" << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n"; // Layer number (default layer in autocad)
|
||||
To_Dxf << 62 << "\r\n";
|
||||
To_Dxf << colorcode << "\r\n"; // Colour Code
|
||||
To_Dxf << 66 << "\r\n";
|
||||
To_Dxf << 1 << "\r\n";
|
||||
To_Dxf << 70 << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 10 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << 20 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << 30 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n";
|
||||
foreach(QPointF p, poly)
|
||||
{
|
||||
if(preScaled) {
|
||||
x = p.x();
|
||||
y = p.y();
|
||||
} else {
|
||||
x = p.x() * xScale;
|
||||
y = sheetHeight - (p.y() * yScale);
|
||||
}
|
||||
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "VERTEX" << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n"; // Layer number (default layer in autocad)
|
||||
To_Dxf << 70 << "\r\n";
|
||||
To_Dxf << 32 << "\r\n";
|
||||
To_Dxf << 10 << "\r\n";
|
||||
To_Dxf << x << "\r\n"; // X in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 20 << "\r\n";
|
||||
To_Dxf << y << "\r\n"; // Y in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 30 << "\r\n";
|
||||
To_Dxf << 0.0 << "\r\n"; // Z in UCS (User Coordinate System)coordinates
|
||||
}
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "VERTEX" << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n"; // Layer number (default layer in autocad)
|
||||
To_Dxf << 70 << "\r\n";
|
||||
To_Dxf << 32 << "\r\n";
|
||||
To_Dxf << 10 << "\r\n";
|
||||
To_Dxf << x << "\r\n"; // X in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 20 << "\r\n";
|
||||
To_Dxf << y << "\r\n"; // Y in UCS (User Coordinate System)coordinates
|
||||
To_Dxf << 30 << "\r\n";
|
||||
To_Dxf << 0.0 << "\r\n"; // Z in UCS (User Coordinate System)coordinates
|
||||
}
|
||||
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "SEQEND" << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n"; // Layer number (default layer in autocad)
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "SEQEND" << "\r\n";
|
||||
To_Dxf << 8 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n"; // Layer number (default layer in autocad)
|
||||
|
||||
file.close();
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -899,63 +901,63 @@ void Createdxf::drawPolyline(const QString &filepath,
|
||||
* ================================================
|
||||
*/
|
||||
/**
|
||||
@brief Createdxf::drawCircle
|
||||
draw circle in qt format
|
||||
@param fileName
|
||||
@param center
|
||||
@param radius
|
||||
@param colour
|
||||
@brief Createdxf::drawCircle
|
||||
draw circle in qt format
|
||||
@param fileName
|
||||
@param center
|
||||
@param radius
|
||||
@param colour
|
||||
*/
|
||||
void Createdxf::drawCircle(
|
||||
const QString& fileName,
|
||||
QPointF centre,
|
||||
double radius,
|
||||
int colour)
|
||||
const QString& fileName,
|
||||
QPointF center,
|
||||
double radius,
|
||||
int colour)
|
||||
{
|
||||
qreal x = centre.x() * xScale;
|
||||
qreal y = sheetHeight - centre.y() * yScale;
|
||||
qreal r = radius * xScale;
|
||||
drawCircle(fileName,r,x,y,colour);
|
||||
qreal x = center.x() * xScale;
|
||||
qreal y = sheetHeight - center.y() * yScale;
|
||||
qreal r = radius * xScale;
|
||||
drawCircle(fileName,r,x,y,colour);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Createdxf::drawLine
|
||||
Convenience function to draw line
|
||||
@param filepath
|
||||
@param line
|
||||
@param colorcode
|
||||
@brief Createdxf::drawLine
|
||||
Convenience function to draw line
|
||||
@param filepath
|
||||
@param line
|
||||
@param colorcode
|
||||
*/
|
||||
void Createdxf::drawLine(
|
||||
const QString &filepath,
|
||||
const QLineF &line,
|
||||
const int &colorcode)
|
||||
const QString &filepath,
|
||||
const QLineF &line,
|
||||
const int &colorcode)
|
||||
{
|
||||
drawLine(filepath, line.p1().x() * xScale,
|
||||
sheetHeight - (line.p1().y() * yScale),
|
||||
line.p2().x() * xScale,
|
||||
sheetHeight - (line.p2().y() * yScale),
|
||||
colorcode);
|
||||
drawLine(filepath, line.p1().x() * xScale,
|
||||
sheetHeight - (line.p1().y() * yScale),
|
||||
line.p2().x() * xScale,
|
||||
sheetHeight - (line.p2().y() * yScale),
|
||||
colorcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Createdxf::drawEllipse
|
||||
Conveniance function for draw ellipse
|
||||
@param filepath
|
||||
@param rect
|
||||
@param colorcode
|
||||
@brief Createdxf::drawEllipse
|
||||
Conveniance function for draw ellipse
|
||||
@param filepath
|
||||
@param rect
|
||||
@param colorcode
|
||||
*/
|
||||
void Createdxf::drawEllipse(
|
||||
const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode)
|
||||
const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode)
|
||||
{
|
||||
drawArcEllipse(
|
||||
filepath,
|
||||
rect.topLeft().x() * xScale,
|
||||
sheetHeight - (rect.topLeft().y() * yScale),
|
||||
rect.width() * xScale,
|
||||
rect.height() * yScale,
|
||||
0, 360, 0, 0, 0, colorcode);
|
||||
filepath,
|
||||
rect.topLeft().x() * xScale,
|
||||
sheetHeight - (rect.topLeft().y() * yScale),
|
||||
rect.width() * xScale,
|
||||
rect.height() * yScale,
|
||||
0, 360, 0, 0, 0, colorcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -966,9 +968,9 @@ void Createdxf::drawEllipse(
|
||||
@param colorcode
|
||||
*/
|
||||
void Createdxf::drawRectangle(
|
||||
const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode) {
|
||||
const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode) {
|
||||
//QPolygonF poly(scaleRect(rect));
|
||||
QPolygonF poly(rect);
|
||||
drawPolyline(filepath,poly,colorcode);
|
||||
@@ -982,49 +984,49 @@ void Createdxf::drawRectangle(
|
||||
@param colorcode
|
||||
*/
|
||||
void Createdxf::drawPolygon(
|
||||
const QString &filepath,
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode)
|
||||
const QString &filepath,
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode)
|
||||
{
|
||||
QPolygonF pg = poly;
|
||||
if(!poly.isClosed()) {
|
||||
pg << poly.at(0); // Close it
|
||||
pg << poly.at(0); // Close it
|
||||
}
|
||||
drawPolyline(filepath,pg,colorcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Createdxf::drawText
|
||||
draw simple text in dxf format without any alignment specified
|
||||
@param fileName
|
||||
@param text
|
||||
@param point
|
||||
@param height
|
||||
@param rotation
|
||||
@param colour
|
||||
@param xScaleW=1
|
||||
@brief Createdxf::drawText
|
||||
draw simple text in dxf format without any alignment specified
|
||||
@param fileName
|
||||
@param text
|
||||
@param point
|
||||
@param height
|
||||
@param rotation
|
||||
@param colour
|
||||
@param xScaleW = 1
|
||||
*/
|
||||
void Createdxf::drawText(
|
||||
const QString& fileName,
|
||||
const QString& text,
|
||||
QPointF point,
|
||||
double height,
|
||||
double rotation,
|
||||
int colour,
|
||||
double xScaleW)
|
||||
const QString& fileName,
|
||||
const QString& text,
|
||||
QPointF point,
|
||||
double height,
|
||||
double rotation,
|
||||
int colour,
|
||||
double xScaleW)
|
||||
{
|
||||
qreal x = point.x() * xScale;
|
||||
qreal y = sheetHeight - (point.y() * yScale);
|
||||
drawText(fileName,text,x,y,height * yScale,rotation,colour,xScaleW);
|
||||
}
|
||||
void Createdxf::drawArcEllipse(
|
||||
const QString &file_path,
|
||||
QRectF rect,
|
||||
qreal startAngle,
|
||||
qreal spanAngle,
|
||||
QPointF hotspot,
|
||||
qreal rotation_angle,
|
||||
const int &colorcode)
|
||||
const QString &file_path,
|
||||
QRectF rect,
|
||||
qreal startAngle,
|
||||
qreal spanAngle,
|
||||
QPointF hotspot,
|
||||
qreal rotation_angle,
|
||||
const int &colorcode)
|
||||
{
|
||||
qreal x = rect.x() * xScale;
|
||||
qreal y = sheetHeight - rect.y() * yScale;
|
||||
@@ -1041,8 +1043,8 @@ void Createdxf::drawArcEllipse(
|
||||
static QRectF scaleRect(QRectF rect)
|
||||
{
|
||||
QRectF ro(rect.bottomLeft().x() * Createdxf::xScale,
|
||||
Createdxf::sheetHeight - (rect.bottomLeft().y() * Createdxf::yScale),
|
||||
rect.width() * Createdxf::xScale,
|
||||
rect.height() * Createdxf::yScale);
|
||||
Createdxf::sheetHeight - (rect.bottomLeft().y() * Createdxf::yScale),
|
||||
rect.width() * Createdxf::xScale,
|
||||
rect.height() * Createdxf::yScale);
|
||||
return ro;
|
||||
}
|
||||
|
||||
@@ -40,11 +40,11 @@ class Createdxf
|
||||
double,
|
||||
int);
|
||||
|
||||
static void drawCircle(
|
||||
const QString& ,
|
||||
QPointF,
|
||||
double,
|
||||
int );
|
||||
static void drawCircle(
|
||||
const QString& ,
|
||||
QPointF,
|
||||
double,
|
||||
int );
|
||||
|
||||
static void drawArc(
|
||||
const QString&,
|
||||
@@ -69,14 +69,14 @@ class Createdxf
|
||||
qreal rotation_angle,
|
||||
const int &colorcode);
|
||||
|
||||
static void drawArcEllipse(
|
||||
const QString &file_path,
|
||||
QRectF rect,
|
||||
qreal startAngle,
|
||||
qreal spanAngle,
|
||||
QPointF hotspot,
|
||||
qreal rotation_angle,
|
||||
const int &colorcode);
|
||||
static void drawArcEllipse(
|
||||
const QString &file_path,
|
||||
QRectF rect,
|
||||
qreal startAngle,
|
||||
qreal spanAngle,
|
||||
QPointF hotspot,
|
||||
qreal rotation_angle,
|
||||
const int &colorcode);
|
||||
|
||||
static void drawEllipse (const QString &filepath,
|
||||
const QRectF &rect,
|
||||
@@ -117,16 +117,16 @@ class Createdxf
|
||||
double,double,
|
||||
double,
|
||||
double,
|
||||
int,
|
||||
double xScale=1.0);
|
||||
static void drawText(
|
||||
const QString&,
|
||||
const QString&,
|
||||
QPointF,
|
||||
double,
|
||||
double,
|
||||
int,
|
||||
double xScale=1.0);
|
||||
int,
|
||||
double xScale=1.0);
|
||||
static void drawText(
|
||||
const QString&,
|
||||
const QString&,
|
||||
QPointF,
|
||||
double,
|
||||
double,
|
||||
int,
|
||||
double xScale=1.0);
|
||||
static void drawTextAligned(
|
||||
const QString& fileName,
|
||||
const QString& text,
|
||||
@@ -141,19 +141,19 @@ class Createdxf
|
||||
double xScale,
|
||||
int colour);
|
||||
|
||||
static void drawPolyline(
|
||||
const QString &filepath,
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode,
|
||||
bool preScaled = false);
|
||||
static void drawPolyline(
|
||||
const QString &filepath,
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode,
|
||||
bool preScaled = false);
|
||||
|
||||
static int getcolorCode (
|
||||
const long red,
|
||||
const long green,
|
||||
const long blue);
|
||||
static long RGBcodeTable[];
|
||||
static int dxfColor(QColor color);
|
||||
static int dxfColor(QPen pen);
|
||||
static int dxfColor(QColor color);
|
||||
static int dxfColor(QPen pen);
|
||||
|
||||
static const double sheetWidth;
|
||||
static const double sheetHeight;
|
||||
|
||||
@@ -522,10 +522,10 @@ QHash<QString, QString> projectDataBase::elementInfoToString(Element *elmt)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief projectDataBase::sqliteHandle
|
||||
* @param db
|
||||
* @return the sqlite3 handler class used internally by @db
|
||||
*/
|
||||
@brief projectDataBase::sqliteHandle
|
||||
@param db
|
||||
@return the sqlite3 handler class used internally by db
|
||||
*/
|
||||
sqlite3 *projectDataBase::sqliteHandle(QSqlDatabase *db)
|
||||
{
|
||||
//sqlite 3 lib isn't availlable for the moment on macosx
|
||||
@@ -547,7 +547,7 @@ sqlite3 *projectDataBase::sqliteHandle(QSqlDatabase *db)
|
||||
|
||||
/**
|
||||
* @brief projectDataBase::exportDb
|
||||
* Export the @db, to a file.
|
||||
* Export the db, to a file.
|
||||
* @param db : database to export
|
||||
* @param parent : parent widget of a QDialog used in this function
|
||||
* @param caption : Title of the QDialog used in this function
|
||||
|
||||
@@ -46,7 +46,9 @@ ElementQueryWidget::ElementQueryWidget(QWidget *parent) :
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove
|
||||
connect(&m_button_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), [this](int id)
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.15 or later")
|
||||
#endif
|
||||
connect(&m_button_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::idClicked), [this](int id)
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -354,7 +354,9 @@ void Diagram::keyPressEvent(QKeyEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO move code to new function")
|
||||
#endif
|
||||
//Move item with the keyboard arrow
|
||||
if(event->modifiers() == Qt::NoModifier)
|
||||
{
|
||||
@@ -1465,7 +1467,9 @@ bool Diagram::fromXml(QDomElement &document,
|
||||
content_ptr -> m_images = added_images.toSet();
|
||||
content_ptr -> m_shapes = added_shapes.toSet();
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
content_ptr -> m_text_fields = QSet<IndependentTextItem *>(
|
||||
added_texts.begin(),
|
||||
added_texts.end());
|
||||
|
||||
@@ -146,6 +146,9 @@ void DiagramPrintDialog::exec()
|
||||
#if defined Q_OS_LINUX
|
||||
//Due to some bug with xfwm, we display this dialog has a windows on linux os (X11)
|
||||
//@TODO see if we must this line with graphic server wayland
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO see if we must this line with graphic server wayland")
|
||||
#endif
|
||||
QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget(), Qt::Window);
|
||||
#else
|
||||
QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget());
|
||||
@@ -326,6 +329,9 @@ void DiagramPrintDialog::acceptPrintTypeDialog()
|
||||
);
|
||||
} else dialog_ -> accept();
|
||||
} else {
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO une imprimante doit avoir ete selectionnee")
|
||||
#endif
|
||||
// une imprimante doit avoir ete selectionnee
|
||||
/// @todo
|
||||
dialog_ -> accept();
|
||||
|
||||
@@ -83,6 +83,9 @@ void ArcEditor::setUpChangeConnections()
|
||||
m_change_connections << connect(part, &PartArc::rectChanged, this, &ArcEditor::updateForm);
|
||||
m_change_connections << connect(part, &PartArc::spanAngleChanged, this, &ArcEditor::updateForm);
|
||||
m_change_connections << connect(part, &PartArc::startAngleChanged, this, &ArcEditor::updateForm);
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO implement position changes!")
|
||||
#endif
|
||||
// TODO: implement position changes!
|
||||
//m_change_connections << connect(part, &PartArc::)
|
||||
}
|
||||
@@ -90,7 +93,7 @@ void ArcEditor::setUpChangeConnections()
|
||||
void ArcEditor::disconnectChangeConnections()
|
||||
{
|
||||
for (QMetaObject::Connection c : m_change_connections) {
|
||||
disconnect(c);
|
||||
disconnect(c);
|
||||
}
|
||||
m_change_connections.clear();
|
||||
}
|
||||
|
||||
@@ -375,7 +375,9 @@ void ChangeZValueCommand::applyRaise(const QList<QGraphicsItem *> &items_list) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) // ### Qt 6: remove
|
||||
my_items_list.swap(i, i + 1);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.13 or later")
|
||||
#endif
|
||||
my_items_list.swapItemsAt(i, i + 1);
|
||||
#endif
|
||||
}
|
||||
@@ -398,7 +400,9 @@ void ChangeZValueCommand::applyLower(const QList<QGraphicsItem *> &items_list) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) // ### Qt 6: remove
|
||||
my_items_list.swap(i, i - 1);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.13 or later")
|
||||
#endif
|
||||
my_items_list.swapItemsAt(i, i - 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -515,7 +515,9 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QStringList styles = qde.attribute("style").split(";", QString::SkipEmptyParts);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
QStringList styles = qde.attribute("style").split(";", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -174,6 +174,9 @@ void PartDynamicTextField::fromXml(const QDomElement &dom_elmt) {
|
||||
setFont(font_);
|
||||
}
|
||||
else {
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove in futur")
|
||||
#endif
|
||||
//Keep compatibility TODO remove in futur
|
||||
setFont(QETApp::dynamicTextsItemFont(9));
|
||||
}
|
||||
|
||||
@@ -672,6 +672,9 @@ void QETElementEditor::slot_updateInformations()
|
||||
//We add the editor widget
|
||||
ElementItemEditor *editor = static_cast<ElementItemEditor*>(m_editors[selection_xml_name]);
|
||||
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO Check if it takes longer than setting the parts again to the editor.")
|
||||
#endif
|
||||
// TODO: Check if it takes longer than setting the parts again to the editor.
|
||||
bool equal = true;
|
||||
QList<CustomElementPart*> parts = editor -> currentParts();
|
||||
@@ -710,6 +713,9 @@ void QETElementEditor::slot_updateInformations()
|
||||
return;
|
||||
}
|
||||
else if (selection_xml_name == "polygon" && cep_list.length() == 1) {
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO maybe allowing multipart edit when number of points is the same?")
|
||||
#endif
|
||||
// multi edit for polygons makes no sense
|
||||
// TODO: maybe allowing multipart edit when number of points is the same?
|
||||
//We add the editor widget
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
Copyright 2006-2020 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
Copyright 2006-2020 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "lineeditor.h"
|
||||
#include "ui_lineeditor.h"
|
||||
@@ -25,28 +25,68 @@
|
||||
#include "qeticons.h"
|
||||
|
||||
/**
|
||||
* @brief LineEditor::LineEditor
|
||||
* @param editor : Element editor who belong this editor
|
||||
* @param part : part line to edit
|
||||
* @param parent : parent widget
|
||||
*/
|
||||
LineEditor::LineEditor(QETElementEditor *editor, PartLine *part, QWidget *parent) :
|
||||
ElementItemEditor(editor, parent),
|
||||
ui(new Ui::LineEditor)
|
||||
@brief LineEditor::LineEditor
|
||||
@param editor : Element editor who belong this editor
|
||||
@param part : part line to edit
|
||||
@param parent : parent widget
|
||||
*/
|
||||
LineEditor::LineEditor(
|
||||
QETElementEditor *editor, PartLine *part, QWidget *parent) :
|
||||
ElementItemEditor(editor, parent),ui(new Ui::LineEditor)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->m_end1_cb->addItem(QET::Icons::EndLineNone, tr("Normale", "type of the 1st end of a line"), Qet::None );
|
||||
ui->m_end1_cb->addItem(QET::Icons::EndLineSimple, tr("Flèche simple", "type of the 1st end of a line"), Qet::Simple );
|
||||
ui->m_end1_cb->addItem(QET::Icons::EndLineTriangle, tr("Flèche triangulaire", "type of the 1st end of a line"), Qet::Triangle);
|
||||
ui->m_end1_cb->addItem(QET::Icons::EndLineCircle, tr("Cercle", "type of the 1st end of a line"), Qet::Circle );
|
||||
ui->m_end1_cb->addItem(QET::Icons::EndLineDiamond, tr("Carré", "type of the 1st end of a line"), Qet::Diamond );
|
||||
ui->m_end1_cb->addItem(
|
||||
QET::Icons::EndLineNone,
|
||||
tr("Normale",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::None );
|
||||
ui->m_end1_cb->addItem(
|
||||
QET::Icons::EndLineSimple,
|
||||
tr("Flèche simple",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::Simple );
|
||||
ui->m_end1_cb->addItem(
|
||||
QET::Icons::EndLineTriangle,
|
||||
tr("Flèche triangulaire",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::Triangle);
|
||||
ui->m_end1_cb->addItem(
|
||||
QET::Icons::EndLineCircle,
|
||||
tr("Cercle",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::Circle );
|
||||
ui->m_end1_cb->addItem(
|
||||
QET::Icons::EndLineDiamond,
|
||||
tr("Carré",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::Diamond );
|
||||
|
||||
ui->m_end2_cb->addItem(QET::Icons::EndLineNone, tr("Normale", "type of the 1st end of a line"), Qet::None );
|
||||
ui->m_end2_cb->addItem(QET::Icons::EndLineSimple, tr("Flèche simple", "type of the 1st end of a line"), Qet::Simple );
|
||||
ui->m_end2_cb->addItem(QET::Icons::EndLineTriangle, tr("Flèche triangulaire", "type of the 1st end of a line"), Qet::Triangle);
|
||||
ui->m_end2_cb->addItem(QET::Icons::EndLineCircle, tr("Cercle", "type of the 1st end of a line"), Qet::Circle );
|
||||
ui->m_end2_cb->addItem(QET::Icons::EndLineDiamond, tr("Carré", "type of the 1st end of a line"), Qet::Diamond );
|
||||
ui->m_end2_cb->addItem(
|
||||
QET::Icons::EndLineNone,
|
||||
tr("Normale",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::None );
|
||||
ui->m_end2_cb->addItem(
|
||||
QET::Icons::EndLineSimple,
|
||||
tr("Flèche simple",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::Simple );
|
||||
ui->m_end2_cb->addItem(
|
||||
QET::Icons::EndLineTriangle,
|
||||
tr("Flèche triangulaire",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::Triangle);
|
||||
ui->m_end2_cb->addItem(
|
||||
QET::Icons::EndLineCircle,
|
||||
tr("Cercle",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::Circle );
|
||||
ui->m_end2_cb->addItem(
|
||||
QET::Icons::EndLineDiamond,
|
||||
tr("Carré",
|
||||
"type of the 1st end of a line"),
|
||||
Qet::Diamond );
|
||||
|
||||
m_style = new StyleEditor(editor);
|
||||
ui->m_main_layout->insertWidget(0, m_style);
|
||||
@@ -56,18 +96,19 @@ LineEditor::LineEditor(QETElementEditor *editor, PartLine *part, QWidget *parent
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LineEditor::~LineEditor
|
||||
*/
|
||||
LineEditor::~LineEditor() {
|
||||
delete ui;
|
||||
@brief LineEditor::~LineEditor
|
||||
*/
|
||||
LineEditor::~LineEditor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LineEditor::setPart
|
||||
* Reimplemented from @ElementItemEditor
|
||||
* @param part : part line to edit
|
||||
* @return : true if the given part can be edited
|
||||
*/
|
||||
@brief LineEditor::setPart
|
||||
Reimplemented from ElementItemEditor
|
||||
@param part : part line to edit
|
||||
@return : true if the given part can be edited
|
||||
*/
|
||||
bool LineEditor::setPart(CustomElementPart *part)
|
||||
{
|
||||
if (m_part == part) {
|
||||
@@ -100,7 +141,7 @@ bool LineEditor::setPart(CustomElementPart *part)
|
||||
|
||||
/**
|
||||
* @brief LineEditor::setParts
|
||||
* Reimplemented from @ElementItemEditor
|
||||
* Reimplemented from ElementItemEditor
|
||||
* @param parts : parts to edit
|
||||
* @return true if the parts can be edited
|
||||
*/
|
||||
@@ -134,9 +175,9 @@ QList<CustomElementPart *> LineEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LineEditor::updateForm
|
||||
* Reimplemented from @ElementItemEditor
|
||||
*/
|
||||
@brief LineEditor::updateForm
|
||||
Reimplemented from ElementItemEditor
|
||||
*/
|
||||
void LineEditor::updateForm()
|
||||
{
|
||||
if (!m_part) {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
Copyright 2006-2020 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
Copyright 2006-2020 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef LINEEDITOR_H
|
||||
#define LINEEDITOR_H
|
||||
@@ -29,15 +29,15 @@ class StyleEditor;
|
||||
|
||||
/**
|
||||
* @brief The LineEditor class
|
||||
* Provide a widget editor used to edit the properties of a @PartLine
|
||||
* Provide a widget editor used to edit the properties of a PartLine
|
||||
*/
|
||||
class LineEditor : public ElementItemEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LineEditor(QETElementEditor *editor, PartLine *part = nullptr, QWidget *parent = nullptr);
|
||||
~LineEditor() override;
|
||||
explicit LineEditor(QETElementEditor *editor, PartLine *part = nullptr, QWidget *parent = nullptr);
|
||||
~LineEditor() override;
|
||||
|
||||
bool setPart(CustomElementPart *part) override;
|
||||
bool setParts(QList <CustomElementPart *> parts) override;
|
||||
@@ -58,7 +58,7 @@ class LineEditor : public ElementItemEditor
|
||||
|
||||
private:
|
||||
PartLine *m_part = nullptr;
|
||||
Ui::LineEditor *ui;
|
||||
Ui::LineEditor *ui;
|
||||
StyleEditor *m_style = nullptr;
|
||||
QList <QMetaObject::Connection> m_change_connections;
|
||||
bool m_locked = false;
|
||||
|
||||
@@ -51,9 +51,14 @@ ElementsCollectionCache::ElementsCollectionCache(const QString &database_path, Q
|
||||
cache_db_.exec("PRAGMA locking_mode = EXCLUSIVE");
|
||||
cache_db_.exec("PRAGMA synchronous = OFF");
|
||||
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO This code remove old table with mtime for create table with uuid, created at version 0,5")
|
||||
#endif
|
||||
//TODO This code remove old table with mtime for create table with uuid, created at version 0,5
|
||||
//see to remove this code at version 0,6 or 0,7 when all users will table with uuid.
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove this code for qet 0.6 or later")
|
||||
#endif
|
||||
QSqlQuery table_name(cache_db_);
|
||||
if (table_name.exec("PRAGMA table_info(names)"))
|
||||
{
|
||||
@@ -71,7 +76,9 @@ ElementsCollectionCache::ElementsCollectionCache(const QString &database_path, Q
|
||||
else
|
||||
table_name.finish();
|
||||
}
|
||||
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO the tables could already exist, handle that case.")
|
||||
#endif
|
||||
//@TODO the tables could already exist, handle that case.
|
||||
cache_db_.exec("CREATE TABLE names"
|
||||
"("
|
||||
|
||||
@@ -129,6 +129,9 @@ void ElementsMover::continueMovement(const QPointF &movement)
|
||||
// Move some conductors
|
||||
for (Conductor *c : m_moved_content.m_conductors_to_update)
|
||||
{
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO fix this problem correctly, probably we must to see conductor class.")
|
||||
#endif
|
||||
//Due to a weird behavior, we must to ensure that the position of the conductor is to (0,0).
|
||||
//If not, in some unknown case the function QGraphicsScene::itemsBoundingRect() return a rectangle
|
||||
//that take in acount the pos() of the conductor, even if the bounding rect returned by the conductor is not in the pos().
|
||||
|
||||
@@ -566,7 +566,9 @@ void ElementPictureFactory::setPainterStyle(const QDomElement &dom, QPainter &pa
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
const QStringList styles = dom.attribute("style").split(";", QString::SkipEmptyParts);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
const QStringList styles = dom.attribute("style").split(";", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
QRegularExpression rx("^(?<name>[a-z-]+):(?<value>[a-z-]+)$");
|
||||
|
||||
@@ -176,8 +176,9 @@ bool QET::orthogonalProjection(const QPointF &point,
|
||||
|
||||
// determine le point d'intersection des deux droites = le projete orthogonal
|
||||
QPointF intersection_point;
|
||||
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
QLineF::IntersectType it = line.
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
intersect // ### Qt 6: remove
|
||||
@@ -416,7 +417,11 @@ QList<QChar> QET::forbiddenCharacters()
|
||||
@param name Chaine de caractere a transformer en nom de fichier potable
|
||||
@todo virer les caracteres accentues ?
|
||||
*/
|
||||
QString QET::stringToFileName(const QString &name) {
|
||||
QString QET::stringToFileName(const QString &name)
|
||||
{
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO virer les caracteres accentues ?")
|
||||
#endif
|
||||
QString file_name(name.toLower());
|
||||
|
||||
// remplace les caracteres interdits par des tirets
|
||||
@@ -474,8 +479,9 @@ QString QET::joinWithSpaces(const QStringList &string_list) {
|
||||
QStringList QET::splitWithSpaces(const QString &string) {
|
||||
// les chaines sont separees par des espaces non echappes
|
||||
// = avec un nombre nul ou pair de backslashes devant
|
||||
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
QStringList escaped_strings = string.split(QRegularExpression("[^\\]?(?:\\\\)* "),
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QString
|
||||
|
||||
@@ -1494,7 +1494,9 @@ void QETApp::useSystemPalette(bool use) {
|
||||
*/
|
||||
void QETApp::quitQET()
|
||||
{
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO Segmentation fault when closing program before loading elements is finished")
|
||||
#endif
|
||||
if (closeEveryEditor()) {
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
@@ -1999,6 +1999,9 @@ void QETDiagramEditor::activateDiagram(Diagram *diagram)
|
||||
project_view -> showDiagram(diagram);
|
||||
}
|
||||
} else {
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO gerer ce cas")
|
||||
#endif
|
||||
/// @todo gerer ce cas
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,7 +448,9 @@ void GraphicsTablePropertiesEditor::setUpEditConnection()
|
||||
m_edit_connection << connect(m_table_button_group, QOverload<int>::of(&QButtonGroup::buttonClicked), this, &GraphicsTablePropertiesEditor::apply);
|
||||
m_edit_connection << connect(m_header_button_group, QOverload<int>::of(&QButtonGroup::buttonClicked), this, &GraphicsTablePropertiesEditor::apply);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.15 or later")
|
||||
#endif
|
||||
m_edit_connection << connect(m_table_button_group, QOverload<int>::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply);
|
||||
m_edit_connection << connect(m_header_button_group, QOverload<int>::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply);
|
||||
#endif
|
||||
|
||||
@@ -1694,7 +1694,9 @@ QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram,
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
other_conductors += other_conductors_list_t.toSet();
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
other_conductors += QSet<Conductor*>(other_conductors_list_t.begin(),other_conductors_list_t.end());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -939,7 +939,9 @@ bool Element::fromXml(
|
||||
* So we swap the value stored in "label" to "formula" as expected.
|
||||
* @TODO remove this code at version 0.7 or more (probably useless).
|
||||
*/
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove this code for qet 0.7 or later")
|
||||
#endif
|
||||
if (dc["label"].toString().contains("%")
|
||||
&& dc["formula"].toString().isNull())
|
||||
{
|
||||
|
||||
@@ -851,6 +851,9 @@ bool QetShapeItem::fromXml(const QDomElement &e)
|
||||
m_brush = QETXML::brushFromXml(e.firstChildElement("brush"));
|
||||
|
||||
QString type = e.attribute("type");
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO Compatibility for version older than N°4075, shape type was stored with an int")
|
||||
#endif
|
||||
//@TODO Compatibility for version older than N°4075, shape type was stored with an int
|
||||
if (type.size() == 1)
|
||||
{
|
||||
@@ -965,28 +968,28 @@ bool QetShapeItem::toDXF(const QString &filepath,const QPen &pen)
|
||||
switch (m_shapeType)
|
||||
{
|
||||
case Line:
|
||||
Createdxf::drawLine(filepath,
|
||||
QLineF( mapToScene(m_P1),
|
||||
mapToScene(m_P2)),
|
||||
Createdxf::dxfColor(pen));
|
||||
return true;
|
||||
Createdxf::drawLine(filepath,
|
||||
QLineF( mapToScene(m_P1),
|
||||
mapToScene(m_P2)),
|
||||
Createdxf::dxfColor(pen));
|
||||
return true;
|
||||
case Rectangle:
|
||||
Createdxf::drawRectangle(filepath,
|
||||
QRectF(mapToScene(m_P1),
|
||||
mapToScene(m_P2)).normalized(),
|
||||
Createdxf::dxfColor(pen));
|
||||
return true;
|
||||
Createdxf::drawRectangle(filepath,
|
||||
QRectF(mapToScene(m_P1),
|
||||
mapToScene(m_P2)).normalized(),
|
||||
Createdxf::dxfColor(pen));
|
||||
return true;
|
||||
case Ellipse:
|
||||
Createdxf::drawEllipse(filepath,
|
||||
QRectF(mapToScene(m_P1),
|
||||
mapToScene(m_P2)).normalized(),
|
||||
Createdxf::dxfColor(pen));
|
||||
return true;
|
||||
case Polygon:
|
||||
Createdxf::drawPolygon(filepath,m_polygon,Createdxf::dxfColor(pen));
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
Createdxf::drawEllipse(filepath,
|
||||
QRectF(mapToScene(m_P1),
|
||||
mapToScene(m_P2)).normalized(),
|
||||
Createdxf::dxfColor(pen));
|
||||
return true;
|
||||
case Polygon:
|
||||
Createdxf::drawPolygon(filepath,m_polygon,Createdxf::dxfColor(pen));
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -155,6 +155,9 @@ Terminal::Terminal(TerminalData* data, Element* e) :
|
||||
d(data),
|
||||
parent_element_(e)
|
||||
{
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO what is when multiple parents exist. So the other relation is lost.")
|
||||
#endif
|
||||
// TODO: what is when multiple parents exist. So the other relation is lost.
|
||||
d->setParent(this);
|
||||
init("_", "_", false);
|
||||
|
||||
@@ -61,6 +61,9 @@ void QETMainWindow::initCommonActions()
|
||||
connect(configure_action_, &QAction::triggered, [qet_app]()
|
||||
{
|
||||
qet_app->configureQET();
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO we use reloadOldElementPanel only to keep up to date the string of the folio in the old element panel. then, if user change the option "Use labels of folio instead of their ID" the string of folio in the old element panel is up to date")
|
||||
#endif
|
||||
//TODO we use reloadOldElementPanel only to keep up to date the string of the folio in the old element panel.
|
||||
//then, if user change the option "Use labels of folio instead of their ID" the string of folio in the old element panel is up to date
|
||||
for (QETDiagramEditor *qde : qet_app->diagramEditors())
|
||||
|
||||
@@ -988,6 +988,9 @@ bool QETProject::isEmpty() const
|
||||
// si le projet a un titre, on considere qu'il n'est pas vide
|
||||
if (!project_title_.isEmpty()) return(false);
|
||||
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO check if the embedded element collection is empty")
|
||||
#endif
|
||||
//@TODO check if the embedded element collection is empty
|
||||
|
||||
// compte le nombre de schemas non vides
|
||||
@@ -1273,7 +1276,9 @@ void QETProject::readProjectXml(QDomDocument &xml_project)
|
||||
{
|
||||
bool conv_ok;
|
||||
m_project_qet_version = root_elmt.attribute("version").toDouble(&conv_ok);
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO use of version convert")
|
||||
#endif
|
||||
if (conv_ok && QET::version.toDouble() < m_project_qet_version)
|
||||
{
|
||||
int ret = QET::QetMessageBox::warning(
|
||||
@@ -1328,7 +1333,9 @@ void QETProject::readProjectXml(QDomDocument &xml_project)
|
||||
*/
|
||||
void QETProject::readDiagramsXml(QDomDocument &xml_project)
|
||||
{
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO try to solve a weird bug (dialog is black) since port to Qt5 with the DialogWaiting")
|
||||
#endif
|
||||
//@TODO try to solve a weird bug (dialog is black) since port to Qt5 with the DialogWaiting
|
||||
//show DialogWaiting
|
||||
DialogWaiting *dlgWaiting = nullptr;
|
||||
|
||||
@@ -45,6 +45,9 @@ RecentFiles::RecentFiles(const QString &identifier, int size, QObject *parent) :
|
||||
*/
|
||||
RecentFiles::~RecentFiles()
|
||||
{
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO determiner s'il faut detruire ou non le menu")
|
||||
#endif
|
||||
delete menu_;
|
||||
}
|
||||
|
||||
|
||||
@@ -740,7 +740,9 @@ QString RichTextEditor::text(Qt::TextFormat format) const
|
||||
break;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
case Qt::MarkdownText: //This enum value was added in Qt 5.14.
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -210,6 +210,9 @@ bool QETTitleBlockTemplateEditor::edit(
|
||||
}
|
||||
if (!tb_template_orig) {
|
||||
/// TODO The TBT does not exist, manage error
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO The TBT does not exist, manage error")
|
||||
#endif
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -247,6 +250,9 @@ bool QETTitleBlockTemplateEditor::edit(
|
||||
|
||||
if (!tb_template_orig) {
|
||||
/// TODO The TBT does not exist, manage error
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO The TBT does not exist, manage error")
|
||||
#endif
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -267,12 +273,18 @@ bool QETTitleBlockTemplateEditor::edit(const QString &file_path)
|
||||
TitleBlockTemplate *tbt = new TitleBlockTemplate();
|
||||
bool loading = tbt -> loadFromXmlFile(file_path);
|
||||
if (!loading) {
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO the file opening failed, warn the user?")
|
||||
#endif
|
||||
/// TODO the file opening failed, warn the user?
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool editing = edit(tbt);
|
||||
if (!editing) {
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO the file editing failed, warn the user?")
|
||||
#endif
|
||||
/// TODO the file editing failed, warn the user?
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@ class QETTitleBlockTemplateEditor : public QETMainWindow {
|
||||
// attributes
|
||||
private:
|
||||
/// menus TODO
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO menus")
|
||||
#endif
|
||||
QMenu *file_menu_, *edit_menu_, *display_menu_;
|
||||
/// actions
|
||||
QAction *new_, *open_, *open_from_file_, *save_, *save_as_, *save_as_file_, *quit_;
|
||||
|
||||
@@ -235,6 +235,9 @@ QString TitleBlockTemplateLogoManager::confirmLogoName(const QString &initial_na
|
||||
} else if (answer == QDialogButtonBox::NoRole) {
|
||||
// the user provided another name
|
||||
name = rd_input -> text();
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO prevent the user from entering an empty name")
|
||||
#endif
|
||||
/// TODO prevent the user from entering an empty name
|
||||
} else {
|
||||
// the user cancelled the operation
|
||||
|
||||
@@ -439,6 +439,9 @@ void TitleBlockTemplateView::splitSelectedCell()
|
||||
*/
|
||||
void TitleBlockTemplateView::drawBackground(QPainter *painter, const QRectF &rect) {
|
||||
QGraphicsView::drawBackground(painter, rect);
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO shouldn't we draw a large uniform rect?")
|
||||
#endif
|
||||
if (!tbtemplate_) return; // TODO shouldn't we draw a large uniform rect?
|
||||
}
|
||||
|
||||
@@ -959,6 +962,9 @@ QList<QAction *> TitleBlockTemplateView::columnsActions() const
|
||||
*/
|
||||
void TitleBlockTemplateView::updateLayout()
|
||||
{
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO we should try to update the grid instead of deleting-and-reloading it")
|
||||
#endif
|
||||
// TODO we should try to update the grid instead of deleting-and-reloading it
|
||||
loadTemplate(tbtemplate_);
|
||||
}
|
||||
|
||||
@@ -397,7 +397,9 @@ void TitleBlockTemplate::parseRows(const QString &rows_string) {
|
||||
QStringList rows_descriptions =
|
||||
rows_string.split(QChar(';'), QString::SkipEmptyParts);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
QStringList rows_descriptions =
|
||||
rows_string.split(QChar(';'), Qt::SkipEmptyParts);
|
||||
#endif
|
||||
@@ -437,7 +439,9 @@ void TitleBlockTemplate::parseColumns(const QString &cols_string) {
|
||||
QStringList cols_descriptions =
|
||||
cols_string.split(QChar(';'), QString::SkipEmptyParts);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
QStringList cols_descriptions =
|
||||
cols_string.split(QChar(';'), Qt::SkipEmptyParts);
|
||||
#endif
|
||||
@@ -1378,7 +1382,9 @@ bool TitleBlockTemplate::removeLogo(const QString &logo_name) {
|
||||
if (!data_logos_.contains(logo_name)) {
|
||||
return(false);
|
||||
}
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO check existing cells using this logo.")
|
||||
#endif
|
||||
/// TODO check existing cells using this logo.
|
||||
if (vector_logos_.contains(logo_name)) {
|
||||
delete vector_logos_.take(logo_name);
|
||||
@@ -1404,7 +1410,9 @@ bool TitleBlockTemplate::renameLogo(const QString &logo_name,
|
||||
|| data_logos_.contains(new_name)) {
|
||||
return(false);
|
||||
}
|
||||
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO check existing cells using this logo.")
|
||||
#endif
|
||||
/// TODO check existing cells using this logo.
|
||||
if (vector_logos_.contains(logo_name)) {
|
||||
vector_logos_.insert(new_name, vector_logos_.take(logo_name));
|
||||
@@ -1755,7 +1763,9 @@ QStringList TitleBlockTemplate::listOfVariables()
|
||||
|| cells_[i][j] -> cell_type
|
||||
== TitleBlockCell::EmptyCell)
|
||||
continue;
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO not works on all cases...")
|
||||
#endif
|
||||
// TODO: not works on all cases...
|
||||
list << cells_[i][j] -> value.name().replace("%","");
|
||||
}
|
||||
|
||||
@@ -83,7 +83,9 @@ int BOMExportDialog::exec()
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove
|
||||
stream << getBom() << endl;
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.15 or later")
|
||||
#endif
|
||||
stream << getBom() << &Qt::endl(stream);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -107,6 +107,9 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
|
||||
|
||||
// Conducteur have change
|
||||
if (new_conductors != conductors) {
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO implement an undo command to allow the user to undo/redo this action")
|
||||
#endif
|
||||
/// TODO implement an undo command to allow the user to undo/redo this action
|
||||
diagram -> defaultConductorProperties = new_conductors;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user