diff options
| author | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-10-11 15:17:44 +0000 |
|---|---|---|
| committer | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-10-11 15:17:44 +0000 |
| commit | abc6cea5b1bc3018ee20c6a0dd6272059fc34169 (patch) | |
| tree | 860519d73773e8c99feb1e2d3a906283279615e4 /examples/GuiClient | |
| parent | 3dbddad62fc6ad3d8a5181c5b66365aa14ef936b (diff) | |
| download | qxmpp-abc6cea5b1bc3018ee20c6a0dd6272059fc34169.tar.gz | |
align class name
Diffstat (limited to 'examples/GuiClient')
| -rw-r--r-- | examples/GuiClient/GuiClient.pro | 4 | ||||
| -rw-r--r-- | examples/GuiClient/chatGraphicsScene.cpp | 6 | ||||
| -rw-r--r-- | examples/GuiClient/chatGraphicsScene.h | 4 | ||||
| -rw-r--r-- | examples/GuiClient/chatMsgGraphicsItem.cpp (renamed from examples/GuiClient/messageGraphicsItem.cpp) | 38 | ||||
| -rw-r--r-- | examples/GuiClient/chatMsgGraphicsItem.h (renamed from examples/GuiClient/messageGraphicsItem.h) | 4 |
5 files changed, 28 insertions, 28 deletions
diff --git a/examples/GuiClient/GuiClient.pro b/examples/GuiClient/GuiClient.pro index 09591c5e..bb17ac5f 100644 --- a/examples/GuiClient/GuiClient.pro +++ b/examples/GuiClient/GuiClient.pro @@ -4,7 +4,7 @@ TARGET = GuiClient TEMPLATE = app SOURCES += main.cpp \ - messageGraphicsItem.cpp \ + chatMsgGraphicsItem.cpp \ chatGraphicsScene.cpp \ chatGraphicsView.cpp \ chatDialog.cpp \ @@ -26,7 +26,7 @@ SOURCES += main.cpp \ accountsCache.cpp \ xmlConsoleDialog.cpp -HEADERS += messageGraphicsItem.h \ +HEADERS += chatMsgGraphicsItem.h \ chatGraphicsScene.h \ chatGraphicsView.h \ chatDialog.h \ diff --git a/examples/GuiClient/chatGraphicsScene.cpp b/examples/GuiClient/chatGraphicsScene.cpp index 6681fa4b..87406bc6 100644 --- a/examples/GuiClient/chatGraphicsScene.cpp +++ b/examples/GuiClient/chatGraphicsScene.cpp @@ -23,7 +23,7 @@ #include "chatGraphicsScene.h" -#include "messageGraphicsItem.h" +#include "chatMsgGraphicsItem.h" #include "chatGraphicsView.h" chatGraphicsScene::chatGraphicsScene(QObject* parent) : QGraphicsScene(parent), @@ -33,7 +33,7 @@ chatGraphicsScene::chatGraphicsScene(QObject* parent) : QGraphicsScene(parent), void chatGraphicsScene::addMessage(const QString& user, const QString& message) { - messageGraphicsItem* item = new messageGraphicsItem(); + chatMsgGraphicsItem* item = new chatMsgGraphicsItem(); m_items.append(item); item->setName(user); item->setBoxStartLength(m_boxStartLength); @@ -59,7 +59,7 @@ void chatGraphicsScene::verticalReposition() { m_verticalPosForNewMessage = 0; - messageGraphicsItem* item = 0; + chatMsgGraphicsItem* item = 0; for(int i = 0; i < m_items.size(); ++i) { item = m_items.at(i); diff --git a/examples/GuiClient/chatGraphicsScene.h b/examples/GuiClient/chatGraphicsScene.h index 82b9a401..0488f833 100644 --- a/examples/GuiClient/chatGraphicsScene.h +++ b/examples/GuiClient/chatGraphicsScene.h @@ -28,7 +28,7 @@ #include <QGraphicsScene> #include <QList> -class messageGraphicsItem; +class chatMsgGraphicsItem; class chatGraphicsScene : public QGraphicsScene { @@ -43,7 +43,7 @@ private: int m_verticalPosForNewMessage; int m_verticalSpacing; int m_boxStartLength; - QList <messageGraphicsItem*> m_items; + QList <chatMsgGraphicsItem*> m_items; }; #endif // CHATGRAPHICSSCENE_H diff --git a/examples/GuiClient/messageGraphicsItem.cpp b/examples/GuiClient/chatMsgGraphicsItem.cpp index 26a8c782..05041804 100644 --- a/examples/GuiClient/messageGraphicsItem.cpp +++ b/examples/GuiClient/chatMsgGraphicsItem.cpp @@ -22,7 +22,7 @@ */ -#include "messageGraphicsItem.h" +#include "chatMsgGraphicsItem.h" #include <QPainter> #include <QTextDocument> #include <QFontMetrics> @@ -115,7 +115,7 @@ void drawPath(QPainter *p, const QPainterPath &path, p->restore(); } -messageGraphicsItem::messageGraphicsItem(QGraphicsItem * parent):QGraphicsPathItem(parent), +chatMsgGraphicsItem::chatMsgGraphicsItem(QGraphicsItem * parent):QGraphicsPathItem(parent), m_spikeWidth(9), m_spikeHeight(6), m_cornerRadius(10), @@ -129,7 +129,7 @@ messageGraphicsItem::messageGraphicsItem(QGraphicsItem * parent):QGraphicsPathIt m_timeStampWidth = fm.width(getTime()) + 4; } -void messageGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void chatMsgGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { painter->setRenderHint(QPainter::Antialiasing); drawPath(painter, path(), m_color, getText(), getTextWidth()); @@ -177,37 +177,37 @@ void messageGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsIte Qt::AlignBottom|Qt::AlignLeft, getTime()); } -void messageGraphicsItem::setText(const QString& text) +void chatMsgGraphicsItem::setText(const QString& text) { m_text = text; calculateWidth(); setPath(createPath()); } -void messageGraphicsItem::setMaxWidth(int width) +void chatMsgGraphicsItem::setMaxWidth(int width) { m_maxWidth = width; setPath(createPath()); } -void messageGraphicsItem::setViewWidth(int width) +void chatMsgGraphicsItem::setViewWidth(int width) { //25 for scrollbar setMaxWidth(width - getBoxStartLength() - 25); } -int messageGraphicsItem::getMaxWidth() const +int chatMsgGraphicsItem::getMaxWidth() const { return m_maxWidth; } -void messageGraphicsItem::setAlignment(Alignment align) +void chatMsgGraphicsItem::setAlignment(Alignment align) { m_alignment = align; setPath(createPath()); } -QPainterPath messageGraphicsItem::createPath() +QPainterPath chatMsgGraphicsItem::createPath() { calculateWidth(); int spike_x = m_spikeWidth; @@ -234,17 +234,17 @@ QPainterPath messageGraphicsItem::createPath() return messageBoxPath; } -QString messageGraphicsItem::getText() const +QString chatMsgGraphicsItem::getText() const { return m_text; } -int messageGraphicsItem::getTextWidth() const +int chatMsgGraphicsItem::getTextWidth() const { return getMaxWidth() - m_spikeWidth - m_cornerRadius*2; } -void messageGraphicsItem::calculateWidth() +void chatMsgGraphicsItem::calculateWidth() { QFont font; font.setBold(true); @@ -262,7 +262,7 @@ void messageGraphicsItem::calculateWidth() m_width = getMaxWidth(); } -void messageGraphicsItem::setName(const QString& name) +void chatMsgGraphicsItem::setName(const QString& name) { m_name = name; if(name != "Me") @@ -271,32 +271,32 @@ void messageGraphicsItem::setName(const QString& name) m_color = QColor(250, 188, 239); } -QString messageGraphicsItem::getName() const +QString chatMsgGraphicsItem::getName() const { return m_name; } -QString messageGraphicsItem::getTime() const +QString chatMsgGraphicsItem::getTime() const { return QTime::currentTime().toString("hh:mm"); } -void messageGraphicsItem::setBoxStartLength(int length) +void chatMsgGraphicsItem::setBoxStartLength(int length) { m_boxStartLength = length; } -int messageGraphicsItem::getBoxStartLength() const +int chatMsgGraphicsItem::getBoxStartLength() const { return m_boxStartLength; } -void messageGraphicsItem::setColor(const QColor& color) +void chatMsgGraphicsItem::setColor(const QColor& color) { m_color = color; } -QRectF messageGraphicsItem::boundingRect() const +QRectF chatMsgGraphicsItem::boundingRect() const { QRectF rect = QGraphicsPathItem::boundingRect(); rect.setLeft(-getBoxStartLength()); diff --git a/examples/GuiClient/messageGraphicsItem.h b/examples/GuiClient/chatMsgGraphicsItem.h index d0b03960..b035ab4e 100644 --- a/examples/GuiClient/messageGraphicsItem.h +++ b/examples/GuiClient/chatMsgGraphicsItem.h @@ -27,7 +27,7 @@ #include <QGraphicsPathItem> -class messageGraphicsItem : public QGraphicsPathItem +class chatMsgGraphicsItem : public QGraphicsPathItem { public: enum Alignment @@ -36,7 +36,7 @@ public: RIGHT }; - messageGraphicsItem(QGraphicsItem * parent = 0); + chatMsgGraphicsItem(QGraphicsItem * parent = 0); void setText(const QString& text); void setName(const QString& name); QString getName() const; |
