diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/Makefile b/crazyflie_ws/sandbox/crazypkg/gui/untitled/Makefile index 538c30862944a8478c7513a0bacc354f852bc63a..ce8e61bffe5c5d1f7a76bbc3fda363e8b3a27e8a 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/Makefile +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/Makefile @@ -50,11 +50,15 @@ OBJECTS_DIR = ./ SOURCES = main.cpp \ mainguiwindow.cpp \ - myGraphicsScene.cpp moc_mainguiwindow.cpp \ + myGraphicsScene.cpp \ + myGraphicsRectItem.cpp \ + cornergrabber.cpp moc_mainguiwindow.cpp \ moc_myGraphicsScene.cpp OBJECTS = main.o \ mainguiwindow.o \ myGraphicsScene.o \ + myGraphicsRectItem.o \ + cornergrabber.o \ moc_mainguiwindow.o \ moc_myGraphicsScene.o DIST = /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/features/spec_pre.prf \ @@ -207,9 +211,13 @@ DIST = /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/features/spec_pre.prf /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/features/yacc.prf \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/features/lex.prf \ untitled.pro mainguiwindow.h \ - myGraphicsScene.h main.cpp \ + myGraphicsScene.h \ + myGraphicsRectItem.h \ + cornergrabber.h main.cpp \ mainguiwindow.cpp \ - myGraphicsScene.cpp + myGraphicsScene.cpp \ + myGraphicsRectItem.cpp \ + cornergrabber.cpp QMAKE_TARGET = untitled DESTDIR = TARGET = untitled @@ -542,8 +550,8 @@ dist: distdir FORCE distdir: FORCE @test -d $(DISTDIR) || mkdir -p $(DISTDIR) $(COPY_FILE) --parents $(DIST) $(DISTDIR)/ - $(COPY_FILE) --parents mainguiwindow.h myGraphicsScene.h $(DISTDIR)/ - $(COPY_FILE) --parents main.cpp mainguiwindow.cpp myGraphicsScene.cpp $(DISTDIR)/ + $(COPY_FILE) --parents mainguiwindow.h myGraphicsScene.h myGraphicsRectItem.h cornergrabber.h $(DISTDIR)/ + $(COPY_FILE) --parents main.cpp mainguiwindow.cpp myGraphicsScene.cpp myGraphicsRectItem.cpp cornergrabber.cpp $(DISTDIR)/ $(COPY_FILE) --parents mainguiwindow.ui $(DISTDIR)/ @@ -681,6 +689,8 @@ 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/QtWidgets/qlayout.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qlayoutitem.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qboxlayout.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 \ ui_mainguiwindow.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QVariant \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QAction \ @@ -733,6 +743,18 @@ 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/QtWidgets/QWidget \ myGraphicsScene.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \ + myGraphicsRectItem.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/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/QPen \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QPointF \ mainguiwindow.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 $(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 mainguiwindow.h -o moc_mainguiwindow.cpp @@ -815,6 +837,31 @@ 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/QtGui/qfont.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.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/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/qtextstream.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/qcontiguouscache.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/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/qfontinfo.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 \ myGraphicsScene.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 $(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 myGraphicsScene.h -o moc_myGraphicsScene.cpp @@ -947,6 +994,8 @@ main.o: main.cpp mainguiwindow.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qlayout.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qlayoutitem.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qboxlayout.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 \ ui_mainguiwindow.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QVariant \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QAction \ @@ -998,7 +1047,19 @@ main.o: main.cpp mainguiwindow.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qtoolbar.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QWidget \ 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 \ + myGraphicsRectItem.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/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/QPen \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QPointF $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp mainguiwindow.o: mainguiwindow.cpp mainguiwindow.h \ @@ -1110,6 +1171,8 @@ mainguiwindow.o: mainguiwindow.cpp mainguiwindow.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qlayout.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qlayoutitem.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qboxlayout.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 \ ui_mainguiwindow.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QVariant \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QAction \ @@ -1162,6 +1225,18 @@ mainguiwindow.o: mainguiwindow.cpp mainguiwindow.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QWidget \ myGraphicsScene.h \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \ + myGraphicsRectItem.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/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/QPen \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QPointF \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QDoubleSpinBox \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QTextEdit \ /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qtextedit.h \ @@ -1250,11 +1325,279 @@ 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/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/QtWidgets/QGraphicsSceneMouseEvent \ + 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/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/qtextstream.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/qcontiguouscache.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/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/QtCore/qset.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/qfontinfo.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 \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QRect \ + /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/QtGui/qcursor.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/QtWidgets/qwidget.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpalette.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qsizepolicy.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qkeysequence.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qevent.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qurl.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qurlquery.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfile.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/qtouchdevice.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 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o myGraphicsScene.o myGraphicsScene.cpp +myGraphicsRectItem.o: myGraphicsRectItem.cpp 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 \ + 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 \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QBrush \ + /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/QtGui/qcursor.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/QtWidgets/qwidget.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpalette.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qsizepolicy.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qkeysequence.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qevent.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qurl.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qurlquery.h \ + /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfile.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/qtouchdevice.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/QtCore/QVariant + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o myGraphicsRectItem.o myGraphicsRectItem.cpp + +cornergrabber.o: cornergrabber.cpp 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.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/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/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/QtWidgets/QGraphicsItem \ + /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/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/QGraphicsRectItem \ + /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 cornergrabber.o cornergrabber.cpp + moc_mainguiwindow.o: moc_mainguiwindow.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainguiwindow.o moc_mainguiwindow.cpp diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/cornergrabber.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/cornergrabber.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cb1dc933e34ec2229d3b7ea52632e08397dc08f8 --- /dev/null +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/cornergrabber.cpp @@ -0,0 +1,124 @@ +#include "cornergrabber.h" + +CornerGrabber::CornerGrabber(QGraphicsItem *parent, int corner) : + QGraphicsItem(parent), + mouseDownX(0), + mouseDownY(0), + _outterborderColor(Qt::black), + _outterborderPen(), + _width(6), + _height(6), + _corner(corner), + _mouseButtonState(kMouseReleased), + _is_active(false) +{ + setParentItem(parent); + + _outterborderPen.setWidth(2); + _outterborderPen.setColor(_outterborderColor); + + this->setAcceptHoverEvents(true); +} + +qreal CornerGrabber::getHeight() +{ + return _height; +} + +qreal CornerGrabber::getWidth() +{ + return _width; +} + +void CornerGrabber::setMouseState(int s) +{ + _mouseButtonState = s; +} + +int CornerGrabber::getMouseState() +{ + return _mouseButtonState; +} + +int CornerGrabber::getCorner() +{ + return _corner; +} + +bool CornerGrabber::isActive() +{ + return _is_active; +} + + +// we have to implement the mouse events to keep the linker happy, +// but just set accepted to false since are not actually handling them + +void CornerGrabber::mouseMoveEvent(QGraphicsSceneDragDropEvent *event) +{ + event->setAccepted(false); +} + +void CornerGrabber::mousePressEvent(QGraphicsSceneDragDropEvent *event) +{ + event->setAccepted(false); +} + +void CornerGrabber::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) +{ + event->setAccepted(false); +} + +void CornerGrabber::mousePressEvent ( QGraphicsSceneMouseEvent * event ) +{ + event->setAccepted(false); +} + +void CornerGrabber::mouseMoveEvent ( QGraphicsSceneMouseEvent * event ) +{ + event->setAccepted(false); +} + + +// change the color on hover events to indicate to the use the object has +// been captured by the mouse + +void CornerGrabber::hoverLeaveEvent ( QGraphicsSceneHoverEvent * ) +{ + _outterborderColor = Qt::black; + _is_active = false; + this->update(0,0,_width,_height); +} + +void CornerGrabber::hoverEnterEvent ( QGraphicsSceneHoverEvent * ) +{ + _outterborderColor = Qt::red; + _is_active = true; + this->update(0,0,_width,_height); +} + +QRectF CornerGrabber::boundingRect() const +{ + return QRectF(0,0,_width,_height); +} + + +void CornerGrabber::paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) +{ + + // fill the box with solid color, use sharp corners + + _outterborderPen.setCapStyle(Qt::SquareCap); + _outterborderPen.setStyle(Qt::SolidLine); + painter->setPen(_outterborderPen); + + QPointF topLeft (0, 0); + QPointF bottomRight ( _width, _height); + + QRectF rect (topLeft, bottomRight); + + QBrush brush (Qt::SolidPattern); + brush.setColor (_outterborderColor); + painter->fillRect(rect,brush); + +} diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/cornergrabber.h b/crazyflie_ws/sandbox/crazypkg/gui/untitled/cornergrabber.h new file mode 100644 index 0000000000000000000000000000000000000000..2ba43c44bcb01dd5eda583bab3455f9f50211c6b --- /dev/null +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/cornergrabber.h @@ -0,0 +1,70 @@ +#ifndef CORNERGRABBER_H +#define CORNERGRABBER_H + +#include <QObject> +#include <QGraphicsItem> +#include <QGraphicsRectItem> +#include <QGraphicsTextItem> +#include <QGraphicsSceneHoverEvent> +#include <QGraphicsSceneMouseEvent> +#include <QColor> +#include <QPainter> +#include <QPen> +#include <QPointF> + + + +class CornerGrabber : public QGraphicsItem +{ + +public: + explicit CornerGrabber(QGraphicsItem *parent = 0, int corner = 0); + + 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 getWidth(); + bool isActive(); + + qreal mouseDownX; + qreal mouseDownY; + + enum {kMouseReleased=0, kMouseDown, kMouseMoving}; ///< define the mouse states + enum {bottomLeft, topLeft, topRight, bottomRight}; + + +private: + + virtual QRectF boundingRect() const; ///< must be re-implemented in this class to provide the diminsions of the box to the QGraphicsView + virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); ///< must be re-implemented here to pain the box on the paint-event + virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ); ///< must be re-implemented to handle mouse hover enter events + virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); ///< must be re-implemented to handle mouse hover leave events + + // once the hover event handlers are implemented in this class, + // the mouse events must allow be implemented because of + // some linkage issue - apparrently there is some connection + // between the hover events and mouseMove/Press/Release + // events which triggers a vtable issue + virtual void mouseMoveEvent ( QGraphicsSceneMouseEvent * event ); + virtual void mouseMoveEvent(QGraphicsSceneDragDropEvent *event); + virtual void mousePressEvent (QGraphicsSceneMouseEvent * event ); + virtual void mousePressEvent(QGraphicsSceneDragDropEvent *event); + virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent * event ); + + 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 + + qreal _width; + qreal _height; + + int _corner;// 0,1,2,3 - starting at x=0,y=0 and moving clockwise around the box + + bool _is_active; + + int _mouseButtonState; + + +}; + +#endif // CORNERGRABBER_H diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/cornergrabber.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/cornergrabber.o new file mode 100644 index 0000000000000000000000000000000000000000..06541f35378df763f629797a31f1f3ae4b1376de Binary files /dev/null and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/cornergrabber.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.cpp index 8e1a78e40cca35efcf2af0b6d8af6b69add906a5..170bc7062d626f623ffadecb438b50c139fd38bc 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.cpp +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.cpp @@ -6,7 +6,6 @@ #include <QString> - #define N_MAX_CRAZYFLIES 20 // protection number #ifndef DEBUG_GUI @@ -58,13 +57,15 @@ void MainGUIWindow::_init() scene = new myGraphicsScene(ui->frame_drawing); //scene->setSceneRect(QRectF(QPointF(-100, 100), QSizeF(200, 200))); - ui->graphicsView->setScene(scene); + ui->graphicsView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate); item1 = new QGraphicsRectItem(0,0,100,100); item1->setBrush(QBrush(Qt::blue)); scene->addText("Hello world!"); // scene->addRect(rect, QPen(Qt::black), QBrush(Qt::blue)); scene->addItem(item1); + ui->graphicsView->setScene(scene); + ui->spinBoxNumCrazyflies->setMaximum(N_MAX_CRAZYFLIES); _refresh_tabs(); } diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.o index f86ddb14309472888a62c533595bd8b9bac9b511..f0177004607f5f5f71e50fe9c4c8ca6cb5d8c62f 100644 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.o and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.o index f1e4a3a9a35e7e7adcaaa17ab1662178cf55dd52..b9652dbb27fc6691da546f32ca37d7f1a870c276 100644 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.o and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsRectItem.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsRectItem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.o index 615fa7590c5f056cc8a639b7a6ef129d851066a0..75606480252a6552d463f70f8a395d06358f6f40 100644 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.o and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_renderarea.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_renderarea.cpp deleted file mode 100644 index 363fae90b43d5381b75d2159286b00e83e00283f..0000000000000000000000000000000000000000 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_renderarea.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'renderarea.h' -** -** Created by: The Qt Meta Object Compiler version 67 (Qt 5.7.0) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "renderarea.h" -#include <QtCore/qbytearray.h> -#include <QtCore/qmetatype.h> -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'renderarea.h' doesn't include <QObject>." -#elif Q_MOC_OUTPUT_REVISION != 67 -#error "This file was generated using the moc from 5.7.0. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" -#endif - -QT_BEGIN_MOC_NAMESPACE -struct qt_meta_stringdata_RenderArea_t { - QByteArrayData data[13]; - char stringdata0[113]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_RenderArea_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_RenderArea_t qt_meta_stringdata_RenderArea = { - { -QT_MOC_LITERAL(0, 0, 10), // "RenderArea" -QT_MOC_LITERAL(1, 11, 8), // "setShape" -QT_MOC_LITERAL(2, 20, 0), // "" -QT_MOC_LITERAL(3, 21, 5), // "Shape" -QT_MOC_LITERAL(4, 27, 5), // "shape" -QT_MOC_LITERAL(5, 33, 6), // "setPen" -QT_MOC_LITERAL(6, 40, 3), // "pen" -QT_MOC_LITERAL(7, 44, 8), // "setBrush" -QT_MOC_LITERAL(8, 53, 5), // "brush" -QT_MOC_LITERAL(9, 59, 14), // "setAntialiased" -QT_MOC_LITERAL(10, 74, 11), // "antialiased" -QT_MOC_LITERAL(11, 86, 14), // "setTransformed" -QT_MOC_LITERAL(12, 101, 11) // "transformed" - - }, - "RenderArea\0setShape\0\0Shape\0shape\0" - "setPen\0pen\0setBrush\0brush\0setAntialiased\0" - "antialiased\0setTransformed\0transformed" -}; -#undef QT_MOC_LITERAL - -static const uint qt_meta_data_RenderArea[] = { - - // content: - 7, // revision - 0, // classname - 0, 0, // classinfo - 5, 14, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount - - // slots: name, argc, parameters, tag, flags - 1, 1, 39, 2, 0x0a /* Public */, - 5, 1, 42, 2, 0x0a /* Public */, - 7, 1, 45, 2, 0x0a /* Public */, - 9, 1, 48, 2, 0x0a /* Public */, - 11, 1, 51, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, 0x80000000 | 3, 4, - QMetaType::Void, QMetaType::QPen, 6, - QMetaType::Void, QMetaType::QBrush, 8, - QMetaType::Void, QMetaType::Bool, 10, - QMetaType::Void, QMetaType::Bool, 12, - - 0 // eod -}; - -void RenderArea::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) -{ - if (_c == QMetaObject::InvokeMetaMethod) { - RenderArea *_t = static_cast<RenderArea *>(_o); - Q_UNUSED(_t) - switch (_id) { - case 0: _t->setShape((*reinterpret_cast< Shape(*)>(_a[1]))); break; - case 1: _t->setPen((*reinterpret_cast< const QPen(*)>(_a[1]))); break; - case 2: _t->setBrush((*reinterpret_cast< const QBrush(*)>(_a[1]))); break; - case 3: _t->setAntialiased((*reinterpret_cast< bool(*)>(_a[1]))); break; - case 4: _t->setTransformed((*reinterpret_cast< bool(*)>(_a[1]))); break; - default: ; - } - } -} - -const QMetaObject RenderArea::staticMetaObject = { - { &QWidget::staticMetaObject, qt_meta_stringdata_RenderArea.data, - qt_meta_data_RenderArea, qt_static_metacall, Q_NULLPTR, Q_NULLPTR} -}; - - -const QMetaObject *RenderArea::metaObject() const -{ - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; -} - -void *RenderArea::qt_metacast(const char *_clname) -{ - if (!_clname) return Q_NULLPTR; - if (!strcmp(_clname, qt_meta_stringdata_RenderArea.stringdata0)) - return static_cast<void*>(const_cast< RenderArea*>(this)); - return QWidget::qt_metacast(_clname); -} - -int RenderArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QWidget::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 5) - qt_static_metacall(this, _c, _id, _a); - _id -= 5; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 5) - *reinterpret_cast<int*>(_a[0]) = -1; - _id -= 5; - } - return _id; -} -QT_END_MOC_NAMESPACE diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_renderarea.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_renderarea.o deleted file mode 100644 index 7a366130cd083c6bd08ec52f5b3a18d5c6f3ed93..0000000000000000000000000000000000000000 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_renderarea.o and /dev/null differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsRectItem.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsRectItem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8b251cbf03d4b4c4e1225a41640179d9bb0f358d --- /dev/null +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsRectItem.cpp @@ -0,0 +1,154 @@ +#include "myGraphicsRectItem.h" + +#include <QGraphicsSceneMouseEvent> +#include <QGraphicsRectItem> +#include <QPen> +#include <QBrush> +#include <QApplication> +#include <QVariant> + +myGraphicsRectItem::myGraphicsRectItem(const QRectF & rect, QGraphicsItem * parent) + : QGraphicsRectItem(rect, parent) +{ + this->setFlag(QGraphicsItem::ItemIsSelectable); + this->setFlag(QGraphicsItem::ItemIsMovable); + pen = new QPen(Qt::red); + brush = new QBrush(Qt::red); + + tmp_rect = 0; + _grabbers_created = false; + // this->setAcceptHoverEvents(true); +} + +void myGraphicsRectItem::deleteGrabbers() +{ + _bottomLeft_corner->setParentItem(NULL); + _topLeft_corner->setParentItem(NULL); + _topRight_corner->setParentItem(NULL); + _bottomRight_corner->setParentItem(NULL); + + delete _bottomLeft_corner; + delete _topLeft_corner; + delete _topRight_corner; + delete _bottomRight_corner; + _grabbers_created = false; +} + +QVariant myGraphicsRectItem::itemChange(GraphicsItemChange change, const QVariant &value) +{ + if (change == QGraphicsItem::ItemSelectedChange) + { + if (value == true) + { + qDebug("selected!"); + createGrabbers(); + } + else + { + qDebug("unselected!"); + deleteGrabbers(); + } + } + + return QGraphicsItem::itemChange(change, value); +} + +bool myGraphicsRectItem::grabbersAreCreated() +{ + return _grabbers_created; +} + +void myGraphicsRectItem::setCornerPositions() +{ + QRectF rect = this->rect(); + + _bottomLeft_corner->setPos(rect.bottomLeft().x(), rect.bottomLeft().y() - _bottomLeft_corner->getHeight()); + _topLeft_corner->setPos(rect.topLeft().x(), rect.topLeft().y()); + _topRight_corner->setPos(rect.topRight().x() - _topRight_corner->getWidth(), rect.topRight().y()); + _bottomRight_corner->setPos(rect.bottomRight().x() - _bottomRight_corner->getWidth(), rect.bottomRight().y() - _bottomRight_corner->getHeight()); +} + +void myGraphicsRectItem::createGrabbers() +{ + if(!grabbersAreCreated()) + { + _bottomLeft_corner = new CornerGrabber(this, CornerGrabber::bottomLeft); + _topLeft_corner = new CornerGrabber(this, CornerGrabber::topLeft); + _topRight_corner = new CornerGrabber(this, CornerGrabber::topRight); + _bottomRight_corner = new CornerGrabber(this, CornerGrabber::topRight); + + + _bottomLeft_corner->installSceneEventFilter(this); + _topLeft_corner->installSceneEventFilter(this); + _topRight_corner->installSceneEventFilter(this); + _bottomRight_corner->installSceneEventFilter(this); + + _grabbers_created = true; + setCornerPositions(); + } +} + +int myGraphicsRectItem::checkCornerGrabbers() +{ + + // we return the first active found. Hopefully we never have two at the same time. + if(_bottomLeft_corner->isActive()) + return CornerGrabber::bottomLeft; + else if(_topLeft_corner->isActive()) + return CornerGrabber::topLeft; + else if (_topRight_corner->isActive()) + return CornerGrabber::topRight; + else if( _bottomRight_corner->isActive()) + return CornerGrabber::bottomRight; + else + return 20; +} + +void myGraphicsRectItem::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) +{ + if (mouseEvent->button() != Qt::LeftButton) + return; + + createGrabbers(); //This is just in case they have not been created by now. + + switch(checkCornerGrabbers()) + { + case CornerGrabber::bottomLeft: + qDebug("bottomLeft"); + mouseEvent->setAccepted(true); + break; + case CornerGrabber::topLeft: + qDebug("topLeft"); + mouseEvent->setAccepted(true); + break; + case CornerGrabber::topRight: + qDebug("topRight"); + mouseEvent->setAccepted(true); + break; + case CornerGrabber::bottomRight: + qDebug("bottomRight"); + mouseEvent->setAccepted(true); + break; + default: + qDebug("No corner"); + // Normal case here, mouse not in corner grabbers + QGraphicsRectItem::mousePressEvent(mouseEvent); + break; + } + // TODO: check if over handlers, if, resize mode +} + +void myGraphicsRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) +{ + this->prepareGeometryChange(); + QGraphicsRectItem::mouseMoveEvent(mouseEvent); +} + +void myGraphicsRectItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) +{ + + if (mouseEvent->button() != Qt::LeftButton) + return; + // TODO: stop resize mode + QGraphicsRectItem::mouseReleaseEvent(mouseEvent); +} diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsRectItem.h b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsRectItem.h new file mode 100644 index 0000000000000000000000000000000000000000..49607f17911988c7ab859edb369debac58329e43 --- /dev/null +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsRectItem.h @@ -0,0 +1,51 @@ +#ifndef MYGRAPHICSRECTITEM_H +#define MYGRAPHICSRECTITEM_H +#include <vector> + +#include <QGraphicsRectItem> +#include "cornergrabber.h" + +class QGraphicsSceneMouseEvent; +class QPointF; +class QColor; + + +class myGraphicsRectItem : public QGraphicsRectItem +{ +public: + explicit myGraphicsRectItem(const QRectF & rect, QGraphicsItem * parent = 0); + +public slots: + +signals: + +protected: + void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) override; + void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) override; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) override; + + QVariant itemChange(GraphicsItemChange change, const QVariant &value) override; + +private: + void setCornerPositions(); + int checkCornerGrabbers(); + void createGrabbers(); + bool grabbersAreCreated(); + void deleteGrabbers(); + + QPen* pen; + QBrush* brush; + QRectF* tmp_rect; + QGraphicsRectItem* tmp_rect_item; + QPointF* p1; + QPointF* p2; + + CornerGrabber* _bottomLeft_corner; + CornerGrabber* _topLeft_corner; + CornerGrabber* _topRight_corner; + CornerGrabber* _bottomRight_corner; + + bool _grabbers_created; +}; + +#endif diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsRectItem.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsRectItem.o new file mode 100644 index 0000000000000000000000000000000000000000..81d90b2b3755731591140c4d6e7b806814de6d97 Binary files /dev/null and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsRectItem.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.cpp index 5d9266a04a2bd08330c70875530b75386e754909..50d0f290e0849d738a297b171f8fa9b84b8c595f 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.cpp +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.cpp @@ -2,7 +2,7 @@ #include <QGraphicsSceneMouseEvent> #include <QRect> -#include <QGraphicsRectItem> +#include <QApplication> myGraphicsScene::myGraphicsScene(QObject *parent) : QGraphicsScene(parent) @@ -15,38 +15,20 @@ myGraphicsScene::myGraphicsScene(QObject *parent) // firstClick = true; } - void myGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { if (mouseEvent->button() != Qt::LeftButton) return; + if(Qt::ControlModifier == QApplication::keyboardModifiers()) + { + // Drag and drop approach + startedRect = true; + p1 = new QPointF(mouseEvent->scenePos()); + tmp_rect = new QRectF(*p1, *p1); + tmp_rect_item = new myGraphicsRectItem(*tmp_rect); + addItem(tmp_rect_item); + } - - // Drag and drop approach - - startedRect = true; - p1 = new QPointF(mouseEvent->scenePos()); - tmp_rect = new QRectF(*p1, *p1); - // addRect(*tmp_rect, *pen, *brush); - tmp_rect_item = new QGraphicsRectItem(*tmp_rect); - rectangles.push_back(tmp_rect_item); - addItem(rectangles.back()); - - // Two-clicks approach - // if(firstClick) - // { - // p1 = new QPointF(mouseEvent->scenePos()); - // tmp_rect_item = addRect(QRect(p1->toPoint(), p1->toPoint()), *pen, *brush); //save it to remove it after - // } - // else - // { - // p2 = new QPointF(mouseEvent->scenePos()); - // // QRect tmp_rect(*p2, *p2); - // // addRect(tmp_rect, *pen, *brush); - // } - - - update(); QGraphicsScene::mousePressEvent(mouseEvent); } @@ -56,44 +38,32 @@ void myGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) { tmp_rect_item->setRect(QRectF(*p1, mouseEvent->scenePos())); qDebug("Mouse Position: %d, %d", (mouseEvent->scenePos()).toPoint().x(), (mouseEvent->scenePos()).toPoint().y()); - qDebug("Rectangle BottomRight Position: %d, %d", tmp_rect->bottomRight().x(), tmp_rect->bottomRight().y()); - update(); + qDebug("Rectangle BottomRight Position: %d, %d", tmp_rect_item->rect().bottomRight().x(), tmp_rect_item->rect().bottomRight().y()); } QGraphicsScene::mouseMoveEvent(mouseEvent); } void myGraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) { + if(startedRect) + { + if (mouseEvent->button() != Qt::LeftButton) + return; - if (mouseEvent->button() != Qt::LeftButton) - return; + // Drag and drop approach: - // Drag and drop approach: + // TODO: If too small, etc etc, dont add it to the container and remove it - tmp_rect = 0; - startedRect = false; + tmp_rect_item->setRect(tmp_rect_item->rect().normalized()); + rectangles.push_back(tmp_rect_item); + tmp_rect = 0; + startedRect = false; - // Two-clicks approach + // update(); - // if(firstClick) - // { - // firstClick = false; - // } - // else - // { - // removeItem(tmp_rect_item); - // tmp_rect_item = new QGraphicsRectItem(QRectF(*p1, *p2)); - // // *tmp_rect, *pen, *brush); - // rectangles.push_back(tmp_rect_item); + } - // addItem(rectangles.back()); - // p1 = 0; - // p2 = 0; - // tmp_rect = 0; - // firstClick = true; - // } - update(); QGraphicsScene::mouseReleaseEvent(mouseEvent); } diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.h b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.h index 703c1c0bc556a293c4771458976ace787ddf792b..337ea706c4a4a16a3adeb50b054bff720cbeca87 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.h +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.h @@ -5,6 +5,8 @@ #include <QGraphicsScene> +#include "myGraphicsRectItem.h" + class QGraphicsSceneMouseEvent; class QPointF; class QColor; @@ -16,7 +18,7 @@ class myGraphicsScene : public QGraphicsScene public: explicit myGraphicsScene(QObject *parent = 0); - std::vector<QGraphicsRectItem*> rectangles; + std::vector<myGraphicsRectItem*> rectangles; public slots: @@ -31,7 +33,7 @@ private: QPen* pen; QBrush* brush; QRectF* tmp_rect; - QGraphicsRectItem* tmp_rect_item; + myGraphicsRectItem* tmp_rect_item; QPointF* p1; QPointF* p2; diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.o index 6c385fa8f522057f3f8e5b50a75a1aa18306a988..fda44f5eca115cfcafe578c91e2c2429a16682de 100644 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.o and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/renderarea.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/renderarea.o deleted file mode 100644 index 262e29f403790fd75f60d55453e4119318ddaf02..0000000000000000000000000000000000000000 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/renderarea.o and /dev/null differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled b/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled index 110f9d35e94a3f3cd234afba404fe8f61b4be36f..3a7fc1d6b3f744be61712c60199af0b799693d27 100755 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled.pro b/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled.pro index 3cd9724e6682dd4ec11577528bc30ad950bf8823..a54ebb3fa559ad32f05e83bbbf09024c8964c070 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled.pro +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled.pro @@ -14,9 +14,13 @@ TEMPLATE = app SOURCES += main.cpp\ mainguiwindow.cpp \ - myGraphicsScene.cpp + myGraphicsScene.cpp \ + myGraphicsRectItem.cpp \ + cornergrabber.cpp \ HEADERS += mainguiwindow.h \ - myGraphicsScene.h + myGraphicsScene.h \ + myGraphicsRectItem.h \ + cornergrabber.h FORMS += mainguiwindow.ui diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled.pro.user b/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled.pro.user index da5245d20408a4f42ffb3a36452a759a76664aba..0a187c896bb321402f86b386f179cdafdb72b235 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled.pro.user +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled.pro.user @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> -<!-- Written by QtCreator 4.0.2, 2017-03-23T17:10:24. --> +<!-- Written by QtCreator 4.0.2, 2017-03-30T17:30:23. --> <qtcreator> <data> <variable>EnvironmentId</variable>