Commit 5d9ffdd3 authored by roangel's avatar roangel
Browse files

Solved zoom issue, now text and handlers will stay same size when zooming....

Solved zoom issue, now text and handlers will stay same size when zooming. Added IDs. Separated rectangles in 2 kinds: CrazyFlyZone and Table(still to be implemented)
parent 94abccb9
...@@ -53,7 +53,8 @@ SOURCES = main.cpp \ ...@@ -53,7 +53,8 @@ SOURCES = main.cpp \
myGraphicsScene.cpp \ myGraphicsScene.cpp \
myGraphicsRectItem.cpp \ myGraphicsRectItem.cpp \
cornergrabber.cpp \ cornergrabber.cpp \
myGraphicsView.cpp moc_mainguiwindow.cpp \ myGraphicsView.cpp \
crazyFlyZone.cpp moc_mainguiwindow.cpp \
moc_myGraphicsScene.cpp \ moc_myGraphicsScene.cpp \
moc_myGraphicsView.cpp moc_myGraphicsView.cpp
OBJECTS = main.o \ OBJECTS = main.o \
...@@ -62,6 +63,7 @@ OBJECTS = main.o \ ...@@ -62,6 +63,7 @@ OBJECTS = main.o \
myGraphicsRectItem.o \ myGraphicsRectItem.o \
cornergrabber.o \ cornergrabber.o \
myGraphicsView.o \ myGraphicsView.o \
crazyFlyZone.o \
moc_mainguiwindow.o \ moc_mainguiwindow.o \
moc_myGraphicsScene.o \ moc_myGraphicsScene.o \
moc_myGraphicsView.o moc_myGraphicsView.o
...@@ -218,12 +220,14 @@ DIST = /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/features/spec_pre.prf ...@@ -218,12 +220,14 @@ DIST = /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/features/spec_pre.prf
myGraphicsScene.h \ myGraphicsScene.h \
myGraphicsRectItem.h \ myGraphicsRectItem.h \
cornergrabber.h \ cornergrabber.h \
myGraphicsView.h main.cpp \ myGraphicsView.h \
crazyFlyZone.h main.cpp \
mainguiwindow.cpp \ mainguiwindow.cpp \
myGraphicsScene.cpp \ myGraphicsScene.cpp \
myGraphicsRectItem.cpp \ myGraphicsRectItem.cpp \
cornergrabber.cpp \ cornergrabber.cpp \
myGraphicsView.cpp myGraphicsView.cpp \
crazyFlyZone.cpp
QMAKE_TARGET = untitled QMAKE_TARGET = untitled
DESTDIR = DESTDIR =
TARGET = untitled TARGET = untitled
...@@ -556,8 +560,8 @@ dist: distdir FORCE ...@@ -556,8 +560,8 @@ dist: distdir FORCE
distdir: FORCE distdir: FORCE
@test -d $(DISTDIR) || mkdir -p $(DISTDIR) @test -d $(DISTDIR) || mkdir -p $(DISTDIR)
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/ $(COPY_FILE) --parents $(DIST) $(DISTDIR)/
$(COPY_FILE) --parents mainguiwindow.h myGraphicsScene.h myGraphicsRectItem.h cornergrabber.h myGraphicsView.h $(DISTDIR)/ $(COPY_FILE) --parents mainguiwindow.h myGraphicsScene.h myGraphicsRectItem.h cornergrabber.h myGraphicsView.h crazyFlyZone.h $(DISTDIR)/
$(COPY_FILE) --parents main.cpp mainguiwindow.cpp myGraphicsScene.cpp myGraphicsRectItem.cpp cornergrabber.cpp myGraphicsView.cpp $(DISTDIR)/ $(COPY_FILE) --parents main.cpp mainguiwindow.cpp myGraphicsScene.cpp myGraphicsRectItem.cpp cornergrabber.cpp myGraphicsView.cpp crazyFlyZone.cpp $(DISTDIR)/
$(COPY_FILE) --parents mainguiwindow.ui $(DISTDIR)/ $(COPY_FILE) --parents mainguiwindow.ui $(DISTDIR)/
...@@ -746,9 +750,12 @@ moc_mainguiwindow.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QMai ...@@ -746,9 +750,12 @@ moc_mainguiwindow.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QMai
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qscrollarea.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qscrollarea.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
myGraphicsScene.h \ myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \
crazyFlyZone.h \
myGraphicsRectItem.h \ myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \ cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
...@@ -842,6 +849,7 @@ moc_myGraphicsScene.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QG ...@@ -842,6 +849,7 @@ moc_myGraphicsScene.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QG
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer_impl.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfont.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfont.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
crazyFlyZone.h \
myGraphicsRectItem.h \ myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsRectItem \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsRectItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsitem.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsitem.h \
...@@ -852,6 +860,7 @@ moc_myGraphicsScene.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QG ...@@ -852,6 +860,7 @@ moc_myGraphicsScene.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QG
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlocale.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlocale.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qset.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qset.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontiguouscache.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontiguouscache.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \ cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
...@@ -976,6 +985,7 @@ moc_myGraphicsView.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGr ...@@ -976,6 +985,7 @@ moc_myGraphicsView.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGr
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qvector2d.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qvector2d.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtouchdevice.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtouchdevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
myGraphicsView.h \ myGraphicsView.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/bin/moc /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/bin/moc
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/bin/moc $(DEFINES) -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/linux-g++ -I/home/gazebo-cf/work/D-FaLL-System/crazyflie_ws/sandbox/crazypkg/gui/untitled -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5 -I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include myGraphicsView.h -o moc_myGraphicsView.cpp /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/bin/moc $(DEFINES) -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/linux-g++ -I/home/gazebo-cf/work/D-FaLL-System/crazyflie_ws/sandbox/crazypkg/gui/untitled -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5 -I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include myGraphicsView.h -o moc_myGraphicsView.cpp
...@@ -1092,7 +1102,8 @@ ui_mainguiwindow.h: mainguiwindow.ui \ ...@@ -1092,7 +1102,8 @@ ui_mainguiwindow.h: mainguiwindow.ui \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfiledevice.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfiledevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qvector2d.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qvector2d.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtouchdevice.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtouchdevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/bin/uic mainguiwindow.ui -o ui_mainguiwindow.h /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/bin/uic mainguiwindow.ui -o ui_mainguiwindow.h
compiler_yacc_decl_make_all: compiler_yacc_decl_make_all:
...@@ -1265,9 +1276,12 @@ main.o: main.cpp mainguiwindow.h \ ...@@ -1265,9 +1276,12 @@ main.o: main.cpp mainguiwindow.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qscrollarea.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qscrollarea.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
myGraphicsScene.h \ myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \
crazyFlyZone.h \
myGraphicsRectItem.h \ myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \ cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
...@@ -1441,9 +1455,12 @@ mainguiwindow.o: mainguiwindow.cpp mainguiwindow.h \ ...@@ -1441,9 +1455,12 @@ mainguiwindow.o: mainguiwindow.cpp mainguiwindow.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qscrollarea.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qscrollarea.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
myGraphicsScene.h \ myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \
crazyFlyZone.h \
myGraphicsRectItem.h \ myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \ cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
...@@ -1544,6 +1561,7 @@ myGraphicsScene.o: myGraphicsScene.cpp myGraphicsScene.h \ ...@@ -1544,6 +1561,7 @@ myGraphicsScene.o: myGraphicsScene.cpp myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer_impl.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfont.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfont.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
crazyFlyZone.h \
myGraphicsRectItem.h \ myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsRectItem \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsRectItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsitem.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsitem.h \
...@@ -1554,6 +1572,7 @@ myGraphicsScene.o: myGraphicsScene.cpp myGraphicsScene.h \ ...@@ -1554,6 +1572,7 @@ myGraphicsScene.o: myGraphicsScene.cpp myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlocale.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlocale.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qset.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qset.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontiguouscache.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontiguouscache.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \ cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
...@@ -1675,6 +1694,7 @@ myGraphicsRectItem.o: myGraphicsRectItem.cpp myGraphicsRectItem.h \ ...@@ -1675,6 +1694,7 @@ myGraphicsRectItem.o: myGraphicsRectItem.cpp myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qimage.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qimage.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpixelformat.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpixelformat.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtransform.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtransform.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \ cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
...@@ -1923,9 +1943,123 @@ myGraphicsView.o: myGraphicsView.cpp myGraphicsView.h \ ...@@ -1923,9 +1943,123 @@ myGraphicsView.o: myGraphicsView.cpp myGraphicsView.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfiledevice.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfiledevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qvector2d.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qvector2d.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtouchdevice.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtouchdevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QApplication \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qapplication.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcoreapplication.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qeventloop.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qdesktopwidget.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qguiapplication.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qinputmethod.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QMouseEvent
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o myGraphicsView.o myGraphicsView.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o myGraphicsView.o myGraphicsView.cpp
crazyFlyZone.o: crazyFlyZone.cpp crazyFlyZone.h \
myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsRectItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsitem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qglobal.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qconfig.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfeatures.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsystemdetection.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qprocessordetection.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcompilerdetection.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qtypeinfo.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qtypetraits.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qisenum.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsysinfo.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlogging.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qflags.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qatomic.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qbasicatomic.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qatomic_bootstrap.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qgenericatomic.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qatomic_cxx11.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qatomic_msvc.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qglobalstatic.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qmutex.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qnumeric.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qversiontagging.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qobject.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qobjectdefs.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qnamespace.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qobjectdefs_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qstring.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qchar.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qbytearray.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qrefcount.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qarraydata.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qstringbuilder.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlist.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qalgorithms.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qiterator.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qhashfunctions.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qpair.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qbytearraylist.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qstringlist.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qregexp.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qstringmatcher.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcoreevent.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qscopedpointer.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qmetatype.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qvarlengtharray.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontainerfwd.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qobject_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qvariant.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qmap.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qdebug.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qhash.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qtextstream.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qiodevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlocale.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qshareddata.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qvector.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qpoint.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qset.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontiguouscache.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qrect.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qmargins.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsize.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpainterpath.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qmatrix.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpolygon.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qregion.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qwindowdefs.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qwindowdefs_win.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qdatastream.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qline.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpixmap.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpaintdevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qcolor.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qrgb.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qrgba64.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qimage.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpixelformat.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtransform.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsTextItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSceneHoverEvent \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicssceneevent.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSceneMouseEvent \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QColor \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QPainter \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpainter.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtextoption.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qbrush.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfontinfo.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfont.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfontmetrics.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QPen \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QPointF
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o crazyFlyZone.o crazyFlyZone.cpp
moc_mainguiwindow.o: moc_mainguiwindow.cpp moc_mainguiwindow.o: moc_mainguiwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainguiwindow.o moc_mainguiwindow.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainguiwindow.o moc_mainguiwindow.cpp
......
...@@ -2,24 +2,21 @@ ...@@ -2,24 +2,21 @@
CornerGrabber::CornerGrabber(QGraphicsItem *parent, int corner) : CornerGrabber::CornerGrabber(QGraphicsItem *parent, int corner) :
QGraphicsItem(parent), QGraphicsItem(parent),
mouseDownX(0),
mouseDownY(0),
_outterborderColor(Qt::black), _outterborderColor(Qt::black),
_outterborderPen(), _outterborderPen(),
_width(6), _width(GRABBER_WIDTH),
_height(6), _height(GRABBER_HEIGHT),
_corner(corner), _corner(corner),
_mouseButtonState(kMouseReleased),
_is_active(false) _is_active(false)
{ {
setParentItem(parent); setParentItem(parent);
_outterborderPen.setWidth(2); _outterborderPen.setWidth(2);
_outterborderPen.setColor(_outterborderColor); _outterborderPen.setColor(_outterborderColor);
this->setAcceptHoverEvents(true);
this->setAcceptHoverEvents(true); this->setFlag(QGraphicsItem::ItemIgnoresTransformations);
} }
qreal CornerGrabber::getHeight() qreal CornerGrabber::getHeight()
{ {
return _height; return _height;
...@@ -30,16 +27,6 @@ qreal CornerGrabber::getWidth() ...@@ -30,16 +27,6 @@ qreal CornerGrabber::getWidth()
return _width; return _width;
} }
void CornerGrabber::setMouseState(int s)
{
_mouseButtonState = s;
}
int CornerGrabber::getMouseState()
{
return _mouseButtonState;
}
int CornerGrabber::getCorner() int CornerGrabber::getCorner()
{ {
return _corner; return _corner;
...@@ -99,26 +86,71 @@ void CornerGrabber::hoverEnterEvent ( QGraphicsSceneHoverEvent * ) ...@@ -99,26 +86,71 @@ void CornerGrabber::hoverEnterEvent ( QGraphicsSceneHoverEvent * )
QRectF CornerGrabber::boundingRect() const QRectF CornerGrabber::boundingRect() const
{ {
return QRectF(0,0,_width,_height); QRectF bounding_rect = this->rect();
return bounding_rect;
} }
QRectF CornerGrabber::rect() const
{
return _rect;
}
void CornerGrabber::setRect(const QRectF & rectangle)
{
_rect = rectangle;
}
void CornerGrabber::paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) void CornerGrabber::paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{ {
// fill the box with solid color, use sharp corners // fill the box with solid color, use sharp corners
prepareGeometryChange();
_outterborderPen.setCapStyle(Qt::SquareCap); _outterborderPen.setCapStyle(Qt::SquareCap);
_outterborderPen.setStyle(Qt::SolidLine); _outterborderPen.setStyle(Qt::SolidLine);
painter->setPen(_outterborderPen); painter->setPen(_outterborderPen);
QRectF rect = createRect();
QPointF topLeft (0, 0); this->setRect(rect);
QPointF bottomRight ( _width, _height);
QRectF rect (topLeft, bottomRight);
QBrush brush (Qt::SolidPattern); QBrush brush (Qt::SolidPattern);
brush.setColor (_outterborderColor); brush.setColor (_outterborderColor);
painter->fillRect(rect,brush); painter->fillRect(_rect,brush);
}
QRectF CornerGrabber::createRect()
{
QPointF topLeft(0,0);
QPointF bottomRight(_width, _height);
QRectF rect(topLeft, bottomRight);
switch(_corner)
{
case CornerGrabber::bottomLeft:
{
QPointF move_to(0,0);
rect.moveBottomLeft(move_to);
return rect;
break;
}
case CornerGrabber::topLeft:
{
return rect;
break;
}
case CornerGrabber::topRight:
{
QPointF move_to(0,0);
rect.moveTopRight(move_to);
return rect;
break;
}
case CornerGrabber::bottomRight:
{
QPointF move_to(0,0);
rect.moveBottomRight(move_to);
return rect;
break;
}
default:
break;
}
} }
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#include <QPointF> #include <QPointF>
#define GRABBER_HEIGHT 10
#define GRABBER_WIDTH 10
class CornerGrabber : public QGraphicsItem class CornerGrabber : public QGraphicsItem
{ {
...@@ -21,19 +23,13 @@ public: ...@@ -21,19 +23,13 @@ public:
explicit CornerGrabber(QGraphicsItem *parent = 0, int corner = 0); explicit CornerGrabber(QGraphicsItem *parent = 0, int corner = 0);
int getCorner(); ///< allows the owner to find out which coner this is int getCorner(); ///< allows the owner to find out which coner this is
void setMouseState(int); ///< allows the owner to record the current mouse state
int getMouseState(); ///< allows the owner to get the current mouse state
qreal getHeight(); qreal getHeight();
qreal getWidth(); qreal getWidth();
bool isActive(); bool isActive();
QRectF rect() const;
qreal mouseDownX;
qreal mouseDownY;
enum {kMouseReleased=0, kMouseDown, kMouseMoving}; ///< define the mouse states
enum {noCorner, bottomLeft, topLeft, topRight, bottomRight}; enum {noCorner, bottomLeft, topLeft, topRight, bottomRight};
private: private:
virtual QRectF boundingRect() const; ///< must be re-implemented in this class to provide the diminsions of the box to the QGraphicsView virtual QRectF boundingRect() const; ///< must be re-implemented in this class to provide the diminsions of the box to the QGraphicsView
...@@ -52,6 +48,9 @@ private: ...@@ -52,6 +48,9 @@ private:
virtual void mousePressEvent(QGraphicsSceneDragDropEvent *event); virtual void mousePressEvent(QGraphicsSceneDragDropEvent *event);
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent * event ); virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent * event );
QRectF createRect();
void setRect(const QRectF & rectangle);
QColor _outterborderColor; ///< the hover event handlers will toggle this between red and black QColor _outterborderColor; ///< the hover event handlers will toggle this between red and black
QPen _outterborderPen; ///< the pen is used to paint the red/black border QPen _outterborderPen; ///< the pen is used to paint the red/black border
...@@ -62,9 +61,7 @@ private: ...@@ -62,9 +61,7 @@ private:
bool _is_active; bool _is_active;
int _mouseButtonState; QRectF _rect;
}; };
#endif // CORNERGRABBER_H #endif // CORNERGRABBER_H
#include "crazyFlyZone.h"
crazyFlyZone::crazyFlyZone(const QRectF & rect, int index, QGraphicsItem * parent)
: myGraphicsRectItem(rect, parent)
{
setIndex(index);
}
void crazyFlyZone::updateLabel(QString string)
{
label->setText(string);
setLabelPosition();
}
void crazyFlyZone::setLabel(QString string)
{
label = new QGraphicsSimpleTextItem(string, this);
label->setFlag(QGraphicsItem::ItemIgnoresTransformations);
label->setFont(QFont("Arial", 18, QFont::Bold, true));
// TODO: choose position and format of text
// label->setPos(label->mapToItem(this, QPointF(0,0)));
setLabelPosition();
}
void crazyFlyZone::setLabelPosition()
{
qreal x_offset = 10;