You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
862 B
C++

#include "qw_textdialogue.h"
QWTextDialogue::QWTextDialogue(const QStringList &pages)
{
setPages(pages);
}
////////////////////////
bool QWTextDialogue::toNextPage() noexcept
{
const bool has_next = ((it_current_page + 1) != list_pages.end());
if (has_next)
++it_current_page;
return has_next;
}
void QWTextDialogue::resetPage() noexcept
{
it_current_page = list_pages.begin();
}
void QWTextDialogue::setPages(const QStringList &pages) noexcept
{
list_pages = pages;
Q_ASSERT(!list_pages.empty());
it_current_page = list_pages.begin();
}
QStringList QWTextDialogue::pages() const noexcept
{
return list_pages;
}
QString QWTextDialogue::currentText() const noexcept
{
return *it_current_page;
}
////////////////////////
void QWTextDialogue::writeToJson(QJsonObject &savejson)
{
Q_UNUSED(savejson)
}