void KGameProgress::paletteChange() { QPalette p = kapp->palette(); const QColorGroup &colorGroup = p.active(); if (!use_supplied_bar_color) bar_color = colorGroup.highlight(); bar_text_color = colorGroup.highlightedText(); text_color = colorGroup.text(); setPalette(p); adjustStyle(); }
void KProgress::initialize() { //setFrameStyle(QFrame::Panel | QFrame::Sunken); //setLineWidth(2); //setMidLineWidth(2); bar_pixmap = 0; bar_style = Solid; bar_color = kapp->selectColor; bar_text_color = kapp->selectTextColor; text_color = kapp->textColor; setBackgroundColor( kapp->windowColor ); setFont(QFont("helvetica", 12, QFont::Bold)); text_enabled = TRUE; adjustStyle(); }
void ExpandingDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optionOld, const QModelIndex &index) const { QStyleOptionViewItem option(optionOld); m_currentIndex = index; adjustStyle(index, option); if (index.column() == 0) { model()->placeExpandingWidget(index); } //Make sure the decorations are painted at the top, because the center of expanded items will be filled with the embedded widget. if (model()->isPartiallyExpanded(index) == ExpandingWidgetModel::ExpandUpwards) { m_cachedAlignment = Qt::AlignBottom; } else { m_cachedAlignment = Qt::AlignTop; } option.decorationAlignment = m_cachedAlignment; option.displayAlignment = m_cachedAlignment; //qCDebug(LOG_KTE) << "Painting row " << index.row() << ", column " << index.column() << ", internal " << index.internalPointer() << ", drawselected " << option.showDecorationSelected << ", selected " << (option.state & QStyle::State_Selected); m_cachedHighlights.clear(); m_backgroundColor = getUsedBackgroundColor(option, index); if (model()->indexIsItem(index)) { m_currentColumnStart = 0; m_cachedHighlights = createHighlighting(index, option); } /*qCDebug(LOG_KTE) << "Highlights for line:"; foreach (const QTextLayout::FormatRange& fr, m_cachedHighlights) qCDebug(LOG_KTE) << fr.start << " len " << fr.length << " format ";*/ QItemDelegate::paint(painter, option, index); ///This is a bug workaround for the Qt raster paint engine: It paints over widgets embedded into the viewport when updating due to mouse events ///@todo report to Qt Software if (model()->isExpanded(index) && model()->expandingWidget(index)) { model()->expandingWidget(index)->update(); } }
void KGameProgress::styleChange(QStyle&) { adjustStyle(); }
void KProgress::styleChange(GUIStyle) { adjustStyle(); }