|
From: Tapio V. <aa...@us...> - 2011-01-05 12:15:21
|
Module: editor
Branch: master
Commit: 760918cdef9aab4febcac209fce659177117e32b
Author: Tapio Vierros <tap...@gm...>
Date: Wed Jan 5 12:21:55 2011 +0200
Renaming.
---
fridgemagnets.qrc => editor.qrc | 0
main.cc | 6 +++---
dragwidget.cc => notegraphwidget.cc | 34 +++++++++++++++++-----------------
dragwidget.hh => notegraphwidget.hh | 4 ++--
draglabel.cc => notelabel.cc | 12 ++++++------
draglabel.hh => notelabel.hh | 4 ++--
6 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/fridgemagnets.qrc b/editor.qrc
similarity index 100%
rename from fridgemagnets.qrc
rename to editor.qrc
diff --git a/main.cc b/main.cc
index cd68188..fd31bbb 100644
--- a/main.cc
+++ b/main.cc
@@ -39,17 +39,17 @@
****************************************************************************/
#include <QApplication>
-#include "dragwidget.hh"
+#include "notegraphwidget.hh"
int main(int argc, char *argv[])
{
- Q_INIT_RESOURCE(fridgemagnets);
+ Q_INIT_RESOURCE(editor);
QApplication app(argc, argv);
#ifdef QT_KEYPAD_NAVIGATION
QApplication::setNavigationMode(Qt::NavigationModeCursorAuto);
#endif
- DragWidget window;
+ NoteGraphWidget window;
bool smallScreen = QApplication::arguments().contains("-small-screen");
if (smallScreen)
diff --git a/dragwidget.cc b/notegraphwidget.cc
similarity index 86%
rename from dragwidget.cc
rename to notegraphwidget.cc
index 3ad3862..730c65f 100644
--- a/dragwidget.cc
+++ b/notegraphwidget.cc
@@ -40,12 +40,12 @@
#include <QtGui>
-#include "draglabel.hh"
-#include "dragwidget.hh"
+#include "notelabel.hh"
+#include "notegraphwidget.hh"
#include <iostream>
#include <cmath>
-DragWidget::DragWidget(QWidget *parent)
+NoteGraphWidget::NoteGraphWidget(QWidget *parent)
: QWidget(parent)
{
QFile dictionaryFile(":/dictionary/words.txt");
@@ -59,7 +59,7 @@ DragWidget::DragWidget(QWidget *parent)
QString word;
inputStream >> word;
if (!word.isEmpty()) {
- DragLabel *wordLabel = new DragLabel(word, this);
+ NoteLabel *wordLabel = new NoteLabel(word, this);
wordLabel->move(x, y);
wordLabel->show();
wordLabel->setAttribute(Qt::WA_DeleteOnClose);
@@ -74,7 +74,7 @@ DragWidget::DragWidget(QWidget *parent)
setAcceptDrops(true);
}
-void DragWidget::dragEnterEvent(QDragEnterEvent *event)
+void NoteGraphWidget::dragEnterEvent(QDragEnterEvent *event)
{
if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
if (children().contains(event->source())) {
@@ -90,7 +90,7 @@ void DragWidget::dragEnterEvent(QDragEnterEvent *event)
}
}
-void DragWidget::dragMoveEvent(QDragMoveEvent *event)
+void NoteGraphWidget::dragMoveEvent(QDragMoveEvent *event)
{
if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
if (children().contains(event->source())) {
@@ -106,7 +106,7 @@ void DragWidget::dragMoveEvent(QDragMoveEvent *event)
}
}
-void DragWidget::dropEvent(QDropEvent *event)
+void NoteGraphWidget::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
const QMimeData *mime = event->mimeData();
@@ -116,7 +116,7 @@ void DragWidget::dropEvent(QDropEvent *event)
QString text;
QPoint offset;
dataStream >> text >> offset;
- DragLabel *newLabel = new DragLabel(text, this);
+ NoteLabel *newLabel = new NoteLabel(text, this);
newLabel->move(event->pos() - offset);
newLabel->show();
newLabel->setAttribute(Qt::WA_DeleteOnClose);
@@ -133,7 +133,7 @@ void DragWidget::dropEvent(QDropEvent *event)
QPoint position = event->pos();
foreach (QString piece, pieces) {
- DragLabel *newLabel = new DragLabel(piece, this);
+ NoteLabel *newLabel = new NoteLabel(piece, this);
newLabel->move(position);
newLabel->show();
newLabel->setAttribute(Qt::WA_DeleteOnClose);
@@ -147,9 +147,9 @@ void DragWidget::dropEvent(QDropEvent *event)
}
}
-void DragWidget::mousePressEvent(QMouseEvent *event)
+void NoteGraphWidget::mousePressEvent(QMouseEvent *event)
{
- DragLabel *child = static_cast<DragLabel*>(childAt(event->pos()));
+ NoteLabel *child = static_cast<NoteLabel*>(childAt(event->pos()));
if (!child)
return;
@@ -181,12 +181,12 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
QString firstst = child->getText().left(cutpos);
QString secondst = child->getText().right(child->getText().length() - cutpos);
- DragLabel *newLabel1 = new DragLabel(firstst, this);
+ NoteLabel *newLabel1 = new NoteLabel(firstst, this);
newLabel1->move(child->pos());
newLabel1->show();
newLabel1->setAttribute(Qt::WA_DeleteOnClose);
- DragLabel *newLabel2 = new DragLabel(secondst, this);
+ NoteLabel *newLabel2 = new NoteLabel(secondst, this);
newLabel2->move(newLabel1->pos() + QPoint(newLabel1->width(), 0));
newLabel2->show();
newLabel2->setAttribute(Qt::WA_DeleteOnClose);
@@ -195,9 +195,9 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
}
}
-void DragWidget::wheelEvent(QWheelEvent *event)
+void NoteGraphWidget::wheelEvent(QWheelEvent *event)
{
- DragLabel *child = static_cast<DragLabel*>(childAt(event->pos()));
+ NoteLabel *child = static_cast<NoteLabel*>(childAt(event->pos()));
if (!child)
return;
@@ -209,9 +209,9 @@ void DragWidget::wheelEvent(QWheelEvent *event)
event->accept();
}
-void DragWidget::mouseDoubleClickEvent(QMouseEvent *event)
+void NoteGraphWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
- DragLabel *child = static_cast<DragLabel*>(childAt(event->pos()));
+ NoteLabel *child = static_cast<NoteLabel*>(childAt(event->pos()));
if (!child)
return;
diff --git a/dragwidget.hh b/notegraphwidget.hh
similarity index 96%
rename from dragwidget.hh
rename to notegraphwidget.hh
index 6afc358..7cc28d9 100644
--- a/dragwidget.hh
+++ b/notegraphwidget.hh
@@ -48,10 +48,10 @@ class QDragEnterEvent;
class QDropEvent;
QT_END_NAMESPACE
-class DragWidget : public QWidget
+class NoteGraphWidget : public QWidget
{
public:
- DragWidget(QWidget *parent = 0);
+ NoteGraphWidget(QWidget *parent = 0);
protected:
void dragEnterEvent(QDragEnterEvent *event);
diff --git a/draglabel.cc b/notelabel.cc
similarity index 93%
rename from draglabel.cc
rename to notelabel.cc
index ebf78a8..1387f64 100644
--- a/draglabel.cc
+++ b/notelabel.cc
@@ -40,19 +40,19 @@
#include <QtGui>
-#include "draglabel.hh"
+#include "notelabel.hh"
namespace {
static const int text_margin = 12; // Margin of the label texts
}
-DragLabel::DragLabel(const QString &text, QWidget *parent)
+NoteLabel::NoteLabel(const QString &text, QWidget *parent)
: QLabel(parent), m_labelText(text)
{
createPixmap();
}
-void DragLabel::createPixmap(QSize size)
+void NoteLabel::createPixmap(QSize size)
{
if (!size.isValid()) {
QFontMetrics metric(font());
@@ -89,17 +89,17 @@ void DragLabel::createPixmap(QSize size)
setPixmap(QPixmap::fromImage(image));
}
-QString DragLabel::getText() const
+QString NoteLabel::getText() const
{
return m_labelText;
}
-void DragLabel::setText(const QString &text)
+void NoteLabel::setText(const QString &text)
{
m_labelText = text;
}
-void DragLabel::resizeEvent(QResizeEvent *event)
+void NoteLabel::resizeEvent(QResizeEvent *event)
{
createPixmap(event->size());
}
diff --git a/draglabel.hh b/notelabel.hh
similarity index 96%
rename from draglabel.hh
rename to notelabel.hh
index 052f348..a85c32d 100644
--- a/draglabel.hh
+++ b/notelabel.hh
@@ -49,10 +49,10 @@ class QDragMoveEvent;
class QFrame;
QT_END_NAMESPACE
-class DragLabel : public QLabel
+class NoteLabel : public QLabel
{
public:
- DragLabel(const QString &text, QWidget *parent);
+ NoteLabel(const QString &text, QWidget *parent);
void createPixmap(QSize size = QSize());
QString getText() const;
void setText(const QString &text);
|