11#include "questionmanager.h"
13#include <QCoreApplication>
17using namespace KNSCore;
19class KNSCore::QuestionPrivate
23 : questionType(
Question::YesNoQuestion)
33 Question::QuestionType questionType;
34 std::optional<Question::Response> response;
38Question::Question(QuestionType questionType,
QObject *parent)
40 , d(new QuestionPrivate)
42 d->questionType = questionType;
45Question::~Question() =
default;
47Question::Response Question::ask()
49 Q_EMIT QuestionManager::instance()->askQuestion(
this);
50 if (!d->response.has_value()) {
56Question::QuestionType Question::questionType()
const
58 return d->questionType;
61void Question::setQuestionType(Question::QuestionType newType)
63 d->questionType = newType;
66void Question::setQuestion(
const QString &newQuestion)
68 d->question = newQuestion;
71QString Question::question()
const
76void Question::setTitle(
const QString &newTitle)
98 d->response = response;
104 d->textResponse = response;
107QString Question::response()
const
109 return d->textResponse;
112void Question::setEntry(
const Entry &entry)
117Entry Question::entry()
const
122#include "moc_question.cpp"
KNewStuff data entry container.
A way to ask a user a question from inside a GUI-less library (like KNewStuffCore)
void setResponse(Response response)
When the user makes a choice on a question, that is a response.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 11:58:18 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.