KDEGames
kchatbase.cpp
28KChatBasePrivate::KChatBasePrivate(KChatBaseModel *model, KChatBaseItemDelegate *delegate, QWidget *parent)
56KChatBase::KChatBase(QWidget *parent, KChatBaseModel *model, KChatBaseItemDelegate *delegate, bool noComboBox)
75 connect(d->mModel, &QAbstractItemModel::rowsInserted, d->mBox, &QAbstractItemView::scrollToBottom);
116 qCDebug(KDEGAMESPRIVATE_LOG) << "custom menu has been requested at position=" << pos << ". Implement handler at subclass if you need it.";
157 qCCritical(KDEGAMESPRIVATE_LOG) << "KChatBase: Cannot add more than one entry with the same ID! ";
A delegate (see the Qt Model/View module for details) to paint the lines of the KChatBase list model ...
Definition kchatbaseitemdelegate.h:28
The model used to store messages displayed in the chat dialog messages list.
Definition kchatbasemodel.h:70
void setBothFont(const QFont &font)
This sets both - nameFont and messageFont to font.
Definition kchatbase.cpp:368
KChatBase(QWidget *parent, KChatBaseModel *model=nullptr, KChatBaseItemDelegate *delegate=nullptr, bool noComboBox=false)
Definition kchatbase.cpp:56
virtual QString fromName() const =0
bool insertSendingEntry(const QString &text, int id, int index=-1)
Inserts a new entry in the combo box.
Definition kchatbase.cpp:148
void setNameFont(const QFont &font)
Set the font that is used for the name part of a message.
Definition kchatbase.cpp:354
virtual void addSystemMessage(const QString &fromName, const QString &text)
This works just like addMessage but adds a system message.
Definition kchatbase.cpp:403
QFont systemMessageFont() const
Same as systemMessageFont but applies only to system messages.
Definition kchatbase.cpp:347
void changeSendingEntry(const QString &text, int id)
This changes a combo box entry.
Definition kchatbase.cpp:204
void setSystemNameFont(const QFont &font)
Same as setNameFont but applies only to system messages.
Definition kchatbase.cpp:375
void setSystemBothFont(const QFont &font)
Same as setBothFont but applies only to system messages.
Definition kchatbase.cpp:389
void setSystemMessageFont(const QFont &font)
Same as setMessageFont but applies only to system messages.
Definition kchatbase.cpp:382
void setMessageFont(const QFont &font)
Set the font that is used for the message part of a message.
Definition kchatbase.cpp:361
virtual void addMessage(const QString &fromName, const QString &text)
Add a text in the listbox.
Definition kchatbase.cpp:396
virtual QString comboBoxItem(const QString &name) const
Replace to customize the combo box.
Definition kchatbase.cpp:260
void setCompletionMode(KCompletion::CompletionMode mode)
See KLineEdit::setCompletionMode.
Definition kchatbase.cpp:270
virtual void returnPressed(const QString &text)=0
This is called whenever the user pushed return ie wants to send a message.
virtual void saveConfig(KConfig *conf=nullptr)
Save the configuration of the dialog to a KConfig object.
Definition kchatbase.cpp:277
virtual void readConfig(KConfig *conf=nullptr)
Read the configuration from a KConfig object.
Definition kchatbase.cpp:287
QFont systemNameFont() const
Same as systemNameFont but applies only to system messages.
Definition kchatbase.cpp:340
QFont nameFont() const
This font should be used for the name (the "from: " part) of a message.
Definition kchatbase.cpp:326
bool addSendingEntry(const QString &text, int id)
Adds a new entry in the combo box.
Definition kchatbase.cpp:139
void removeSendingEntry(int id)
Removes the entry with the ID id from the combo box.
Definition kchatbase.cpp:189
QModelIndex indexAt(QPoint pos) const
Returns the model index of the message at the viewport coordinates point.
Definition kchatbase.cpp:107
void setMaxItems(int maxItems)
Set the maximum number of items in the list.
Definition kchatbase.cpp:304
CompletionMode
CompletionNone
void returnKeyPressed(const QString &text)
QString i18n(const char *text, const TYPE &arg...)
void rowsInserted(const QModelIndex &parent, int first, int last)
SingleSelection
void scrollToBottom()
void addLayout(QLayout *layout, int stretch)
void addSpacing(int size)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
qsizetype length() const const
CustomContextMenu
NoFocus
void customContextMenuRequested(const QPoint &pos)
font
void setMinimumHeight(int minh)
void setMinimumWidth(int minw)
pos
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.