IMPORTANT (consider merging): fixed a potential segfault on LayoutView construction

This commit is contained in:
Matthias Koefferlein 2022-05-06 00:02:35 +02:00
parent 51666eb439
commit a2b90d7a8e
3 changed files with 13 additions and 2 deletions

View File

@ -301,8 +301,8 @@ LayerControlPanel::LayerControlPanel (lay::LayoutView *view, db::Manager *manage
mp_model = new lay::LayerTreeModel (this, view);
mp_layer_list = new LCPTreeWidget (this, mp_model, "layer_tree");
mp_layer_list->setUniformRowHeights (true);
mp_model->set_font (mp_layer_list->font ());
mp_layer_list->setIconSize (mp_model->icon_size ());
mp_model->set_font_no_signal (mp_layer_list->font ());
l->addWidget (mp_layer_list);
connect (mp_layer_list, SIGNAL (double_clicked (const QModelIndex &, Qt::KeyboardModifiers)), this, SLOT (double_clicked (const QModelIndex &, Qt::KeyboardModifiers)));

View File

@ -203,7 +203,13 @@ LayerTreeModel::set_font (const QFont &font)
signal_data_changed ();
}
void
void
LayerTreeModel::set_font_no_signal (const QFont &font)
{
m_font = font;
}
void
LayerTreeModel::set_text_color (QColor color)
{
m_text_color = color;

View File

@ -151,6 +151,11 @@ public:
*/
void set_font (const QFont &font);
/**
* @brief Set the font to use for text display (without emitting a signal)
*/
void set_font_no_signal (const QFont &font);
/**
* @brief Set the text color to use for text display
*/