granatier
playerselector.cpp
Go to the documentation of this file.
49 virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
66 Private(PlayerSettings* playerSettings, Options options, PlayerSelector* q) : q(q), m_playerSettings(playerSettings), m_options(options), m_knsButton(0) {}
84 d->m_list->setMinimumSize(itemSizeHint.width() + 2 * scrollBarSizeHint.width(), 3.3 * itemSizeHint.height());
126 renderer.load(KStandardDirs::locate("appdata", QString("players/%1").arg(m_playerSettings->playerGraphicsFile(playerIDs[i]))));
130 KConfig desktopFile(KStandardDirs::locate("appdata", "players/" + playerIDs[i]), KConfig::SimpleConfig);
132 QString authorEmail = QString("<a href=\"mailto:%1\">%1</a>").arg(desktopFile.group("KGameTheme").readEntry<QString>("AuthorEmail", ""));
133 //TODO: QString description = desktopFile.group("KGameTheme").readEntry<QString>("Description", "");
222 void PlayerSelectorDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& /*index*/) const
228 QSize PlayerSelectorDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
232 return QSize(600, 64 /*player preview height*/ + 2 * 6 /*padding*/ + 40 /* some space for the player name */);
QLayout * layout() const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
int width() const
Enable downloading of additional themes with KNewStuff3.
Definition: playerselector.h:38
void render(QPainter *painter)
PlayerSelector(PlayerSettings *playerSettings, Options options=DefaultBehavior, QWidget *parent=0)
Definition: playerselector.cpp:71
void setPlayerAuthor(const QString &name, const QString &mail)
Definition: playerselectoritem.cpp:159
bool isVisible() const
void setPlayerPreviewPixmap(const QPixmap &pixmap)
Definition: playerselectoritem.cpp:149
Qt::ItemFlags flags() const
void setParent(QWidget *parent)
Definition: playerselectoritem.h:29
Definition: playerselector.h:28
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
int count(const T &value) const
bool load(const QString &filename)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setFlags(QFlags< Qt::ItemFlag > flags)
bool isEmpty() const
void setItemDelegate(QAbstractItemDelegate *delegate)
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: playersettings.h:27
void deleteLater()
void hide()
void setMargin(int margin)
const QAbstractItemModel * model() const
QStyle * style()
void setCaption(const QString &c)
int height() const
virtual void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const =0
void show()
virtual void closeEvent(QCloseEvent *event)
void showAsDialog(const QString &caption=QString())
Create and show a non-modal dialog which displays this selector.
Definition: playerselector.cpp:203
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
virtual bool event(QEvent *event)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.