[qet] qet/qet: [5166] Add a Qfontdialog for choose policy for independent text item, not |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5166
Author: scorpio810
Date: 2017-12-10 17:10:19 +0100 (Sun, 10 Dec 2017)
Log Message:
-----------
Add a Qfontdialog for choose policy for independent text item, not
finished yet !
Modified Paths:
--------------
trunk/sources/configpages.cpp
trunk/sources/qetapp.cpp
Modified: trunk/sources/configpages.cpp
===================================================================
--- trunk/sources/configpages.cpp 2017-12-10 14:31:27 UTC (rev 5165)
+++ trunk/sources/configpages.cpp 2017-12-10 16:10:19 UTC (rev 5166)
@@ -27,6 +27,8 @@
#include "qetproject.h"
#include "reportproperties.h"
#include "qetapp.h"
+#include <QFontDialog>
+#include <QFont>
/**
* @brief NewDiagramPage::NewDiagramPage
@@ -251,6 +253,15 @@
terminal_exportlist_ = new QCheckBox(tr("Exporter les bornes dans la nomenclature"), projects_view_mode_);
m_zoom_out_beyond_folio = new QCheckBox(tr("Autoriser le dézoom au delà du folio"), this);
+ bool ok;
+QFont font = QFontDialog::getFont(&ok, QFont(), this);
+if (ok) {
+ settings.setValue("diagramitemfont", font.family());
+ settings.setValue("diagramitemsize", font.pointSize());
+ settings.setValue("diagramitemweight", font.weight());
+ settings.setValue("diagramitemstyle", font.styleName());
+}
+
elements_management_ = new QGroupBox(tr("Gestion des éléments"), this);
highlight_integrated_elements_ = new QCheckBox(tr("Mettre en valeur dans le panel les éléments fraîchement intégrés", "configuration option"));
default_element_infos_label_ = new QLabel(
Modified: trunk/sources/qetapp.cpp
===================================================================
--- trunk/sources/qetapp.cpp 2017-12-10 14:31:27 UTC (rev 5165)
+++ trunk/sources/qetapp.cpp 2017-12-10 16:10:19 UTC (rev 5166)
@@ -791,12 +791,16 @@
//Font to use
QString diagram_texts_item_family = settings.value("diagramitemfont", "Sans Serif").toString();
qreal diagram_texts_item_size = settings.value("diagramitemsize", 9.0).toDouble();
-
+ qreal diagram_texts_item_weight = settings.value("diagramitemweight").toDouble();
+ QString diagram_texts_item_style = settings.value("diagramitemsstyle", "normal").toString();
+
if (size != -1.0) {
diagram_texts_item_size = size;
}
QFont diagram_texts_item_font = QFont(diagram_texts_item_family);
diagram_texts_item_font.setPointSizeF(diagram_texts_item_size);
+ diagram_texts_item_font.setWeight(diagram_texts_item_weight);
+ diagram_texts_item_font.setStyleName(diagram_texts_item_style);
if (diagram_texts_item_size <= 4.0) {
diagram_texts_item_font.setWeight(QFont::Light);
}