KDEGames
kgamehighscoredialog.cpp
52 QMap<QByteArray, QList<QLabel *>> labels; ///< For each group, the labels along each row in turn starting from "#1"
178void KGameHighScoreDialog::initFromDifficulty(const KGameDifficulty *diff, bool doSetConfigGroup)
271 QString tabName = groupKey.isEmpty() ? i18nc("@title:tab", "High Scores") : findTranslatedGroupName(groupKey);
297 layout->addWidget(label, 3, col[field], field <= KGameHighScoreDialog::Name ? Qt::AlignLeft : Qt::AlignRight);
309 label = new QLabel(i18nc("Enumeration (#1, #2 ...) of the highscore entries", "#%1", num), widget);
353 // Only display the comment on the page with the new score (or) this one if there's only one tab
445 if (!groupKeyList.contains(configGroup)) // If the current group doesn't have any entries, add it to the list to process
447 qCDebug(KDEGAMES_HIGHSCORE_LOG) << "The current high score group " << configGroup << " isn't in the list, adding it";
466 highscoreObject->setHighscoreGroup(QLatin1String(tempCurrentGroup)); // reset to the user-set group name
469 if ((scores[groupKey][0].value(KGameHighScoreDialog::Score) == QLatin1String("-")) && (scores.size() > 1) && (latest.first != groupKey)) {
506 d->latest.first = d->configGroup; // Temporarily set this so loadScores() knows not to delete this group
512 FieldInfo score = d->scores[d->configGroup].at(i); // First look at the score in the config file
550 d->buttonBox->button(QDialogButtonBox::Ok)->setToolTip(i18nc("@info:tooltip", "Remember this high score"));
551 d->buttonBox->button(QDialogButtonBox::Cancel)->setToolTip(i18nc("@info:tooltip", "Forget this high score"));
554 connect(d->buttonBox, &QDialogButtonBox::rejected, this, &KGameHighScoreDialog::slotForgetScore);
613 QLabel *label = d->labels[d->newName.first].at((d->newName.second - 1) * d->nrCols + d->col[Name]);
Definition kgamedifficulty.h:25
KGameDifficulty manages difficulty levels of a game in a standard way.
Definition kgamedifficulty.h:89
QList< const KGameDifficultyLevel * > levels() const
Definition kgamedifficulty.cpp:236
void setHiddenConfigGroups(const QList< QByteArray > &hiddenGroups)
Hide some config groups so that they are not shown on the dialog (but are still stored in the configu...
Definition kgamehighscoredialog.cpp:195
KGameHighScoreDialog(int fields=Name, QWidget *parent=nullptr)
Definition kgamehighscoredialog.cpp:94
@ LessIsMore
A lower numerical score means higher placing on the table.
Definition kgamehighscoredialog.h:104
void initFromDifficulty(const KGameDifficulty *difficulty, bool setConfigGroup=true)
Assume that config groups (incl.
Definition kgamehighscoredialog.cpp:178
void addLocalizedConfigGroupNames(const QMap< QByteArray, QString > &groups)
You must add the translations of all group names to the dialog.
Definition kgamehighscoredialog.cpp:168
void addField(int field, const QString &header, const QString &key)
Define an extra FieldInfo entry.
Definition kgamehighscoredialog.cpp:223
void addLocalizedConfigGroupName(const QPair< QByteArray, QString > &group)
You must add the translations of all group names to the dialog.
Definition kgamehighscoredialog.cpp:158
void setConfigGroupWeights(const QMap< int, QByteArray > &weights)
It is a good idea giving config group weights, otherwise tabs get ordered by their tab name that is n...
Definition kgamehighscoredialog.cpp:202
void setConfigGroup(const QPair< QByteArray, QString > &group)
The group name must be passed though i18n() in order for the group name to be translated.
Definition kgamehighscoredialog.cpp:149
void setComment(const QString &comment)
Definition kgamehighscoredialog.cpp:216
int addScore(const FieldInfo &newInfo=FieldInfo(), AddScoreFlags flags={})
Adds a new score to the list.
Definition kgamehighscoredialog.cpp:494
void hideField(int field)
Hide a field so that it is not shown on the table (but is still stored in the configuration file).
Definition kgamehighscoredialog.cpp:232
QStringList groupList() const
Returns a list of group names without the KHighscore_ prexix.
Definition kgamehighscore.cpp:288
void writeAndUnlock()
Effectively write and unlock the system-wide highscore file (.
Definition kgamehighscore.cpp:175
void writeEntry(int entry, const QString &key, const QString &value)
Definition kgamehighscore.cpp:219
QString readEntry(int entry, const QString &key, const QString &pDefault=QString()) const
Reads an entry from the highscore table.
Definition kgamehighscore.cpp:234
void setHighscoreGroup(const QString &groupname=QString())
Set the new highscore group.
Definition kgamehighscore.cpp:274
void returnKeyPressed(const QString &text)
QVariant property(UserProperty which) const
QString loginName() const
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
QString label(StandardShortcut id)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
bool isEmpty() const const
virtual int exec()
virtual void keyPressEvent(QKeyEvent *e) override
virtual QSize minimumSizeHint() const const override
void setModal(bool modal)
virtual void reject()
void accepted()
void rejected()
void ignore()
bool testFlag(Enum flag) const const
void setBold(bool enable)
virtual void addItem(QLayoutItem *item) override
void addWidget(QWidget *widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment alignment)
int key() const const
void setAlignment(Qt::Alignment)
virtual QSize sizeHint() const const override
void setText(const QString &)
bool contains(const AT &value) const const
qsizetype indexOf(const AT &value, qsizetype from) const const
void removeAt(qsizetype i)
iterator begin()
iterator end()
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue) const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
int addWidget(QWidget *widget)
void setCurrentWidget(QWidget *widget)
const QChar at(qsizetype position) const const
void clear()
const QChar * constData() const const
bool isEmpty() const const
QString number(double n, char format, int precision)
QString & setNum(double n, char format, int precision)
AlignVCenter
Key_Return
Horizontal
West
int addTab(QWidget *page, const QIcon &icon, const QString &label)
void clear()
currentIndex
int indexOf(const QWidget *w) const const
void setCurrentWidget(QWidget *widget)
QString tabText(int index) const const
QWidget * widget(int index) const const
singleShot
QString toString() const const
font
void hide()
QLayout * layout() const const
void setMinimumSize(const QSize &)
void setMinimumWidth(int minw)
void setFixedSize(const QSize &s)
void setFocus()
void setLayout(QLayout *layout)
void show()
void setWindowTitle(const QString &)
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.