[qet] [1143] It is now possible to specify the font size of a title block template field using the "fontsize" attribute. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 1143
Author: xavier
Date: 2011-01-09 22:56:52 +0100 (Sun, 09 Jan 2011)
Log Message:
-----------
It is now possible to specify the font size of a title block template field using the "fontsize" attribute.
Modified Paths:
--------------
branches/0.3/sources/titleblockcell.h
branches/0.3/sources/titleblocktemplate.cpp
Modified: branches/0.3/sources/titleblockcell.h
===================================================================
--- branches/0.3/sources/titleblockcell.h 2011-01-09 15:16:51 UTC (rev 1142)
+++ branches/0.3/sources/titleblockcell.h 2011-01-09 21:56:52 UTC (rev 1143)
@@ -36,6 +36,7 @@
QString label;
bool display_label;
int alignment;
+ int font_size;
QString logo_reference;
};
#endif
Modified: branches/0.3/sources/titleblocktemplate.cpp
===================================================================
--- branches/0.3/sources/titleblocktemplate.cpp 2011-01-09 15:16:51 UTC (rev 1142)
+++ branches/0.3/sources/titleblocktemplate.cpp 2011-01-09 21:56:52 UTC (rev 1143)
@@ -273,6 +273,12 @@
if (cell_element.hasAttribute("displaylabel") && cell_element.attribute("displaylabel").compare("false", Qt::CaseInsensitive) == 0) {
loaded_cell -> display_label = false;
}
+ int fontsize;
+ if (QET::attributeIsAnInteger(cell_element, "fontsize", &fontsize)) {
+ loaded_cell -> font_size = fontsize;
+ } else {
+ loaded_cell -> font_size = -1;
+ }
// horiwontal and vertical alignments
loaded_cell -> alignment = 0;
@@ -489,7 +495,6 @@
// prepare the QPainter
painter.setPen(Qt::black);
painter.setBrush(Qt::white);
- painter.setFont(QETApp::diagramTextsFont());
// draw the titleblock border
painter.drawRect(QRect(0, 0, titleblock_width, titleblock_height));
@@ -520,6 +525,7 @@
painter.drawPixmap(cell_rect, *(bitmap_logos_[cells_[i][j].logo_reference]));
}
} else {
+ painter.setFont(cells_[i][j].font_size == -1 ? QETApp::diagramTextsFont() : QETApp::diagramTextsFont(cells_[i][j].font_size));
painter.drawText(cell_rect, cells_[i][j].alignment, finalTextForCell(cells_[i][j], diagram_context));
}