mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-14 21:49:57 +01:00
Add a new tab in settings, user can select a font size, a rotation angle
and a text width by default for new dynamic text, it work also in element editor command. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5568 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -54,11 +54,19 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
|
||||
settings.value("diagramitemstyle").toString() + ")";
|
||||
ui->m_font_pb->setText(fontInfos);
|
||||
|
||||
QString dynamicfontInfos = settings.value("dynamicitemfont").toString() + " " +
|
||||
settings.value("dynamicitemsize").toString() + " (" +
|
||||
settings.value("dynamicitemstyle").toString() + ")";
|
||||
ui->m_dynamic_font_pb->setText(dynamicfontInfos);
|
||||
|
||||
QString foliolistfontInfos = settings.value("foliolistfont").toString() + " " +
|
||||
settings.value("foliolistsize").toString() + " (" +
|
||||
settings.value("folioliststyle").toString() + ")";
|
||||
ui->m_folio_list_pb->setText(foliolistfontInfos);
|
||||
|
||||
ui->m_rotation->setValue(settings.value("dynamic_rotation", 0).toInt());
|
||||
ui->m_text_width_sb->setValue(settings.value("dynamic_with", 0).toInt());
|
||||
|
||||
ui->m_highlight_integrated_elements->setChecked(settings.value("diagrameditor/highlight-integrated-elements", true).toBool());
|
||||
ui->m_default_elements_info->setPlainText(settings.value("elementeditor/default-informations", "").toString());
|
||||
|
||||
@@ -117,6 +125,8 @@ void GeneralConfigurationPage::applyConf()
|
||||
settings.setValue("nomenclature/terminal-exportlist",ui->m_export_terminal->isChecked());
|
||||
settings.setValue("border-columns_0",ui->m_border_0->isChecked());
|
||||
settings.setValue("diagrameditor/autosave-interval", ui->m_autosave_sb->value());
|
||||
settings.setValue("dynamic_rotation", ui->m_rotation->value());
|
||||
settings.setValue("dynamic_with", ui->m_text_width_sb->value());
|
||||
|
||||
QString path = settings.value("elements-collections/common-collection-path").toString();
|
||||
if (ui->m_common_elmt_path_cb->currentIndex() == 1)
|
||||
@@ -232,6 +242,29 @@ void GeneralConfigurationPage::on_m_font_pb_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GeneralConfigurationPage::m_dynamic_font_pb_clicked
|
||||
* Apply font to config
|
||||
*/
|
||||
void GeneralConfigurationPage::on_m_dynamic_font_pb_clicked()
|
||||
{
|
||||
bool ok;
|
||||
QSettings settings;
|
||||
QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
|
||||
if (ok)
|
||||
{
|
||||
settings.setValue("dynamicitemfont", font.family());
|
||||
settings.setValue("dynamicitemsize", font.pointSize());
|
||||
settings.setValue("dynamicitemweight", font.weight());
|
||||
settings.setValue("dynamicitemstyle", font.styleName());
|
||||
QString fontInfos = settings.value("dynamicitemfont").toString() + " " +
|
||||
settings.value("dynamicitemsize").toString() + " (" +
|
||||
settings.value("dynamicitemstyle").toString() + ")";
|
||||
ui->m_dynamic_font_pb->setText(fontInfos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief GeneralConfigurationPage::on_m_folio_list_pb_clicked
|
||||
* Apply font to summary pages
|
||||
@@ -282,3 +315,4 @@ void GeneralConfigurationPage::on_m_custom_elmt_path_cb_currentIndexChanged(int
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ class GeneralConfigurationPage : public ConfigPage
|
||||
|
||||
private slots:
|
||||
void on_m_font_pb_clicked();
|
||||
void on_m_dynamic_font_pb_clicked();
|
||||
void on_m_folio_list_pb_clicked();
|
||||
void on_m_common_elmt_path_cb_currentIndexChanged(int index);
|
||||
void on_m_custom_elmt_path_cb_currentIndexChanged(int index);
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>4</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
@@ -169,7 +169,7 @@
|
||||
<x>0</x>
|
||||
<y>20</y>
|
||||
<width>971</width>
|
||||
<height>376</height>
|
||||
<height>391</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
@@ -468,6 +468,99 @@ Vous pouvez spécifier ici la valeur par défaut de ce champ pour les éléments
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Textes dynamiques</string>
|
||||
</attribute>
|
||||
<widget class="QGroupBox" name="groupBox6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>20</y>
|
||||
<width>971</width>
|
||||
<height>391</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>100</y>
|
||||
<width>535</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rotation des textes dynamiques</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="m_rotation">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>850</x>
|
||||
<y>110</y>
|
||||
<width>87</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>360</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="m_dynamic_font_pb">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>804</x>
|
||||
<y>60</y>
|
||||
<width>141</width>
|
||||
<height>34</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>535</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Police des textes dynamiques</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="m_text_width_sb">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>850</x>
|
||||
<y>150</y>
|
||||
<width>91</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>150</y>
|
||||
<width>211</width>
|
||||
<height>18</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Longueur des textes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -491,6 +584,9 @@ Vous pouvez spécifier ici la valeur par défaut de ce champ pour les éléments
|
||||
<tabstop>m_highlight_integrated_elements</tabstop>
|
||||
<tabstop>m_default_elements_info</tabstop>
|
||||
<tabstop>m_lang_cb</tabstop>
|
||||
<tabstop>m_dynamic_font_pb</tabstop>
|
||||
<tabstop>m_rotation</tabstop>
|
||||
<tabstop>m_text_width_sb</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
Reference in New Issue
Block a user