parley
practicesummarycomponent.cpp
Go to the documentation of this file.
44 PracticeSummaryComponent::PracticeSummaryComponent(SessionManagerBase* sessionManager, QWidget* parent)
59 summaryBar->setStatistics(m_sessionManager->statisticTotalCorrectFirstAttempt(), m_sessionManager->statisticTotalWrong(), m_sessionManager->statisticTotalUnanswered());
61 int total = m_sessionManager->statisticTotalCorrectFirstAttempt() + m_sessionManager->statisticTotalWrong();
65 testSummaryLabel->setText(i18nc("number of words, minutes, seconds", "You practiced %1 in %2 and %3.",
82 ParleyActions::create(ParleyActions::EnterEditMode, parleyMainWindow, SLOT(showEditor()), actionCollection());
83 ParleyActions::create(ParleyActions::StartPractice, parleyMainWindow, SLOT(showPracticeConfiguration()), actionCollection());
84 ParleyActions::create(ParleyActions::ExportPracticeResults, this, SLOT(exportResults()), actionCollection());
86 actionCollection()->action("practice_start")->setToolTip(i18n("Switch to the Practice Overview page"));
98 correctPalette.setColor(QPalette::WindowText, scheme.foreground(KColorScheme::PositiveText).color());
102 wrongPalette.setColor(QPalette::WindowText, scheme.foreground(KColorScheme::NegativeText).color());
156 QString fileName = KFileDialog::getSaveFileName(KUrl("kfiledialog:///practice_export"), filter);
169 cursor.insertText(i18n("Correct answers: %1\n", m_sessionManager->statisticTotalCorrectFirstAttempt()));
185 table->cellAt(newRow, 0).firstCursorPosition().insertText(QString::number(entry->statisticCount()));
186 table->cellAt(newRow, 1).firstCursorPosition().insertText(entry->entry()->translation(entry->languageFrom())->text());
187 table->cellAt(newRow, 2).firstCursorPosition().insertText(entry->entry()->translation(entry->languageTo())->text());
~PracticeSummaryComponent()
Definition: practicesummarycomponent.cpp:74
QTextCursor firstCursorPosition() const
KAction * create(ParleyAction id, const QObject *recvr, const char *slot, QObject *parent)
Definition: parleyactions.cpp:64
int rows() const
int statisticTotalUnanswered()
Definition: sessionmanagerbase.cpp:218
void setColor(ColorGroup group, ColorRole role, const QColor &color)
void insertHtml(const QString &html)
QString join(const QString &separator) const
void setIcon(const QIcon &icon)
virtual QVariant data(int role) const
QList< TestEntry * > allTestEntries() const
Get a list of all entries in the test - used by the summary dialog.
Definition: sessionmanagerbase.cpp:167
void appendRows(int count)
QString number(int n, int base)
int allEntryCount() const
The number of entries available for the practice session.
Definition: sessionmanagerbase.cpp:172
int toInt(bool *ok) const
void insertText(const QString &text)
bool isEmpty() const
void setAlignment(QFlags< Qt::AlignmentFlag > alignment)
PracticeSummaryComponent(SessionManagerBase *sessionManager, QWidget *parent)
Definition: practicesummarycomponent.cpp:44
QPalette palette()
Definition: parleyactions.h:37
const QBrush & foreground() const
QTextTable * insertTable(int rows, int columns, const QTextTableFormat &format)
void setFlags(QFlags< Qt::ItemFlag > flags)
Definition: parleyactions.h:38
QTextTableCell cellAt(int row, int column) const
bool write(const QTextDocument *document)
void setCellPadding(qreal padding)
void setHtml(const QString &html)
void setForeground(const QBrush &brush)
int statisticTotalCorrectFirstAttempt()
Definition: sessionmanagerbase.cpp:196
void setBorderStyle(BorderStyle style)
void exportResults()
Definition: practicesummarycomponent.cpp:153
int statisticTotalWrong()
Definition: sessionmanagerbase.cpp:207
Definition: testentry.h:22
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 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:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.