KTextEditor
katestyletreewidget.cpp
31 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
135 headers << i18nc("@title:column Meaning of text in editor", "Context") << QString() << QString() << QString() << QString()
136 << i18nc("@title:column Text style", "Normal") << i18nc("@title:column Text style", "Selected") << i18nc("@title:column Text style", "Background")
233 QIcon bgcl = i->style()->hasProperty(QTextFormat::BackgroundBrush) ? brushIcon(i->style()->background().color()) : emptyColorIcon;
234 QIcon sbgcl = i->style()->hasProperty(CustomProperties::SelectedBackground) ? brushIcon(i->style()->selectedBackground().color()) : emptyColorIcon;
263 a = m.addAction(scl, i18nc("@action:inmenu", "&Selected Color…"), this, SLOT(changeProperty()));
266 a = m.addAction(bgcl, i18nc("@action:inmenu", "&Background Color…"), this, SLOT(changeProperty()));
269 a = m.addAction(sbgcl, i18nc("@action:inmenu", "S&elected Background Color…"), this, SLOT(changeProperty()));
289 a = m.addAction(emptyColorIcon, i18n("Unset Selected Background Color"), this, SLOT(unsetColor()));
305 static_cast<KateStyleTreeWidgetItem *>(currentItem())->changeProperty(static_cast<QAction *>(sender())->data().toInt());
310 static_cast<KateStyleTreeWidgetItem *>(currentItem())->unsetColor(static_cast<QAction *>(sender())->data().toInt());
320 QColor foregroundColor = firstChild->data(KateStyleTreeWidgetItem::Foreground, Qt::DisplayRole).value<QColor>();
321 QColor backgroundColor = firstChild->data(KateStyleTreeWidgetItem::Background, Qt::DisplayRole).value<QColor>();
338void KateStyleTreeWidget::addItem(const QString &styleName, KTextEditor::Attribute::Ptr defaultstyle, KTextEditor::Attribute::Ptr data)
343void KateStyleTreeWidget::addItem(QTreeWidgetItem *parent, const QString &styleName, KTextEditor::Attribute::Ptr defaultstyle, KTextEditor::Attribute::Ptr data)
364void KateStyleTreeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
368 columns << KateStyleTreeWidgetItem::Foreground << KateStyleTreeWidgetItem::SelectedForeground << KateStyleTreeWidgetItem::Background
415 painter->fillRect(m_widget->style()->subElementRect(QStyle::SE_PushButtonContents, &opt, m_widget), brush);
457 setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
498 /* can't compare all attributes, currentStyle has always more than defaultStyle (e.g. the item's name),
500 return toCheckState(currentStyle->foreground() == defaultStyle->foreground() && currentStyle->background() == defaultStyle->background()
503 && currentStyle->fontBold() == defaultStyle->fontBold() && currentStyle->fontItalic() == defaultStyle->fontItalic()
642 i18n("\"Use Default Style\" will be automatically unset when you change any style properties."),
QExplicitlySharedDataPointer< Attribute > Ptr
Shared data pointer for Attribute.
Definition attribute.h:56
QTreeWidget that automatically adds columns for KateStyleListItems and provides a popup menu and a sl...
Definition katestyletreewidget.h:23
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
KIOCORE_EXPORT CopyJob * move(const QList< QUrl > &src, const QUrl &dest, JobFlags flags=DefaultFlags)
void information(QWidget *parent, const QString &text, const QString &title=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
void initStyle()
virtual QVariant data(const QModelIndex &index, int role) const const=0
DoubleClicked
QModelIndex currentIndex() const const
virtual bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event)
void update(const QModelIndex &index)
QWidget * viewport() const const
void setCheckable(bool)
void setChecked(bool)
void setData(const QVariant &data)
bool isValid() const const
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, ColorDialogOptions options)
QIcon fromTheme(const QString &name)
QBrush
int column() const const
bool isValid() const const
const QAbstractItemModel * model() const const
int row() const const
QModelIndex sibling(int row, int column) const const
Q_EMITQ_EMIT
QObject * parent() const const
QObject * sender() const const
void fillRect(const QRect &rectangle, QGradient::Preset preset)
void setPen(Qt::PenStyle style)
Window
void setColor(ColorGroup group, ColorRole role, const QColor &color)
bool contains(const QSet< T > &other) const const
bool isEmpty() const const
CE_PushButton
SE_PushButtonContents
virtual void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const const=0
virtual QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const const=0
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const const override
CheckState
black
DisplayRole
ItemIsSelectable
BackgroundBrush
void resizeColumnToContents(int column)
columnCount
QTreeWidgetItem * currentItem() const const
virtual bool event(QEvent *e) override
QTreeWidgetItem * itemAt(const QPoint &p) const const
QTreeWidgetItem * itemFromIndex(const QModelIndex &index) const const
QTreeWidgetItem * topLevelItem(int index) const const
topLevelItemCount
QTreeWidgetItem * child(int index) const const
virtual QVariant data(int column, int role) const const
QTreeWidgetItem * parent() const const
void setBackground(int column, const QBrush &brush)
void setFlags(Qt::ItemFlags flags)
void setForeground(int column, const QBrush &brush)
QString text(int column) const const
QTreeWidget * treeWidget() const const
int userType() const const
T value() const const
palette
virtual void showEvent(QShowEvent *event)
QStyle * style() const const
void update()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.