Doubleclick laye table to set active and visiablity

上级 a7b18ac3
......@@ -531,3 +531,35 @@ void osm_frame_widget::show_stdio_checkbox(bool show)
{
ui->checkBox_stdio->setVisible(show);
}
void osm_frame_widget::on_tableView_QTV_layers_doubleClicked(const QModelIndex &index)
{
QVector <layer_interface *> layers = ui->widget_QTV_mainMap->layers();
int nItems = layers.size();
if (index.isValid())
{
int row = index.row();
if (row >=0 && row < layers.size())
{
if (index.column()==1)
{
bool bact = layers[nItems - 1 -row]->is_active();
layers[nItems - 1 -row]->set_active(!bact);
if (!bact)
ui->widget_QTV_mainMap->adjust_layers(layers[nItems - 1 -row]);
}
else if (index.column()==2)
{
layers[nItems - 1 -row]->set_visible(!layers[nItems - 1 -row]->is_visible());
}
UpdateLayerTable();
ui->widget_QTV_mainMap->UpdateWindow();
}
}
}
......@@ -67,6 +67,8 @@ protected slots:
void on_pushButton_QTV_deactive_clicked();
void on_pushButton_QTV_saveToFile_clicked();
void on_checkBox_stdio_toggled(bool checked);
private slots:
void on_tableView_QTV_layers_doubleClicked(const QModelIndex &index);
};
#endif // OSM_FRAME_WIDGET_H
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册