/** * Commits settings changes to the configuration object. */ void PrefFont::apply() { FontListItem* pItem; // Create a list item for every GUI element for (pItem = (FontListItem*)m_pList->firstChild(); pItem != NULL; pItem = (FontListItem*)pItem->nextSibling()) { Config().setFont(pItem->getElement(), pItem->getFont()); } }
/** * Displays a font selection dialogue when an item is selected. * If the user chooses a new font, it is set to the selected item. * This slot is connected to both the doubleClicked() and the returnPressed() * signals of the list view. * @param pItem The selected item */ void PrefFont::slotItemSelected(QListViewItem* pItem) { FontListItem* pFontItem; QFont font; pFontItem = (FontListItem*)pItem; font = pFontItem->getFont(); if (KFontDialog::getFont(font) == QDialog::Accepted) { pFontItem->setFont(font); emit modified(); } }