parent
c679aa8814
commit
d57ec2a21f
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
<insert_a_suppression_name_here>
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:_ZN20QSharedMemoryPrivate6detachEv
|
||||||
|
fun:_ZN13QSharedMemory6detachEv
|
||||||
|
fun:_ZN13QSharedMemory6setKeyERK7QString
|
||||||
|
fun:_ZN13QSharedMemoryD1Ev
|
||||||
|
fun:_ZN20QRasterWindowSurface5flushEP7QWidgetRK7QRegionRK6QPoint
|
||||||
|
fun:_Z8qt_flushP7QWidgetRK7QRegionP14QWindowSurfaceS0_RK6QPoint
|
||||||
|
fun:_ZN19QWidgetBackingStore5flushEP7QWidgetP14QWindowSurface
|
||||||
|
fun:_ZN19QWidgetBackingStore8endPaintERK7QRegionP14QWindowSurfaceP14BeginPaintInfo
|
||||||
|
fun:_ZN19QWidgetBackingStore4syncEv
|
||||||
|
fun:_ZN14QWidgetPrivate16syncBackingStoreEv
|
||||||
|
fun:_ZN7QWidget5eventEP6QEvent
|
||||||
|
fun:_ZN11QMainWindow5eventEP6QEvent
|
||||||
|
}
|
||||||
|
{
|
||||||
|
<insert_a_suppression_name_here>
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:_Znwm
|
||||||
|
fun:_ZN18QtSimulatorPrivate15connectToServerEv
|
||||||
|
fun:_ZN18QtSimulatorPrivate19SimulatorConnection18connectToSimulatorEv
|
||||||
|
fun:_ZN18QtSimulatorPrivate19SimulatorConnection8instanceEv
|
||||||
|
fun:_ZN9QColormap10initializeEv
|
||||||
|
fun:_Z7qt_initP19QApplicationPrivatei
|
||||||
|
fun:_ZN19QApplicationPrivate9constructEv
|
||||||
|
fun:_ZN12QApplicationC1ERiPPci
|
||||||
|
fun:main
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
#include "aboutdialog.h"
|
||||||
|
#include "ui_aboutdialog.h"
|
||||||
|
|
||||||
|
//#include <QLayout>
|
||||||
|
|
||||||
|
AboutDialog::AboutDialog(QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::AboutDialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
connect(this, SIGNAL(finished(int)), parent,
|
||||||
|
SLOT(aboutDestroyed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
AboutDialog::~AboutDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef ABOUTDIALOG_H
|
||||||
|
#define ABOUTDIALOG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class AboutDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class AboutDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AboutDialog(QWidget *parent = 0);
|
||||||
|
~AboutDialog();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::AboutDialog *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ABOUTDIALOG_H
|
@ -0,0 +1,126 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>AboutDialog</class>
|
||||||
|
<widget class="QDialog" name="AboutDialog">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>329</width>
|
||||||
|
<height>142</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>About QtMindMap</string>
|
||||||
|
</property>
|
||||||
|
<property name="sizeGripEnabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>100</x>
|
||||||
|
<y>100</y>
|
||||||
|
<width>211</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>101</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>QtMindMap 0.1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>40</y>
|
||||||
|
<width>181</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Mindmap software in QT</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>70</y>
|
||||||
|
<width>291</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
|
p, li { white-space: pre-wrap; }
|
||||||
|
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Denes Matetelki <a href="mailto:denes.matetelki@gmail.com"><span style=" text-decoration: underline; color:#508ed8;">denes.matetelki@gmail.com</span></a></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>AboutDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>AboutDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
@ -0,0 +1,104 @@
|
|||||||
|
#include <QPainter>
|
||||||
|
|
||||||
|
#include "edge.h"
|
||||||
|
#include "node.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
static const double Pi = 3.14159265358979323846264338327950288419717;
|
||||||
|
static double TwoPi = 2.0 * Pi;
|
||||||
|
|
||||||
|
Edge::Edge(Node *sourceNode, Node *destNode)
|
||||||
|
: arrowSize(10)
|
||||||
|
{
|
||||||
|
setAcceptedMouseButtons(0);
|
||||||
|
source = sourceNode;
|
||||||
|
dest = destNode;
|
||||||
|
source->addEdge(this);
|
||||||
|
dest->addEdge(this);
|
||||||
|
adjust();
|
||||||
|
setZValue(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Node *Edge::sourceNode() const
|
||||||
|
{
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
Node *Edge::destNode() const
|
||||||
|
{
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Edge::adjust()
|
||||||
|
{
|
||||||
|
if (!source || !dest)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QLineF line(mapFromItem(source, 0, 0) + source->boundingRect().center(),
|
||||||
|
mapFromItem(dest, 0, 0) + dest->boundingRect().center());
|
||||||
|
qreal length = line.length();
|
||||||
|
|
||||||
|
prepareGeometryChange();
|
||||||
|
|
||||||
|
if (length > qreal(20.)) {
|
||||||
|
// QPointF edgeOffset((line.dx() * 10) / length, (line.dy() * 10) / length);
|
||||||
|
// QPointF sourceOffset( );
|
||||||
|
// if ( source->contains( source->boundingRect().center() + source->boundingRect().height() / 2 / tan(line.angle())),
|
||||||
|
// source->boundingRect().width() / 2 )
|
||||||
|
// {
|
||||||
|
// sourcePoint = line.p1() + QPointF( , tan( line.angle() ) * source->boundingRect().height() / 2 );
|
||||||
|
// }
|
||||||
|
|
||||||
|
sourcePoint = line.p1();
|
||||||
|
destPoint = line.p2();
|
||||||
|
} else {
|
||||||
|
sourcePoint = destPoint = line.p1();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF Edge::boundingRect() const
|
||||||
|
{
|
||||||
|
if (!source || !dest)
|
||||||
|
return QRectF();
|
||||||
|
|
||||||
|
qreal penWidth = 1;
|
||||||
|
qreal extra = (penWidth + arrowSize) / 2.0;
|
||||||
|
|
||||||
|
return QRectF(sourcePoint, QSizeF(destPoint.x() - sourcePoint.x(),
|
||||||
|
destPoint.y() - sourcePoint.y()))
|
||||||
|
.normalized()
|
||||||
|
.adjusted(-extra, -extra, extra, extra);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
||||||
|
{
|
||||||
|
if (!source || !dest)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QLineF line(sourcePoint, destPoint);
|
||||||
|
if (qFuzzyCompare(line.length(), qreal(0.)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Draw the line itself
|
||||||
|
painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
|
painter->drawLine(line);
|
||||||
|
|
||||||
|
// Draw the arrows
|
||||||
|
double angle = ::acos(line.dx() / line.length());
|
||||||
|
if (line.dy() >= 0)
|
||||||
|
angle = TwoPi - angle;
|
||||||
|
|
||||||
|
// QPointF sourceArrowP1 = sourcePoint + QPointF(sin(angle + Pi / 3) * arrowSize,
|
||||||
|
// cos(angle + Pi / 3) * arrowSize);
|
||||||
|
// QPointF sourceArrowP2 = sourcePoint + QPointF(sin(angle + Pi - Pi / 3) * arrowSize,
|
||||||
|
// cos(angle + Pi - Pi / 3) * arrowSize);
|
||||||
|
QPointF destArrowP1 = destPoint + QPointF(sin(angle - Pi / 3) * arrowSize,
|
||||||
|
cos(angle - Pi / 3) * arrowSize);
|
||||||
|
QPointF destArrowP2 = destPoint + QPointF(sin(angle - Pi + Pi / 3) * arrowSize,
|
||||||
|
cos(angle - Pi + Pi / 3) * arrowSize);
|
||||||
|
|
||||||
|
painter->setBrush(Qt::black);
|
||||||
|
// painter->drawPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2);
|
||||||
|
painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2);
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
#ifndef EDGE_H
|
||||||
|
#define EDGE_H
|
||||||
|
|
||||||
|
#include <QGraphicsItem>
|
||||||
|
|
||||||
|
class Node;
|
||||||
|
|
||||||
|
class Edge : public QGraphicsItem
|
||||||
|
{
|
||||||
|
// Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
Edge(Node *sourceNode, Node *destNode);
|
||||||
|
|
||||||
|
Node *sourceNode() const;
|
||||||
|
Node *destNode() const;
|
||||||
|
|
||||||
|
void adjust();
|
||||||
|
|
||||||
|
enum { Type = UserType + 2 };
|
||||||
|
int type() const { return Type; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QRectF boundingRect() const;
|
||||||
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Node *source, *dest;
|
||||||
|
|
||||||
|
QPointF sourcePoint;
|
||||||
|
QPointF destPoint;
|
||||||
|
qreal arrowSize;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,107 @@
|
|||||||
|
#include "graphwidget.h"
|
||||||
|
#include <QDebug>
|
||||||
|
#include "node.h"
|
||||||
|
|
||||||
|
//#include <QGraphicsTextItem>
|
||||||
|
#include "edge.h"
|
||||||
|
#include "math.h"
|
||||||
|
|
||||||
|
GraphWidget::GraphWidget(QWidget *parent)
|
||||||
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
|
scene = new QGraphicsScene(this);
|
||||||
|
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
|
||||||
|
scene->setSceneRect(-200, -200, 400, 400);
|
||||||
|
setScene(scene);
|
||||||
|
setCacheMode(CacheBackground);
|
||||||
|
setViewportUpdateMode(BoundingRectViewportUpdate);
|
||||||
|
setRenderHint(QPainter::Antialiasing);
|
||||||
|
setTransformationAnchor(AnchorUnderMouse);
|
||||||
|
scale(qreal(0.8), qreal(0.8));
|
||||||
|
setMinimumSize(400, 400);
|
||||||
|
|
||||||
|
|
||||||
|
// node1 = new Node(this);
|
||||||
|
// scene->addItem(node1);
|
||||||
|
// node1->setPos(0, 0);
|
||||||
|
Node *node1 = new Node();
|
||||||
|
node1->setHtml(QString("salalal"));
|
||||||
|
scene->addItem(node1);
|
||||||
|
node1->setPos(-100, -100);
|
||||||
|
|
||||||
|
Node *node2 = new Node();
|
||||||
|
node2->setHtml(QString("<b>denes</b> is\na really nice person"));
|
||||||
|
scene->addItem(node2);
|
||||||
|
node2->setPos(100, 100);
|
||||||
|
|
||||||
|
|
||||||
|
// QGraphicsTextItem *item = new QGraphicsTextItem();
|
||||||
|
// item->setPlainText(QString("salalal"));
|
||||||
|
// scene->addItem(item);
|
||||||
|
// item->setPos(20, 20);
|
||||||
|
// item->setFlag(QGraphicsItem::ItemIsMovable);
|
||||||
|
// item->setFlag(QGraphicsItem::ItemSendsGeometryChanges);
|
||||||
|
// item->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||||
|
// item->setZValue(-1);
|
||||||
|
|
||||||
|
// QGraphicsTextItem *item2 = new QGraphicsTextItem();
|
||||||
|
// item2->setHtml(QString("<b>denes</b> is\na really nice person"));
|
||||||
|
// scene->addItem(item2);
|
||||||
|
// item2->setPos(10, 10);
|
||||||
|
// item2->setFlag(QGraphicsItem::ItemIsMovable);
|
||||||
|
// item2->setFlag(QGraphicsItem::ItemSendsGeometryChanges);
|
||||||
|
// item2->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||||
|
// item2->setZValue(-1);
|
||||||
|
|
||||||
|
scene->addItem(new Edge(node1, node2));
|
||||||
|
activeNode = node1;
|
||||||
|
activeNode->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GraphWidget::keyPressEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
switch (event->key()) {
|
||||||
|
// case Qt::Key_Up:
|
||||||
|
// centerNode->moveBy(0, -20);
|
||||||
|
// break;
|
||||||
|
// case Qt::Key_Down:
|
||||||
|
// centerNode->moveBy(0, 20);
|
||||||
|
// break;
|
||||||
|
// case Qt::Key_Left:
|
||||||
|
// centerNode->moveBy(-20, 0);
|
||||||
|
// break;
|
||||||
|
// case Qt::Key_Right:
|
||||||
|
// centerNode->moveBy(20, 0);
|
||||||
|
// break;
|
||||||
|
case Qt::Key_Plus:
|
||||||
|
scaleView(qreal(1.2));
|
||||||
|
break;
|
||||||
|
case Qt::Key_Minus:
|
||||||
|
scaleView(1 / qreal(1.2));
|
||||||
|
break;
|
||||||
|
// case Qt::Key_Space:
|
||||||
|
// case Qt::Key_Enter:
|
||||||
|
// foreach (QGraphicsItem *item, scene()->items()) {
|
||||||
|
// if (qgraphicsitem_cast<Node *>(item))
|
||||||
|
// item->setPos(-150 + qrand() % 300, -150 + qrand() % 300);
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
default:
|
||||||
|
QGraphicsView::keyPressEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphWidget::wheelEvent(QWheelEvent *event)
|
||||||
|
{
|
||||||
|
scaleView(pow((double)2, -event->delta() / 240.0));
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphWidget::scaleView(qreal scaleFactor)
|
||||||
|
{
|
||||||
|
qreal factor = transform().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width();
|
||||||
|
if (factor < 0.2 || factor > 10) return;
|
||||||
|
|
||||||
|
scale(scaleFactor, scaleFactor);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
#ifndef GRAPHWIDGET_H
|
||||||
|
#define GRAPHWIDGET_H
|
||||||
|
|
||||||
|
#include <QGraphicsView>
|
||||||
|
#include <QGraphicsScene>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
|
||||||
|
#include "node.h"
|
||||||
|
|
||||||
|
//class Node;
|
||||||
|
|
||||||
|
class GraphWidget : public QGraphicsView
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
GraphWidget(QWidget *parent = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// void drawBackground(QPainter *painter, const QRectF &rect);
|
||||||
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
void wheelEvent(QWheelEvent *event);
|
||||||
|
void scaleView(qreal scaleFactor);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Node *activeNode;
|
||||||
|
QGraphicsScene *scene;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GRAPHWIDGET_H
|
@ -1,11 +1,82 @@
|
|||||||
#include <QtGui/QApplication>
|
#include <stdlib.h> // EXIT_SUCCESS
|
||||||
|
#include <iostream> // cout
|
||||||
|
|
||||||
|
#include <QtGui>
|
||||||
|
//#include <QtGui/QApplication>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QRegExp>
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "systemtray.h"
|
||||||
|
|
||||||
|
|
||||||
|
void printUsage()
|
||||||
|
{
|
||||||
|
std::cout << "Usage: qtmindmap [OPTION][FILE]" << std::endl
|
||||||
|
<< "Mindmap program in QT" << std::endl
|
||||||
|
<< std::endl
|
||||||
|
<< "Options:" << std::endl
|
||||||
|
<< "-h, --help\tPrints this help." << std::endl
|
||||||
|
<< "-t, --tray\tStarts application in system tray." << std::endl
|
||||||
|
<< std::endl
|
||||||
|
<< "Report bugs to: denes.matetelki@gmail.com" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool parseCmdLineArgs(bool &isSystemTray, QString &filePath)
|
||||||
|
{
|
||||||
|
QStringList cmdlineArgs = QCoreApplication::arguments();
|
||||||
|
cmdlineArgs.removeFirst();
|
||||||
|
|
||||||
|
QRegExp help("^-(h|-help)$");
|
||||||
|
if (!cmdlineArgs.filter(help).isEmpty()) return false;
|
||||||
|
|
||||||
|
QRegExp tray("^-(t|-tray)$");
|
||||||
|
if (!cmdlineArgs.filter(tray).isEmpty()) isSystemTray = true;
|
||||||
|
|
||||||
|
QRegExp all("^-(t|-tray|h|-help)$");
|
||||||
|
QStringList others;
|
||||||
|
foreach (QString arg, cmdlineArgs) if (all.indexIn(arg)==-1) others.append(arg);
|
||||||
|
if (others.size() > 1) return false;
|
||||||
|
|
||||||
|
if (others.size()==1) filePath = others.first();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
Q_INIT_RESOURCE(qtmindmap);
|
||||||
|
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
|
bool isSystemTray(false);
|
||||||
|
QString filePath;
|
||||||
|
if (!parseCmdLineArgs(isSystemTray,filePath))
|
||||||
|
{
|
||||||
|
printUsage();
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
w.show();
|
SystemTray *systemTray;
|
||||||
|
isSystemTray = true;
|
||||||
|
if (isSystemTray)
|
||||||
|
{
|
||||||
|
if (!QSystemTrayIcon::isSystemTrayAvailable())
|
||||||
|
{
|
||||||
|
QMessageBox::critical(0,
|
||||||
|
QObject::tr("Systray"),
|
||||||
|
QObject::tr("I couldn't detect any system tray on this system."));
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
QApplication::setQuitOnLastWindowClosed(false);
|
||||||
|
systemTray = new SystemTray(&w);
|
||||||
|
systemTray->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
w.show();
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,60 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
|
#include "aboutdialog.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
//#include <QLayout>
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) :
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
ui(new Ui::MainWindow)
|
ui(new Ui::MainWindow),
|
||||||
|
aboutDialog(0)
|
||||||
{
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
connect(ui->actionNew, SIGNAL(activated()), this, SLOT(klakk()));
|
||||||
|
connect(ui->actionOpen, SIGNAL(activated()), this, SLOT(klakk()));
|
||||||
|
connect(ui->actionSave, SIGNAL(activated()), this, SLOT(klakk()));
|
||||||
|
connect(ui->actionClose, SIGNAL(activated()), this, SLOT(klakk()));
|
||||||
|
connect(ui->actionQuit, SIGNAL(activated()), QApplication::instance(),
|
||||||
|
SLOT(closeAllWindows()));
|
||||||
|
connect(ui->actionAbout_QtMindMap, SIGNAL(activated()), this,
|
||||||
|
SLOT(about()));
|
||||||
|
|
||||||
|
graphicsView = new GraphWidget(ui->centralWidget);
|
||||||
|
setCentralWidget(graphicsView);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
delete ui;
|
delete ui;
|
||||||
|
if (aboutDialog) delete aboutDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::klakk()
|
||||||
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::about()
|
||||||
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
|
setDisabled(true);
|
||||||
|
if (aboutDialog == 0) aboutDialog = new AboutDialog(this);
|
||||||
|
aboutDialog->setEnabled(true); // children inherits enabled status
|
||||||
|
aboutDialog->show();
|
||||||
|
// aboutDialog->layout()->setSizeConstraint( QLayout::SetFixedSize );
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::aboutDestroyed()
|
||||||
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
qDebug() << aboutDialog;
|
||||||
|
setEnabled(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,73 @@
|
|||||||
|
#include "node.h"
|
||||||
|
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QStyleOption>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
Node::Node(GraphWidget *parent) : graph(parent), active(false)
|
||||||
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
|
setFlag(ItemIsMovable);
|
||||||
|
setFlag(ItemSendsGeometryChanges);
|
||||||
|
setCacheMode(DeviceCoordinateCache);
|
||||||
|
setZValue(2);
|
||||||
|
|
||||||
|
// shall I set it after some spec key?
|
||||||
|
setTextInteractionFlags(Qt::TextEditorInteraction);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Node::addEdge(Edge *edge)
|
||||||
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
|
edgeList << edge;
|
||||||
|
edge->adjust();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QVariant Node::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
|
switch (change) {
|
||||||
|
case ItemPositionHasChanged:
|
||||||
|
foreach (Edge *edge, edgeList) edge->adjust();
|
||||||
|
// graph->itemMoved();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
|
return QGraphicsItem::itemChange(change, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Node::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||||
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
|
// active = true;
|
||||||
|
// setScale(1.2);
|
||||||
|
update();
|
||||||
|
QGraphicsTextItem::mousePressEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Node::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
|
{
|
||||||
|
qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
|
// active = false;
|
||||||
|
// setScale(1.0);
|
||||||
|
update();
|
||||||
|
QGraphicsTextItem::mouseReleaseEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
//void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
|
//{
|
||||||
|
// qDebug() << __PRETTY_FUNCTION__;
|
||||||
|
// QGraphicsTextItem::paint(painter, option, widget);
|
||||||
|
|
||||||
|
// qDebug() << "I " << (hasFocus() ? "have " : "don't have ") << "focus.";
|
||||||
|
// setScale(hasFocus() ? 1.2 : 1.0);
|
||||||
|
//// setScale(active ? 1.2 : 1.0);
|
||||||
|
//}
|
@ -0,0 +1,34 @@
|
|||||||
|
#ifndef NODE_H
|
||||||
|
#define NODE_H
|
||||||
|
|
||||||
|
#include <QGraphicsTextItem>
|
||||||
|
|
||||||
|
#include "edge.h"
|
||||||
|
#include "graphwidget.h"
|
||||||
|
|
||||||
|
class GraphWidget;
|
||||||
|
|
||||||
|
class Node : public QGraphicsTextItem
|
||||||
|
{
|
||||||
|
// Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
Node(GraphWidget *graphWidget = 0);
|
||||||
|
|
||||||
|
void addEdge(Edge *edge);
|
||||||
|
QList<Edge *> edges() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||||
|
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||||
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||||
|
// void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QList<Edge *> edgeList;
|
||||||
|
GraphWidget *graph;
|
||||||
|
bool active;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // NODE_H
|
@ -0,0 +1,244 @@
|
|||||||
|
<!DOCTYPE QtCreatorProject>
|
||||||
|
<qtcreator>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||||
|
<value type="int">0</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value key="EditorConfiguration.AutoIndent" type="bool">true</value>
|
||||||
|
<value key="EditorConfiguration.AutoSpacesForTabs" type="bool">false</value>
|
||||||
|
<value key="EditorConfiguration.Codec" type="QByteArray">System</value>
|
||||||
|
<value key="EditorConfiguration.DoubleIndentBlocks" type="bool">false</value>
|
||||||
|
<value key="EditorConfiguration.IndentBraces" type="bool">false</value>
|
||||||
|
<value key="EditorConfiguration.IndentSize" type="int">4</value>
|
||||||
|
<value key="EditorConfiguration.MouseNavigation" type="bool">true</value>
|
||||||
|
<value key="EditorConfiguration.PaddingMode" type="int">1</value>
|
||||||
|
<value key="EditorConfiguration.ScrollWheelZooming" type="bool">true</value>
|
||||||
|
<value key="EditorConfiguration.SmartBackspace" type="bool">false</value>
|
||||||
|
<value key="EditorConfiguration.SpacesForTabs" type="bool">true</value>
|
||||||
|
<value key="EditorConfiguration.TabKeyBehavior" type="int">0</value>
|
||||||
|
<value key="EditorConfiguration.TabSize" type="int">8</value>
|
||||||
|
<value key="EditorConfiguration.UseGlobal" type="bool">true</value>
|
||||||
|
<value key="EditorConfiguration.Utf8BomBehavior" type="int">1</value>
|
||||||
|
<value key="EditorConfiguration.addFinalNewLine" type="bool">true</value>
|
||||||
|
<value key="EditorConfiguration.cleanIndentation" type="bool">true</value>
|
||||||
|
<value key="EditorConfiguration.cleanWhitespace" type="bool">true</value>
|
||||||
|
<value key="EditorConfiguration.inEntireDocument" type="bool">false</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Desktop</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
|
||||||
|
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">1</value>
|
||||||
|
<value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
|
||||||
|
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
|
||||||
|
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.BuildCOnfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.</value>
|
||||||
|
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
|
||||||
|
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary" type="bool">false</value>
|
||||||
|
<value key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QString"></value>
|
||||||
|
<value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.MakeArguments" type="QString"></value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
|
||||||
|
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.MakeArguments" type="QString">clean</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
|
||||||
|
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
|
||||||
|
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Qt in PATH Release</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/cs0rbagomba/projects/qtmindmap-build-desktop</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.BuildCOnfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.</value>
|
||||||
|
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
|
||||||
|
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary" type="bool">false</value>
|
||||||
|
<value key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QString"></value>
|
||||||
|
<value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.MakeArguments" type="QString"></value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
|
||||||
|
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.MakeArguments" type="QString">clean</value>
|
||||||
|
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
|
||||||
|
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
|
||||||
|
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Qt in PATH Debug</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString"></value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
|
||||||
|
<valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
|
||||||
|
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Deploy</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">No deployment</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
|
||||||
|
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
|
||||||
|
<valuelist key="Analyzer.Valgrind.AddedSupressionFiles" type="QVariantList"/>
|
||||||
|
<value key="Analyzer.Valgrind.FilterExternalIssues" type="bool">true</value>
|
||||||
|
<value key="Analyzer.Valgrind.NumCallers" type="int">25</value>
|
||||||
|
<valuelist key="Analyzer.Valgrind.RemovedSupressionFiles" type="QVariantList"/>
|
||||||
|
<value key="Analyzer.Valgrind.TrackOrigins" type="bool">true</value>
|
||||||
|
<value key="Analyzer.Valgrind.ValgrindExecutable" type="QString">valgrind</value>
|
||||||
|
<valuelist key="Analyzer.Valgrind.VisibleErrorKinds" type="QVariantList">
|
||||||
|
<value type="int">0</value>
|
||||||
|
<value type="int">1</value>
|
||||||
|
<value type="int">2</value>
|
||||||
|
<value type="int">3</value>
|
||||||
|
<value type="int">4</value>
|
||||||
|
<value type="int">5</value>
|
||||||
|
<value type="int">6</value>
|
||||||
|
<value type="int">7</value>
|
||||||
|
<value type="int">8</value>
|
||||||
|
<value type="int">9</value>
|
||||||
|
<value type="int">10</value>
|
||||||
|
<value type="int">11</value>
|
||||||
|
<value type="int">12</value>
|
||||||
|
<value type="int">13</value>
|
||||||
|
<value type="int">14</value>
|
||||||
|
</valuelist>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qtmindmap</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QString"></value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">qtmindmap.pro</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
|
||||||
|
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
|
||||||
|
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
|
||||||
|
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
|
||||||
|
<value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value>
|
||||||
|
<value key="RunConfiguration.UseCppDebugger" type="bool">true</value>
|
||||||
|
<value key="RunConfiguration.UseQmlDebugger" type="bool">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap key="ProjectExplorer.Target.RunConfiguration.1" type="QVariantMap">
|
||||||
|
<valuelist key="Analyzer.Valgrind.AddedSupressionFiles" type="QVariantList"/>
|
||||||
|
<value key="Analyzer.Valgrind.FilterExternalIssues" type="bool">true</value>
|
||||||
|
<value key="Analyzer.Valgrind.NumCallers" type="int">25</value>
|
||||||
|
<valuelist key="Analyzer.Valgrind.RemovedSupressionFiles" type="QVariantList"/>
|
||||||
|
<value key="Analyzer.Valgrind.TrackOrigins" type="bool">true</value>
|
||||||
|
<value key="Analyzer.Valgrind.ValgrindExecutable" type="QString">valgrind</value>
|
||||||
|
<valuelist key="Analyzer.Valgrind.VisibleErrorKinds" type="QVariantList">
|
||||||
|
<value type="int">0</value>
|
||||||
|
<value type="int">1</value>
|
||||||
|
<value type="int">2</value>
|
||||||
|
<value type="int">3</value>
|
||||||
|
<value type="int">4</value>
|
||||||
|
<value type="int">5</value>
|
||||||
|
<value type="int">6</value>
|
||||||
|
<value type="int">7</value>
|
||||||
|
<value type="int">8</value>
|
||||||
|
<value type="int">9</value>
|
||||||
|
<value type="int">10</value>
|
||||||
|
<value type="int">11</value>
|
||||||
|
<value type="int">12</value>
|
||||||
|
<value type="int">13</value>
|
||||||
|
<value type="int">14</value>
|
||||||
|
</valuelist>
|
||||||
|
<value key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments" type="QString">-q --tool=memcheck --leak-check=full --leak-resolution=low --suppressions=../qtmindmap/Qt47supp.txt ./qtmindmap</value>
|
||||||
|
<value key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase" type="int">2</value>
|
||||||
|
<value key="ProjectExplorer.CustomExecutableRunConfiguration.Executable" type="QString">valgrind</value>
|
||||||
|
<value key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal" type="bool">false</value>
|
||||||
|
<valuelist key="ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
|
||||||
|
<value key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory" type="QString">/home/cs0rbagomba/projects/qtmindmap-build-desktop</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Run valgrind</value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||||
|
<value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value>
|
||||||
|
<value key="RunConfiguration.UseCppDebugger" type="bool">true</value>
|
||||||
|
<value key="RunConfiguration.UseQmlDebugger" type="bool">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">2</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||||
|
<value type="int">1</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
|
||||||
|
<value type="QString">{75e4e232-a182-46a5-bb12-10bf44c99a73}</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||||
|
<value type="int">9</value>
|
||||||
|
</data>
|
||||||
|
</qtcreator>
|
@ -0,0 +1,5 @@
|
|||||||
|
<!DOCTYPE RCC><RCC version="1.0">
|
||||||
|
<qresource prefix="/">
|
||||||
|
<file>heart.svg</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ScrollArea</class>
|
||||||
|
<widget class="QScrollArea" name="ScrollArea">
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>ScrollArea</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents"/>
|
||||||
|
</widget>
|
||||||
|
</ui>
|
@ -0,0 +1,41 @@
|
|||||||
|
#include "systemtray.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <QtGui>
|
||||||
|
//#include <QAction>
|
||||||
|
//#include <QMenu>
|
||||||
|
|
||||||
|
SystemTray::SystemTray(MainWindow* parent)
|
||||||
|
: QSystemTrayIcon(parent),
|
||||||
|
mainWindow(parent)
|
||||||
|
{
|
||||||
|
// QSystemTrayIcon *trayIcon;
|
||||||
|
|
||||||
|
|
||||||
|
minimizeAction = new QAction(tr("Mi&nimize"), this);
|
||||||
|
connect(minimizeAction, SIGNAL(triggered()), parent, SLOT(hide()));
|
||||||
|
|
||||||
|
maximizeAction = new QAction(tr("Ma&ximize"), this);
|
||||||
|
connect(maximizeAction, SIGNAL(triggered()), parent, SLOT(showMaximized()));
|
||||||
|
|
||||||
|
restoreAction = new QAction(tr("&Restore"), this);
|
||||||
|
connect(restoreAction, SIGNAL(triggered()), parent, SLOT(showNormal()));
|
||||||
|
|
||||||
|
quitAction = new QAction(tr("&Quit"), this);
|
||||||
|
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
|
||||||
|
|
||||||
|
/// @BUG shall pass this as parent
|
||||||
|
trayIconMenu = new QMenu(0);
|
||||||
|
trayIconMenu->addAction(minimizeAction);
|
||||||
|
trayIconMenu->addAction(maximizeAction);
|
||||||
|
trayIconMenu->addAction(restoreAction);
|
||||||
|
trayIconMenu->addSeparator();
|
||||||
|
trayIconMenu->addAction(quitAction);
|
||||||
|
|
||||||
|
// trayIcon = new QSystemTrayIcon(this);
|
||||||
|
// trayIcon->setContextMenu(trayIconMenu);
|
||||||
|
setContextMenu(trayIconMenu);
|
||||||
|
|
||||||
|
icon = new QIcon(":/heart.svg");
|
||||||
|
setIcon(QIcon(":/heart.svg"));
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
#ifndef SYSTEMTRAY_H
|
||||||
|
#define SYSTEMTRAY_H
|
||||||
|
|
||||||
|
#include <QSystemTrayIcon>
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
class SystemTray : public QSystemTrayIcon
|
||||||
|
{
|
||||||
|
// Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
SystemTray(MainWindow *parent = 0);
|
||||||
|
|
||||||
|
private:
|
||||||
|
MainWindow *mainWindow;
|
||||||
|
QMenu *trayIconMenu;
|
||||||
|
QAction *minimizeAction;
|
||||||
|
QAction *maximizeAction;
|
||||||
|
QAction *restoreAction;
|
||||||
|
QAction *quitAction;
|
||||||
|
QIcon *icon;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SYSTEMTRAY_H
|
@ -0,0 +1,21 @@
|
|||||||
|
<ui version="4.0">
|
||||||
|
<author/>
|
||||||
|
<comment/>
|
||||||
|
<exportmacro/>
|
||||||
|
<class>SystemTray</class>
|
||||||
|
<widget class="QWidget" name="SystemTray">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<pixmapfunction/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Reference in new issue