[qet] qet/qet: [5168] Add a button in config page for open Qfontdialog widget |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5168
Author: scorpio810
Date: 2017-12-11 01:52:33 +0100 (Mon, 11 Dec 2017)
Log Message:
-----------
Add a button in config page for open Qfontdialog widget
Modified Paths:
--------------
trunk/sources/configpages.cpp
trunk/sources/configpages.h
Modified: trunk/sources/configpages.cpp
===================================================================
--- trunk/sources/configpages.cpp 2017-12-10 22:05:57 UTC (rev 5167)
+++ trunk/sources/configpages.cpp 2017-12-11 00:52:33 UTC (rev 5168)
@@ -253,15 +253,9 @@
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());
-}
+ QPushButton *fontButton = new QPushButton(tr("Choix de la police de texte utilisée pour les textes independants"));
+
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(
@@ -304,7 +298,8 @@
projects_view_mode_layout -> addWidget(save_label_paste_);
projects_view_mode_layout -> addWidget(folio_panel_);
projects_view_mode_layout -> addWidget(terminal_exportlist_);
-
+ projects_view_mode_layout-> addWidget(fontButton, 0, 0);
+ connect(fontButton, SIGNAL(clicked()), this, SLOT(setFont()));
projects_view_mode_ -> setLayout(projects_view_mode_layout);
QVBoxLayout *elements_management_layout = new QVBoxLayout();
@@ -525,3 +520,20 @@
QString PrintConfigPage::title() const {
return(tr("Impression", "configuration page title"));
}
+/**
+ * @brief GeneralConfigurationPage::setFont
+ * Apply font to config
+ */
+void GeneralConfigurationPage::setFont()
+{
+ bool ok;
+ QSettings settings;
+ 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());
+ }
+}
+
Modified: trunk/sources/configpages.h
===================================================================
--- trunk/sources/configpages.h 2017-12-10 22:05:57 UTC (rev 5167)
+++ trunk/sources/configpages.h 2017-12-11 00:52:33 UTC (rev 5168)
@@ -18,6 +18,7 @@
#ifndef CONFIG_PAGES_H
#define CONFIG_PAGES_H
#include <QtWidgets>
+#include <QDialog>
#include "configpage.h"
#include "projectpropertiesdialog.h"
#include "titleblockpropertieswidget.h"
@@ -90,6 +91,9 @@
private:
void fillLang(QSettings &);
+public slots:
+ void setFont();
+
// attributes
private:
QLabel *title_label_;
@@ -112,6 +116,7 @@
QGroupBox *lang_group_box;
QComboBox *lang_combo_box;
QLabel *lang_label;
+ QPushButton *fontButton;
};
/**