aboutsummaryrefslogtreecommitdiff
path: root/src/gui/conversation.h
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-05-25 02:14:58 +0000
committerdos-reis <gdr@axiomatics.org>2011-05-25 02:14:58 +0000
commitef96230bf5b14ce3b3e178db2ac03b262103d1ca (patch)
tree3f59f0e6aeebd8e39bcd0209e1bde31d7f3c820d /src/gui/conversation.h
parent75f06cbe29554f204289ad9487bee1f4137ba28b (diff)
downloadopen-axiom-ef96230bf5b14ce3b3e178db2ac03b262103d1ca.tar.gz
more gui codes
Diffstat (limited to 'src/gui/conversation.h')
-rw-r--r--src/gui/conversation.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gui/conversation.h b/src/gui/conversation.h
index 37d598f2..abe6d4c2 100644
--- a/src/gui/conversation.h
+++ b/src/gui/conversation.h
@@ -39,6 +39,7 @@
#include <QFont>
#include <QEvent>
#include <QResizeEvent>
+#include <QPaintEvent>
namespace OpenAxiom {
// A conversation is a set of exchanges. An exchange is a question
@@ -54,19 +55,23 @@ namespace OpenAxiom {
class Question : public QLineEdit {
public:
explicit Question(Exchange&);
+ Exchange* exchange() const { return parent; }
protected:
// Automatically grab focus when mouse moves into this widget
void enterEvent(QEvent*);
+
+ private:
+ Exchange* const parent;
};
class Answer : public QLabel {
public:
explicit Answer(Exchange&);
+ Exchange* exchange() const { return parent; }
- protected:
- // Automatically transfers focus to the associated query widget.
- void enterEvent(QEvent*);
+ private:
+ Exchange* const parent;
};
class Exchange : public QFrame {
@@ -75,9 +80,8 @@ namespace OpenAxiom {
Exchange(Conversation&, int);
// Return the parent widget of this conversation topic
- Conversation* conversation();
- Debate* debate();
-
+ Conversation* conversation() const { return parent; }
+
// The widget holding the query area
Question* question() { return &query; }
const Question* question() const { return &query; }
@@ -91,12 +95,12 @@ namespace OpenAxiom {
// Reimplement positiion management.
QSize sizeHint() const;
- QSize minimumSizeHint() const;
protected:
void resizeEvent(QResizeEvent*);
private:
+ Conversation* const parent;
const int no;
Question query;
Answer reply;
@@ -144,6 +148,7 @@ namespace OpenAxiom {
protected:
void resizeEvent(QResizeEvent*);
+ void paintEvent(QPaintEvent*);
private:
typedef std::vector<Exchange*> Children;