Kate
katestyletreewidget.cpp
Go to the documentation of this file.
46 virtual void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
69 KateStyleTreeWidgetItem( QTreeWidgetItem *parent, const QString& styleName, KTextEditor::Attribute::Ptr defaultstyle, KateExtendedAttribute::Ptr data = KateExtendedAttribute::Ptr() );
70 KateStyleTreeWidgetItem( QTreeWidget *parent, const QString& styleName, KTextEditor::Attribute::Ptr defaultstyle, KateExtendedAttribute::Ptr data = KateExtendedAttribute::Ptr() );
133 headers << i18nc("@title:column Meaning of text in editor", "Context") << QString() << QString() << QString() << QString() << i18nc("@title:column Text style", "Normal") << i18nc("@title:column Text style", "Selected") << i18nc("@title:column Text style", "Background") << i18nc("@title:column Text style", "Background Selected");
169 bool KateStyleTreeWidget::edit( const QModelIndex & index, EditTrigger trigger, QEvent * event )
218 QIcon bgcl = brushIcon( i->style()->hasProperty(QTextFormat::BackgroundBrush) ? i->style()->background().color() : viewport()->palette().base().color() );
219 QIcon sbgcl = brushIcon( i->style()->hasProperty(KTextEditor::Attribute::SelectedBackground) ? i->style()->selectedBackground().color() : viewport()->palette().base().color() );
262 if ( style->hasProperty( QTextFormat::BackgroundBrush) || style->hasProperty( KTextEditor::Attribute::SelectedBackground ) )
287 static_cast<KateStyleTreeWidgetItem*>(currentItem())->changeProperty( static_cast<QAction*>(sender())->data().toInt() );
292 static_cast<KateStyleTreeWidgetItem*>(currentItem())->unsetColor( static_cast<QAction*>(sender())->data().toInt() );
302 QColor foregroundColor = firstChild->data(KateStyleTreeWidgetItem::Foreground, Qt::DisplayRole).value<QColor>();
303 QColor backgroundColor = firstChild->data(KateStyleTreeWidgetItem::Background, Qt::DisplayRole).value<QColor>();
320 void KateStyleTreeWidget::addItem( const QString & styleName, KTextEditor::Attribute::Ptr defaultstyle, KateExtendedAttribute::Ptr data )
325 void KateStyleTreeWidget::addItem( QTreeWidgetItem * parent, const QString & styleName, KTextEditor::Attribute::Ptr defaultstyle, KateExtendedAttribute::Ptr data )
341 QBrush KateStyleTreeDelegate::getBrushForColorColumn(const QModelIndex& index, int column) const
348 void KateStyleTreeDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
352 columns << KateStyleTreeWidgetItem::Foreground << KateStyleTreeWidgetItem::SelectedForeground << KateStyleTreeWidgetItem::Background << KateStyleTreeWidgetItem::SelectedBackground;
396 painter->fillRect(m_widget->style()->subElementRect(QStyle::SE_PushButtonContents, &opt,m_widget), brush);
399 KateStyleTreeWidgetItem::KateStyleTreeWidgetItem( QTreeWidgetItem *parent, const QString & stylename,
410 KateStyleTreeWidgetItem::KateStyleTreeWidgetItem( QTreeWidget *parent, const QString & stylename,
435 setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
473 /* can't compare all attributes, currentStyle has always more than defaultStyle (e.g. the item's name),
574 bool KateStyleTreeWidgetItem::defStyle() const { return actualStyle && actualStyle->properties() != defaultStyle->properties(); }
603 i18n("\"Use Default Style\" will be automatically unset when you change any style properties."),
void changed()
void setBackground(int column, const QBrush &brush)
const QColor & selectionColor() const
Definition: kateconfig.cpp:2348
QScriptValue i18n(QScriptContext *context, QScriptEngine *engine)
i18n("text", arguments [optional])
Definition: katescripthelpers.cpp:186
palette
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setColor(ColorGroup group, ColorRole role, const QColor &color)
QTreeWidgetItem * child(int index) const
Qt::BrushStyle style() const
QScriptValue i18nc(QScriptContext *context, QScriptEngine *engine)
i18nc("context", "text", arguments [optional])
Definition: katescripthelpers.cpp:210
QObject * sender() const
void setChecked(bool)
QStyle * style() const
KSharedPtr< KateExtendedAttribute > Ptr
Definition: kateextendedattribute.h:38
void setIcon(int column, const QIcon &icon)
T value() const
QWidget * viewport() const
Definition: katedefaultcolors.h:30
virtual QVariant data(int column, int role) const
QTreeWidget that automatically adds columns for KateStyleListItems and provides a popup menu and a sl...
Definition: katestyletreewidget.h:36
void update()
virtual bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event)
Definition: katestyletreewidget.cpp:169
void drawRect(const QRectF &rectangle)
bool isValid() const
virtual void showEvent(QShowEvent *event)
void resizeColumnToContents(int column)
KateStyleTreeWidget(QWidget *parent=0, bool showUseDefaults=false)
Definition: katestyletreewidget.cpp:126
void setPen(const QColor &color)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setItemDelegate(QAbstractItemDelegate *delegate)
int row() const
QTreeWidgetItem * itemAt(const QPoint &p) const
virtual QVariant data(const QModelIndex &index, int role) const =0
void addItem(QTreeWidgetItem *parent, const QString &styleName, KTextEditor::Attribute::Ptr defaultstyle, KateExtendedAttribute::Ptr data=KateExtendedAttribute::Ptr())
Definition: katestyletreewidget.cpp:325
QTreeWidgetItem * currentItem() const
int count() const
QTreeWidget * treeWidget() const
int columnCount() const
QTreeWidgetItem * itemFromIndex(const QModelIndex &index) const
virtual void showEvent(QShowEvent *event)
Definition: katestyletreewidget.cpp:197
void setData(const QVariant &userData)
void setCheckable(bool)
bool contains(const T &value) const
void setHeaderLabels(const QStringList &labels)
QTreeWidgetItem * headerItem() const
virtual void contextMenuEvent(QContextMenuEvent *event)
Definition: katestyletreewidget.cpp:204
const QAbstractItemModel * model() const
QModelIndex sibling(int row, int column) const
int column() const
const QColor & backgroundColor() const
Definition: kateconfig.cpp:2327
void edit(const QModelIndex &index)
QTreeWidgetItem * topLevelItem(int index) const
Type type() const
void setRootIsDecorated(bool show)
int topLevelItemCount() const
QString text(int column) const
void setForeground(int column, const QBrush &brush)
bool isValid() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.