void OptionsDialog::slotFontDefaultBtnClicked() { FontListItem *fontItem; for(int i=0; i < global->fontCount(); i++) { fontItem=static_cast<FontListItem*>(f_List->item(i)); fontItem->setFont(global->defaultFont(i)); } f_List->triggerUpdate(false); }
/** * 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(); } }
// show font dialog for the entry void OptionsDialog::slotFontItemSelected(QListBoxItem *it) { if (it) { FontListItem *fontItem = static_cast<FontListItem*>(it); QFont font = fontItem->font(); int result = KFontDialog::getFont(font,false,this); if (result == KFontDialog::Accepted) { fontItem->setFont(font); f_List->triggerUpdate(false); slotChanged(); } } }