Example #1
0
/**
 * Commits settings changes to the configuration object.
 */
void PrefColor::apply()
{
	ColorListItem* pItem;
	
	// Create a list item for every GUI element
	for (pItem = (ColorListItem*)m_pList->firstChild(); pItem != NULL; 
		pItem = (ColorListItem*)pItem->nextSibling()) {
		Config().setColor(pItem->getElement(), pItem->getColor());
	}
}
Example #2
0
/**
 * Displays a colour selection dialogue when an item is selected.
 * If the user chooses a new colour, 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 PrefColor::slotItemSelected(QListViewItem* pItem)
{
	ColorListItem* pClrItem;
	QColor clr;
	
	pClrItem = (ColorListItem*)pItem;
	if (KColorDialog::getColor(clr, pClrItem->getColor()) == 
		QDialog::Accepted) {
		pClrItem->setColor(clr);
		emit modified();
	}
}