QElectroTech  0.70
bordertitleblock.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include <QPainter>
19 #include <utility>
20 #include "titleblocktemplate.h"
22 #include "bordertitleblock.h"
23 #include "diagramposition.h"
24 #include "qetapp.h"
25 #include "math.h"
26 #include "createdxf.h"
27 #include "diagram.h"
28 
29 #define MIN_COLUMN_COUNT 3
30 #define MIN_ROW_COUNT 3
31 #define MIN_COLUMN_WIDTH 5.0
32 #define MIN_ROW_HEIGHT 5.0
33 
40  QObject(parent)
41 {
42  // at first, the internal titleblock template renderer uses the default titleblock template
45 
46  // disable the QPicture-based cache from Qt 4.8 to avoid rendering errors and crashes
47  if (!QRegExp("4\\.[0-7]\\.").exactMatch(qVersion())) {
48  titleblock_template_renderer_ -> setUseCache(false);
49  }
50 
51  // dimensions par defaut du schema
53 
54  // contenu par defaut du cartouche
56 
57  display_titleblock_ = true;
58  display_border_ = true;
59  setFolioData(1, 1);
61 }
62 
67 }
68 
74 {
75  if (m_edge == Qt::BottomEdge)
76  return QRectF(diagram_rect_.bottomLeft(), QSize(diagram_rect_.width(), titleblock_template_renderer_ -> height()));
77  else
78  return QRectF(diagram_rect_.topRight(), QSize(titleblock_template_renderer_ -> height(), diagram_rect_.height()));
79 }
80 
92 {
93  if (m_edge == Qt::BottomEdge) //Rect at bottom have same position and dimension of displayed rect
94  return titleBlockRect();
95  else
96  return QRectF (diagram_rect_.bottomRight(), QSize(diagram_rect_.height(), titleblock_template_renderer_ -> height()));
97 
98 }
99 
107  return diagram_rect_ | titleBlockRect();
108 }
109 
116 {
117  if (!display_columns_) return QRectF();
119 }
120 
127 {
128  if (!display_rows_) return QRectF();
130 }
131 
138 {
139  return QRectF (Diagram::margin, Diagram::margin,
142 }
143 
151 {
152  qreal left = Diagram::margin;
153  qreal top = Diagram::margin;
154  qreal width = columns_width_*columns_count_;
155  qreal height = rows_height_*rows_count_;
156 
159 
160  return QRectF (left, top, width, height);
161 }
162 
167 void BorderTitleBlock::titleBlockToXml(QDomElement &xml_elmt) {
168  exportTitleBlock().toXml(xml_elmt);
169 }
170 
175 void BorderTitleBlock::titleBlockFromXml(const QDomElement &xml_elmt) {
177  tbp.fromXml(xml_elmt);
178  importTitleBlock(tbp);
179 }
180 
185 void BorderTitleBlock::borderToXml(QDomElement &xml_elmt) {
186  xml_elmt.setAttribute("cols", columnsCount());
187  xml_elmt.setAttribute("colsize", QString("%1").arg(columnsWidth()));
188  xml_elmt.setAttribute("displaycols", columnsAreDisplayed() ? "true" : "false");
189 
190  xml_elmt.setAttribute("rows", rowsCount());
191  xml_elmt.setAttribute("rowsize", QString("%1").arg(rowsHeight()));
192  xml_elmt.setAttribute("displayrows", rowsAreDisplayed() ? "true" : "false");
193 
194  // attribut datant de la version 0.1 - laisse pour retrocompatibilite
195  xml_elmt.setAttribute("height", QString("%1").arg(diagramHeight()));
196 }
197 
202 void BorderTitleBlock::borderFromXml(const QDomElement &xml_elmt) {
203  bool ok;
204  // columns count
205  int cols_count = xml_elmt.attribute("cols").toInt(&ok);
206  if (ok) setColumnsCount(cols_count);
207 
208  // columns width
209  double cols_width = xml_elmt.attribute("colsize").toDouble(&ok);
210  if (ok) setColumnsWidth(cols_width);
211 
212  // backward compatibility: diagrams saved with 0.1 version have a "height" attribute
213  if (xml_elmt.hasAttribute("rows") && xml_elmt.hasAttribute("rowsize")) {
214  // rows counts
215  int rows_count = xml_elmt.attribute("rows").toInt(&ok);
216  if (ok) setRowsCount(rows_count);
217 
218  // taille des lignes
219  double rows_size = xml_elmt.attribute("rowsize").toDouble(&ok);
220  if (ok) setRowsHeight(rows_size);
221  } else {
222  // hauteur du schema
223  double height = xml_elmt.attribute("height").toDouble(&ok);
224  if (ok) setDiagramHeight(height);
225  }
226 
227  // rows and columns display
228  displayColumns(xml_elmt.attribute("displaycols") != "false");
229  displayRows(xml_elmt.attribute("displayrows") != "false");
230 
232 }
233 
239 
240  ip.author = author();
241  ip.date = date();
242  ip.title = title();
243  ip.filename = fileName();
244  ip.plant = plant();
245  ip.locmach = locmach();
246  ip.indexrev = indexrev();
247  ip.version = version();
248  ip.folio = folio();
250  ip.display_at = m_edge;
251  ip.auto_page_num = autoPageNum();
254 
255  return(ip);
256 }
257 
263  setAuthor(ip.author);
264  setDate(ip.date);
265  setTitle(ip.title);
266  setFileName(ip.filename);
267  setPlant(ip.plant);
268  setLocMach(ip.locmach);
271  setFolio(ip.folio);
273  if (m_edge != ip.display_at)
274  {
275  m_edge = ip.display_at;
276  emit(displayChanged());
277  }
279 
280  emit(needFolioData()); // Note: we expect additional data to be provided
281  // through setFolioData(), which in turn calls updateDiagramContextForTitleBlock().
283 }
284 
289  BorderProperties bp;
294  bp.rows_count = rowsCount();
295  bp.rows_height = rowsHeight();
298  return(bp);
299 }
300 
313 }
314 
321 }
322 
329 }
330 
335  QString tbt_name = titleblock_template_renderer_ -> titleBlockTemplate() -> name();
336  return((tbt_name == "default") ? "" : tbt_name);
337 }
338 
345 void BorderTitleBlock::titleBlockTemplateChanged(const QString &template_name) {
346  if (titleBlockTemplateName() != template_name) return;
347  titleblock_template_renderer_ -> invalidateRenderedTemplate();
348 }
349 
358 void BorderTitleBlock::titleBlockTemplateRemoved(const QString &removed_template_name, const TitleBlockTemplate *new_template) {
359  if (titleBlockTemplateName() != removed_template_name) return;
360 
361  if (new_template) {
362  setTitleBlockTemplate(new_template);
363  } else {
365  }
366 }
367 
372  bool change = (di != display_titleblock_);
373  display_titleblock_ = di;
374  if (change) emit(displayChanged());
375 }
376 
381  bool change = (dc != display_columns_);
382  display_columns_ = dc;
383  if (change) emit(displayChanged());
384 }
385 
390  bool change = (dr != display_rows_);
391  display_rows_ = dr;
392  if (change) emit(displayChanged());
393 }
394 
401  bool change = (db != display_border_);
402  display_border_ = db;
403  if (change) emit(displayChanged());
404 }
405 
411 void BorderTitleBlock::slot_setAutoPageNum(QString pageAutoNum) {
412  btb_auto_page_num_=std::move(pageAutoNum);
413 }
414 
420 {
421  QRectF previous_diagram = diagram_rect_;
423  if (diagram_rect_ != previous_diagram) emit(borderChanged(previous_diagram, diagram_rect_));
424 }
425 
431 void BorderTitleBlock::draw(QPainter *painter)
432 {
433  //Set the QPainter
434  painter -> save();
435  QPen pen(Qt::black);
436  pen.setCosmetic(true);
437  painter -> setPen(pen);
438  painter -> setBrush(Qt::NoBrush);
439 
440  QSettings settings;
441 
442  //Draw the borer
443  if (display_border_) painter -> drawRect(diagram_rect_);
444 
445  painter -> setFont(QETApp::diagramTextsFont());
446 
447  //Draw the empty case at the top left of diagram when there is header
449  {
450  QRectF first_rectangle(
451  diagram_rect_.topLeft().x(),
452  diagram_rect_.topLeft().y(),
455  );
456  painter -> drawRect(first_rectangle);
457  }
458 
459  //Draw the nums of columns
461  for (int i = 1 ; i <= columns_count_ ; ++ i) {
462  QRectF numbered_rectangle = QRectF(
463  diagram_rect_.topLeft().x() + (rows_header_width_ + ((i - 1) * columns_width_)),
464  diagram_rect_.topLeft().y(),
467  );
468  painter -> drawRect(numbered_rectangle);
469  if (settings.value("border-columns_0", true).toBool()){
470  painter -> drawText(numbered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, QString("%1").arg(i - 1));
471  }else{
472  painter -> drawText(numbered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, QString("%1").arg(i));
473  }
474  }
475  }
476 
477  //Draw the nums of rows
479  QString row_string("A");
480  for (int i = 1 ; i <= rows_count_ ; ++ i) {
481  QRectF lettered_rectangle = QRectF(
482  diagram_rect_.topLeft().x(),
483  diagram_rect_.topLeft().y() + (columns_header_height_ + ((i - 1) * rows_height_)),
486  );
487  painter -> drawRect(lettered_rectangle);
488  painter -> drawText(lettered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, row_string);
489  row_string = incrementLetters(row_string);
490  }
491  }
492 
493  // render the titleblock, using the TitleBlockTemplate object
494  if (display_titleblock_) {
495  QRectF tbt_rect = titleBlockRectForQPainter();
496  if (m_edge == Qt::BottomEdge)
497  {
498  painter -> translate(tbt_rect.topLeft());
499  titleblock_template_renderer_ -> render(painter, tbt_rect.width());
500  painter -> translate(-tbt_rect.topLeft());
501  }
502  else
503  {
504  painter->translate(tbt_rect.topLeft());
505  painter->rotate(-90);
506  titleblock_template_renderer_ -> render(painter, tbt_rect.width());
507  painter->rotate(90);
508  painter -> translate(-tbt_rect.topLeft());
509  }
510  }
511 
512  painter -> restore();
513 }
514 
515 void BorderTitleBlock::drawDxf(int width, int height, bool keep_aspect_ratio, QString &file_path, int color) {
516  Q_UNUSED (width); Q_UNUSED (height); Q_UNUSED (keep_aspect_ratio);
517 
518  // Transform to DXF scale.
523 
524  // dessine la case vide qui apparait des qu'il y a un entete
525  if (display_border_ &&
526  (display_columns_ ||
528  ) {
530  file_path,
531  double(diagram_rect_.topLeft().x()) * Createdxf::xScale,
535  color
536  );
537  }
538 
539  QSettings settings;
540 
541  // dessine la numerotation des colonnes
542  if (display_border_ &&
544  for (int i = 1 ; i <= columns_count_ ; ++ i) {
545  double xCoord = diagram_rect_.topLeft().x() +
546  (rows_header_width_ + ((i - 1) *
547  columns_width_));
548  double yCoord = Createdxf::sheetHeight - diagram_rect_.topLeft().y() - columns_header_height_;
549  double recWidth = columns_width_;
550  double recHeight = columns_header_height_;
551  Createdxf::drawRectangle(file_path, xCoord, yCoord, recWidth, recHeight, color);
552  if (settings.value("border-columns_0", true).toBool()){
553  Createdxf::drawTextAligned(file_path, QString::number(i - 1), xCoord,
554  yCoord + recHeight*0.5, recHeight*0.7, 0, 0, 1, 2, xCoord+recWidth/2, color, 0);
555  }else{
556  Createdxf::drawTextAligned(file_path, QString::number(i), xCoord,
557  yCoord + recHeight*0.5, recHeight*0.7, 0, 0, 1, 2, xCoord+recWidth/2, color, 0);
558  }
559  }
560  }
561 
562  // dessine la numerotation des lignes
563 
565  QString row_string("A");
566  for (int i = 1 ; i <= rows_count_ ; ++ i) {
567  double xCoord = diagram_rect_.topLeft().x() * Createdxf::xScale;
568  double yCoord = Createdxf::sheetHeight - diagram_rect_.topLeft().y()*Createdxf::yScale
569  - (columns_header_height_ + ((i - 1) * rows_height_))
570  - rows_height_;
571  double recWidth = rows_header_width_;
572  double recHeight = rows_height_;
573  Createdxf::drawRectangle(file_path, xCoord, yCoord, recWidth, recHeight, color);
574  Createdxf::drawTextAligned(file_path, row_string, xCoord,
575  yCoord + recHeight*0.5, recWidth*0.7, 0, 0, 1, 2, xCoord+recWidth/2, color, 0);
576  row_string = incrementLetters(row_string);
577  }
578  }
579 
580  // render the titleblock, using the TitleBlockTemplate object
581  if (display_titleblock_) {
582  //qp -> translate(titleblock_rect_.topLeft());
583  QRectF rect = titleBlockRect();
584  titleblock_template_renderer_ -> renderDxf(rect, rect.width(), file_path, color);
585  //qp -> translate(-titleblock_rect_.topLeft());
586  }
587 
588  // Transform back to QET scale
593 
594 }
595 
604  if (nb_c == columnsCount()) return;
605  columns_count_ = qMax(MIN_COLUMN_COUNT , nb_c);
607 }
608 
616 void BorderTitleBlock::setColumnsWidth(const qreal &new_cw) {
617  if (new_cw == columnsWidth()) return;
618  columns_width_ = qMax(MIN_COLUMN_WIDTH , new_cw);
620 }
621 
627 void BorderTitleBlock::setColumnsHeaderHeight(const qreal &new_chh) {
628  columns_header_height_ = qBound(qreal(5.0), new_chh, qreal(50.0));
630 }
631 
640  if (nb_r == rowsCount()) return;
641  rows_count_ = qMax(MIN_ROW_COUNT, nb_r);
643 }
644 
652 void BorderTitleBlock::setRowsHeight(const qreal &new_rh) {
653  if (new_rh == rowsHeight()) return;
654  rows_height_ = qMax(MIN_ROW_HEIGHT, new_rh);
656 }
657 
663 void BorderTitleBlock::setRowsHeaderWidth(const qreal &new_rhw) {
664  rows_header_width_ = qBound(qreal(5.0), new_rhw, qreal(50.0));
666 }
667 
672 void BorderTitleBlock::setDiagramHeight(const qreal &height) {
673  // taille des lignes a utiliser = rows_height
674  setRowsCount(qRound(ceil(height / rows_height_)));
675 }
676 
684 {
685  if(!insideBorderRect().contains(pos))
686  return (DiagramPosition("", 0));
687 
688  QPointF relative_pos = pos - insideBorderRect().topLeft();
689  int row_number = int(ceil(relative_pos.x() / columnsWidth()));
690  int column_number = int(ceil(relative_pos.y() / rowsHeight()));
691 
692  QString letter = "A";
693  for (int i = 1 ; i < column_number ; ++ i)
694  letter = incrementLetters(letter);
695 
696  return(DiagramPosition(letter, row_number));
697 }
698 
703 void BorderTitleBlock::setAuthor(const QString &author) {
705 }
706 
711 void BorderTitleBlock::setDate(const QDate &date) {
712  btb_date_ = date;
713 }
714 
719 void BorderTitleBlock::setTitle(const QString &title)
720 {
721  if (btb_title_ != title)
722  {
723  btb_title_ = title;
724  emit(diagramTitleChanged(title));
725  }
726 }
727 
732 void BorderTitleBlock::setFolio(const QString &folio)
733 {
734  btb_folio_ = folio;
736 }
737 
745  // Our final DiagramContext is the initial one (which is supposed to bring
746  // project-wide properties), overridden by the "additional fields" one...
747  DiagramContext context = initial_context;
748  foreach (QString key, additional_fields_.keys()) {
749  context.addValue(key, additional_fields_[key]);
750  }
751 
752  // ... overridden by the historical and/or dynamically generated fields
753  context.addValue("author", btb_author_);
754  context.addValue("date", btb_date_.toString(Qt::SystemLocaleShortDate));
755  context.addValue("title", btb_title_);
756  context.addValue("filename", btb_filename_);
757  context.addValue("plant", btb_plant_);
758  context.addValue("locmach", btb_locmach_);
759  context.addValue("indexrev", btb_indexrev_);
760  context.addValue("version", btb_version_);
761  context.addValue("folio", btb_final_folio_);
762  context.addValue("folio-id", folio_index_);
763  context.addValue("folio-total", folio_total_);
764  context.addValue("auto_page_num", btb_auto_page_num_);
765  context.addValue("previous-folio-num", m_previous_folio_num);
766  context.addValue("next-folio-num", m_next_folio_num);
767 
768  titleblock_template_renderer_ -> setContext(context);
769 }
770 
771 QString BorderTitleBlock::incrementLetters(const QString &string) {
772  if (string.isEmpty()) {
773  return("A");
774  } else {
775  // separe les digits precedents du dernier digit
776  QString first_digits(string.left(string.count() - 1));
777  QChar last_digit(string.at(string.count() - 1));
778  if (last_digit != 'Z') {
779  // incremente le dernier digit
780  last_digit = last_digit.toLatin1() + 1;
781  return(first_digits + QString(last_digit));
782  } else {
783  return(incrementLetters(first_digits) + "A");
784  }
785  }
786 }
787 
793 void BorderTitleBlock::setFolioData(int index, int total, const QString& autonum, const DiagramContext &project_properties) {
794  if (index < 1 || total < 1 || index > total) return;
795 
796  // memorise les informations
797  folio_index_ = index;
798  folio_total_ = total;
799 
800  // regenere le contenu du champ folio
802 
803  if (btb_final_folio_.contains("%autonum")){
804  btb_final_folio_.replace("%autonum", autonum);
806  }
807  btb_final_folio_.replace("%id", QString::number(folio_index_));
808  btb_final_folio_.replace("%total", QString::number(folio_total_));
809 
810 
811  updateDiagramContextForTitleBlock(project_properties);
812 }
813 
818 void BorderTitleBlock::setPlant(const QString &plant) {
819  btb_plant_ = plant;
820 }
821 
826 void BorderTitleBlock::setLocMach(const QString &locmach) {
828 }
829 
834 void BorderTitleBlock::setIndicerev(const QString &indexrev) {
836 }
837 
842 void BorderTitleBlock::setFileName(const QString &filename) {
843  btb_filename_ = filename;
844 }
845 
850 void BorderTitleBlock::setVersion(const QString &version) {
852 }
853 
858 void BorderTitleBlock::setAutoPageNum(const QString &auto_page_num) {
859  btb_auto_page_num_ = auto_page_num;
860 }
861 
866 void BorderTitleBlock::setPreviousFolioNum(const QString &previous)
867 {
868  m_previous_folio_num = previous;
870  context.addValue("previous-folio-num", m_previous_folio_num);
872 }
873 
878 void BorderTitleBlock::setNextFolioNum(const QString &next)
879 {
880  m_next_folio_num = next;
882  context.addValue("next-folio-num", m_next_folio_num);
884 }
QString autoPageNum() const
TitleBlockTemplateRenderer * titleblock_template_renderer_
QString locmach
Location(displayed by the default template)
QRectF columnsRect() const
BorderTitleBlock::columnsRect.
static TitleBlockTemplate * defaultTitleBlockTemplate()
Definition: qetapp.cpp:1088
void setFolioData(int, int, const QString &=nullptr, const DiagramContext &=DiagramContext())
void updateDiagramContextForTitleBlock(const DiagramContext &=DiagramContext())
DiagramContext additional_fields_
From an embedded collection (a project for exemple)
Definition: qet.h:153
DiagramPosition convertPosition(const QPointF &)
BorderTitleBlock::convertPosition Convert a Point in cartesian coordinate (x : 12.5, 56.9) to a point in grid coordinate (ex : B2)
QString plant
Plant (displayed by the default template)
void setColumnsHeaderHeight(const qreal &)
QRectF outsideBorderRect() const
BorderTitleBlock::outsideBorderRect.
Qt::Edge display_at
Edge to display the titleblock.
QString version() const
static const qreal margin
margin around the diagram
Definition: diagram.h:88
QString author() const
qreal diagramHeight() const
static void drawRectangle(const QString &filepath, double, double, double, double, const int &colorcode)
Definition: createdxf.cpp:565
void drawDxf(int, int, bool, QString &, int)
QString title() const
QRectF insideBorderRect() const
BorderTitleBlock::insideBorderRect.
void setTitle(const QString &title)
BorderTitleBlock::setTitle.
void setFileName(const QString &filename)
BorderTitleBlock::setFileName.
QString fileName() const
void borderFromXml(const QDomElement &)
TitleBlockProperties exportTitleBlock()
const TitleBlockTemplate * titleBlockTemplate()
QRectF rowsRect() const
BorderTitleBlock::rowsRect.
const QString displayedVersion
QElectroTech displayed version.
Definition: qet.h:32
static const double sheetHeight
Definition: createdxf.h:56
void toXml(QDomElement &) const
QRectF borderAndTitleBlockRect() const
BorderTitleBlock::borderAndTitleBlockRect.
void displayTitleBlock(bool)
QString indexrev() const
QString incrementLetters(const QString &)
QDate date
Date (displayed by the default template)
static double yScale
Definition: createdxf.h:58
int columnsCount() const
qreal rowsHeaderWidth() const
#define MIN_ROW_HEIGHT
void setColumnsWidth(const qreal &)
void diagramTitleChanged(const QString &)
void setAuthor(const QString &author)
BorderTitleBlock::setAuthor.
void titleBlockFolioChanged(const QString &)
titleBlockFolioChanged Signal emitted after Folio has changed
void draw(QPainter *painter)
BorderTitleBlock::draw Draw the border and the titleblock.
bool addValue(const QString &, const QVariant &, bool show=true)
QRectF titleBlockRectForQPainter() const
BorderTitleBlock::titleBlockRectForQPainter.
void needTitleBlockTemplate(const QString &)
QString filename
Filename (displayed by the default template)
QString m_previous_folio_num
qreal columnsWidth() const
qreal rowsHeight() const
const QString version
QElectroTech version (as string, used to mark projects and elements XML documents) ...
Definition: qet.h:30
QString locmach() const
QList< QString > keys(KeyOrder=None) const
DiagramContext context
Container for the additional, user-defined fields.
void fromXml(const QDomElement &)
void importTitleBlock(const TitleBlockProperties &)
BorderTitleBlock::importTitleBlock.
bool rowsAreDisplayed() const
qreal columns_width
Columns width.
QString version
Version (displayed by the default template)
static double xScale
Definition: createdxf.h:57
void setDiagramHeight(const qreal &)
void borderToXml(QDomElement &)
void updateRectangles()
BorderTitleBlock::updateRectangles This method update the diagram rect according to the value of rows...
void setDate(const QDate &date)
BorderTitleBlock::setDate.
void slot_setAutoPageNum(QString)
BorderTitleBlock::slot_setAutoPageNum.
~BorderTitleBlock() override
#define MIN_COLUMN_WIDTH
bool columnsAreDisplayed() const
QRectF titleBlockRect() const
BorderTitleBlock::titleBlockRect.
QString folio() const
qreal columns_header_height
Column headers height.
qreal columnsHeaderHeight() const
void setNextFolioNum(const QString &next)
BorderTitleBlock::setNextFolioNum.
int rowsCount() const
BorderProperties exportBorder()
void setPreviousFolioNum(const QString &previous)
BorderTitleBlock::setPreviousFolioNum.
void setRowsHeight(const qreal &)
void titleBlockTemplateChanged(const QString &)
QString plant() const
BorderTitleBlock(QObject *=nullptr)
void setFolio(const QString &folio)
BorderTitleBlock::setFolio.
void setContext(const DiagramContext &context)
TitleBlockTemplateRenderer::setContext.
QString author
Author of the diagram/folio (displayed by the default template)
void setVersion(const QString &version)
BorderTitleBlock::setVersion.
void setIndicerev(const QString &indexrev)
BorderTitleBlock::setIndicerev.
QString indexrev
Revision Index (displayed by the default template)
void setTitleBlockTemplate(const TitleBlockTemplate *)
void titleBlockFromXml(const QDomElement &)
static QFont diagramTextsFont(qreal=-1.0)
QETApp::diagramTextsFont The font to use By default the font is "sans Serif" and size 9...
Definition: qetapp.cpp:910
qreal rows_height
Rows height.
DiagramContext context() const
TitleBlockTemplateRenderer::context.
#define MIN_ROW_COUNT
void importBorder(const BorderProperties &)
static void drawTextAligned(const QString &fileName, const QString &text, double x, double y, double height, double rotation, double oblique, int hAlign, int vAlign, double xAlign, int colour, bool leftAlign=false, float scale=0)
Definition: createdxf.cpp:747
int columns_count
Columns count.
qreal diagramWidth() const
QET::QetCollection collection
Specify the location of the title block.
QDate date() const
void setLocMach(const QString &locmach)
BorderTitleBlock::setLocMach.
QString folio
Folio information (displayed by the default template)
void borderChanged(QRectF old_border, QRectF new_border)
void setAutoPageNum(const QString &auto_page_num)
BorderTitleBlock::setAutoPageNum.
bool display_rows
Whether to display row headers.
void setPlant(const QString &plant)
BorderTitleBlock::setPlant.
void titleBlockToXml(QDomElement &)
QString title
Folio title (displayed by the default template)
QString titleBlockTemplateName() const
qreal rows_header_width
Row headers width.
int rows_count
Rows count.
QString template_name
Name of the template used to render the title block - an empty string means "the default template pro...
#define MIN_COLUMN_COUNT
void setRowsHeaderWidth(const qreal &)
bool display_columns
Whether to display column headers.
void titleBlockTemplateRemoved(const QString &, const TitleBlockTemplate *=nullptr)