if(this->QTableWidget::columnCount() != 3) {
this->table_widget::set_column_count(3, false); //calls setColumnCount
this->setColumnWidth(0, 200); //does not work
this->setColumnWidth(1, 40); //neither does this
this->setColumnWidth(2, 40); //...
}
this->QTableWidget::insertRow(this->cur_index); //cur_index = current row
this->QTableWidget::setItem(this->cur_index, 0, new dfts::var_table_item(*var, flags));
this->QTableWidget::setItem(this->cur_index, 1, new dfts::var_table_item);
this->QTableWidget::setItem(this->cur_index, 2, new dfts::var_table_item);
this
->set_cell_widget
(this
->cur_index,
1, create_default_color_combobox
(QSize(40,
0)));
//create a combobox size 40:constructor-default this
->set_cell_widget
(this
->cur_index,
2, create_default_color_combobox
(QSize(40,
0)));
if(this->QTableWidget::columnCount() != 3) {
this->table_widget::set_column_count(3, false); //calls setColumnCount
this->setColumnWidth(0, 200); //does not work
this->setColumnWidth(1, 40); //neither does this
this->setColumnWidth(2, 40); //...
}
this->QTableWidget::insertRow(this->cur_index); //cur_index = current row
this->QTableWidget::setItem(this->cur_index, 0, new dfts::var_table_item(*var, flags));
this->QTableWidget::setItem(this->cur_index, 1, new dfts::var_table_item);
this->QTableWidget::setItem(this->cur_index, 2, new dfts::var_table_item);
this->set_cell_widget(this->cur_index, 1, create_default_color_combobox(QSize(40, 0))); //create a combobox size 40:constructor-default
this->set_cell_widget(this->cur_index, 2, create_default_color_combobox(QSize(40, 0)));
To copy to clipboard, switch view to plain text mode
horizontal and vertical headers are set invisible, in case that matters.
Bookmarks