void BufferView::init() {
setIndentation(10);
header()->setContextMenuPolicy(Qt::ActionsContextMenu);
+ hideColumn(1);
+ hideColumn(2);
expandAll();
setAnimated(true);
sectionName = (model->headerData(i, Qt::Horizontal, Qt::DisplayRole)).toString();
showSection = new QAction(sectionName, header());
showSection->setCheckable(true);
- showSection->setChecked(true);
+ showSection->setChecked(!isColumnHidden(i));
showSection->setProperty("column", i);
connect(showSection, SIGNAL(toggled(bool)), this, SLOT(toggleHeader(bool)));
header()->addAction(showSection);
void BufferView::toggleHeader(bool checked) {
QAction *action = qobject_cast<QAction *>(sender());
- header()->setSectionHidden((action->property("column")).toInt(), not checked);
+ header()->setSectionHidden((action->property("column")).toInt(), !checked);
}