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