#include <kfeedback.h>
Public Member Functions | |
KFeedbackQuestion (KFeedbackQuestionList *parent, const QString &text, const QString &id, bool exclusiveAnswer=true, bool required=false, bool open=true) | |
void | addAnswer (const QString &text, const QString &id) |
bool | isRequired () |
bool | isAnswered () |
QString | result () |
QString | id () |
QString | text () |
bool | exclusiveAnswer () |
virtual QString | key (int column, bool ascending) const |
KFeedbackQuestion * | nextQuestion () const |
KFeedbackAnswer * | firstAnswer () const |
KFeedbackQuestionList * | questionList () const |
Protected Attributes | |
QString | _id |
bool | _exclusiveAnswer |
bool | _required |
int | _no |
Definition at line 275 of file kfeedback.h.
KFeedbackQuestion::KFeedbackQuestion | ( | KFeedbackQuestionList * | parent, | |
const QString & | text, | |||
const QString & | id, | |||
bool | exclusiveAnswer = true , |
|||
bool | required = false , |
|||
bool | open = true | |||
) |
Constructor.
The parent KFeedbackQuestionList assumes ownership of this object, so don't delete it unless you want to delete it from the question list as well.
'text' is the text the user will see (in his native language).
'id' is what will be sent with the feedback mail, thus it should be unique within the application, yet human readable (preferably English) and not contain any weird characters that might confuse scripts that are later used to automatically parse those mails. Examples: "features_not_liked", "stability"
Set 'required' to 'true' if answering this question is required to successfully complete this form.
Set 'exclusiveAnswer' to 'true' if only one of all answers may be checked at any one time, to 'false' if multiple answers are allowed.
Definition at line 336 of file kfeedback.cpp.
References _no, and KFeedbackQuestionList::questionAdded().
void KFeedbackQuestion::addAnswer | ( | const QString & | text, | |
const QString & | id | |||
) |
Add an answer to this question. Again, 'text' is what the user will see (translated to his native language), 'id' is what you will get back with the mail. The answer IDs need only be unique for that question; answers to other questions may have the same ID.
Definition at line 360 of file kfeedback.cpp.
References _exclusiveAnswer.
Referenced by KShowMailApp::addFeatureList(), KFeedbackQuestionList::addYesNoQuestion(), and KShowMailApp::slotSendFeedbackMail().
bool KFeedbackQuestion::isRequired | ( | ) | [inline] |
Returns if answering this question is required.
Definition at line 319 of file kfeedback.h.
References _required.
Referenced by KFeedbackQuestionList::isComplete(), and KFeedbackQuestionList::questionAdded().
bool KFeedbackQuestion::isAnswered | ( | ) |
Returns if this question is answered satisfactorily.
If any number of answers is permitted for this question, this question is always considered to be answered.
If this question requires an exclusive answer, exactly one of them should be checked. We don't need to bother about more than one being checked here - QListView does that for us.
Definition at line 368 of file kfeedback.cpp.
References _exclusiveAnswer, firstAnswer(), KFeedbackAnswer::isChecked(), and KFeedbackAnswer::nextAnswer().
Referenced by KFeedbackQuestionList::isComplete().
QString KFeedbackQuestion::result | ( | ) |
The result of this question in ASCII, e.g. recommend="yes" or features_i_like="builtin_tetris" features_i_like="pink_elephant" features_i_like="studlycapslyfier"
Definition at line 402 of file kfeedback.cpp.
References _id, firstAnswer(), KFeedbackAnswer::id(), KFeedbackAnswer::isChecked(), and KFeedbackAnswer::nextAnswer().
Referenced by KFeedbackQuestionList::result().
QString KFeedbackQuestion::id | ( | ) | [inline] |
QString KFeedbackQuestion::text | ( | ) |
Return this question's text.
Definition at line 430 of file kfeedback.cpp.
bool KFeedbackQuestion::exclusiveAnswer | ( | ) | [inline] |
Returns whether or not this question requires an exclusive answer.
Definition at line 349 of file kfeedback.h.
References _exclusiveAnswer.
QString KFeedbackQuestion::key | ( | int | column, | |
bool | ascending | |||
) | const [virtual] |
Returns the sort key.
Reimplemented from QListViewItem to maintain insertion order.
Definition at line 437 of file kfeedback.cpp.
References _no.
KFeedbackQuestion* KFeedbackQuestion::nextQuestion | ( | ) | const [inline] |
Returns the next question or 0 if there is no more.
Definition at line 362 of file kfeedback.h.
Referenced by KFeedbackQuestionList::isComplete(), and KFeedbackQuestionList::result().
KFeedbackAnswer* KFeedbackQuestion::firstAnswer | ( | ) | const [inline] |
Returns the first possible answer to this question. Use KFeedbackAnswer::nextAnswer() to get the next one.
Definition at line 369 of file kfeedback.h.
Referenced by isAnswered(), and result().
KFeedbackQuestionList * KFeedbackQuestion::questionList | ( | ) | const |
Returns the KFeedbackQuestionList this question belongs to or 0 if the parent is no KFeedbackQuestionList.
Definition at line 447 of file kfeedback.cpp.
Referenced by KFeedbackAnswer::stateChange().