diff --git a/graphwidget.cpp b/graphwidget.cpp index a74a361..8af8ddf 100644 --- a/graphwidget.cpp +++ b/graphwidget.cpp @@ -10,7 +10,6 @@ #include "mainwindow.h" - GraphWidget::GraphWidget(QWidget *parent) : QGraphicsView(parent), m_parent(parent), @@ -38,7 +37,7 @@ GraphWidget::GraphWidget(QWidget *parent) : m_nodeList.append(node1); Node *node2 = new Node(this); - node2->setHtml(QString("work")); + node2->setHtml(QString("work: hup.hu")); m_scene->addItem(node2); node2->setPos(60, -10); m_nodeList.append(node2); @@ -56,7 +55,7 @@ GraphWidget::GraphWidget(QWidget *parent) : m_nodeList.append(node4); Node *node5 = new Node(this); - node5->setHtml(QString("joy")); + node5->setHtml(QString("semmi kulonos")); m_scene->addItem(node5); node5->setPos(-10, 50); m_nodeList.append(node5); @@ -82,7 +81,7 @@ GraphWidget::GraphWidget(QWidget *parent) : Node *node9 = new Node(this); node9->setHtml(QString("iam a bald and italian guy")); m_scene->addItem(node9); - node9->setPos(50, 40); + node9->setPos(90, 90); m_nodeList.append(node9); Node *node10 = new Node(this); @@ -100,7 +99,7 @@ GraphWidget::GraphWidget(QWidget *parent) : Node *node12 = new Node(this); node12->setHtml(QString("lalalala")); m_scene->addItem(node12); - node12->setPos(130, -10); + node12->setPos(170, -10); m_nodeList.append(node12);; m_scene->addItem(new Edge(node1, node2)); diff --git a/graphwidget.h b/graphwidget.h index 7cc17a5..c2ef248 100644 --- a/graphwidget.h +++ b/graphwidget.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "node.h" @@ -41,7 +42,6 @@ private: bool m_showingNodeNumbers; QString m_followNumber; Node *m_followNode; - }; #endif // GRAPHWIDGET_H diff --git a/node.cpp b/node.cpp index 09b38b7..2f24dcf 100644 --- a/node.cpp +++ b/node.cpp @@ -11,13 +11,16 @@ Node::Node(GraphWidget *parent) : m_graph(parent), m_isActive(false), m_number(-1), - m_hasBorder(true) + m_hasBorder(true), m_numberIsSpecial(false) { qDebug() << __PRETTY_FUNCTION__; setFlag(ItemIsMovable); setFlag(ItemSendsGeometryChanges); + setTextInteractionFlags(Qt::TextBrowserInteraction); +// setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard); + setCacheMode(DeviceCoordinateCache); // setZValue(1); @@ -231,3 +234,10 @@ double Node::calculateBiggestAngle() return max_prev + max / 2 ; } + +void Node::linkActivated(const QString &link) +{ + qDebug() << __PRETTY_FUNCTION__; + + qDebug() << link; +} diff --git a/node.h b/node.h index 7fefc02..631dfd8 100644 --- a/node.h +++ b/node.h @@ -31,6 +31,7 @@ protected: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void linkActivated(const QString &link); private: diff --git a/qtmindmap.qrc b/qtmindmap.qrc index ffe32ab..f95614c 100644 --- a/qtmindmap.qrc +++ b/qtmindmap.qrc @@ -2,4 +2,4 @@ heart.svg - \ No newline at end of file +