void IdDialog::processSettings(bool load) { QHeaderView *header = ui->treeWidget_IdList->header(); Settings->beginGroup("IdDialog"); if (load) { // load settings // filterColumn ui->filterLineEdit->setCurrentFilter(Settings->value("filterColumn", RSID_COL_NICKNAME).toInt()); // state of thread tree header->restoreState(Settings->value("IdList").toByteArray()); // state of splitter ui->splitter->restoreState(Settings->value("splitter").toByteArray()); } else { // save settings // filterColumn Settings->setValue("filterColumn", ui->filterLineEdit->currentFilter()); // state of thread tree Settings->setValue("IdList", header->saveState()); // state of splitter Settings->setValue("splitter", ui->splitter->saveState()); } Settings->endGroup(); }
void PlayListWidget::saveState(KSharedConfigPtr cfg) { KConfigGroup g = cfg->group("PlayListWidget"); QHeaderView* v = view->header(); g.writeEntry("play_list_state",v->saveState()); g.writeEntry("random_mode",random_mode->isChecked()); }
void KFLogTreeWidget::saveConfig() { if( confName.isEmpty() ) { // Configuration name is empty, do nothing. return; } QHeaderView* headerView = header(); if( headerView->count() == 0 ) { return; } QByteArray array = headerView->saveState(); QString path = "/KFLogTreeWidget/" + confName + "-Header"; _settings.setValue( path, array ); }
QByteArray ListingTable::saveState() { QHeaderView* header = horizontalHeader(); return header->saveState(); }