diff --git a/!readme b/!readme new file mode 100644 index 0000000..ee48f5b --- /dev/null +++ b/!readme @@ -0,0 +1,24 @@ +Глобальная перестройка! + +Теперь все модули в общем проекте project. +В папке /project файл project.pro открываем в QT и работаем с нужыми файлами. +В папках /VarBase и /Viewer попрежнему исходники (в /include и /src соответсвенно). + +Самое гланое! В папке сборки /project-build-desktop/ лежат Makefile и сама база xml... НЕ УДАЛЯЕМ ЕЕ ОТТУДА! +Перед отправкой коммита удаляйте из этой папки весь мусор кроме этих 2х файлов. + +P.S. почистил от старых файлов + + +29/12 Mr.President + Перестроил иерархию классов (за день до сдачи лучше не менять): + 1) Теперь класс Shape наследник MainWindow. + 2) Все графические объекты - наследники Shape. + 3) Все текстовые/числовые объекты - наследники MainWindow. + + ГЛАВНОЕ! Работает синхронизация с базой переменных для ВСЕХ нужных нам классов и работает разделяющаяся память. + + Осталось только сделать пару классов и по возможности оптимизировать наследование. Кто-нить может заморочиться и сделать нормальное главное окно. + К тому же кто-нить сделайте новую диаграмму классов!!! Лучше, наверное, общую. + + В папке /DOC лежит файл, который в принципе отражает нынешнюю структуру проги, только там не хватает пары фигур, и числа и строки (они идут к главному окну!). diff --git a/VarBase/Makefile b/VarBase/Makefile new file mode 100755 index 0000000..4c38a9c --- /dev/null +++ b/VarBase/Makefile @@ -0,0 +1,7 @@ +testlibrary: basecode.o + g++ test/testfile.cpp -lpthread basecode.o -o testlibrary + ./testlibrary + rm -f basecode.o +basecode.o: src/basecode.cpp + g++ -c src/basecode.cpp -o basecode.o + diff --git a/VarBase/include/basecode.h b/VarBase/include/basecode.h index b51e295..d5a971b 100644 --- a/VarBase/include/basecode.h +++ b/VarBase/include/basecode.h @@ -1,9 +1,16 @@ //библиотека +#ifndef BASECODE_H +#define BASECODE_H #include #include #include #include #include +#include +#include +#include +#include +#define SHMSZ 2097152 using namespace std; class Var //переменная @@ -16,7 +23,7 @@ class Var //переменная string getName(); }; -class IntVar:protected Var //целочисленная переменная +class IntVar: Var //целочисленная переменная { int mValue; public: @@ -25,7 +32,7 @@ class IntVar:protected Var //целочисленная переменная void setValue(int newValue); }; -class StringVar:protected Var //строковая переменная +class StringVar: Var //строковая переменная { string mValue; public: @@ -34,7 +41,7 @@ class StringVar:protected Var //строковая переменная void setValue(string newValue); }; -class DoubleVar:protected Var //переменная с плавующей точкой +class DoubleVar: Var //переменная с плавующей точкой { double mValue; public: @@ -56,3 +63,7 @@ class Library //библиотека int Load(); int Save(); }; + +Library* CreateLibrary(); +Library* ConnectToSharedMemory(); +#endif diff --git a/VarBase/library/Makefile b/VarBase/library/Makefile deleted file mode 100644 index 8ae5156..0000000 --- a/VarBase/library/Makefile +++ /dev/null @@ -1,198 +0,0 @@ -############################################################################# -# Makefile for building: library -# Generated by qmake (2.01a) (Qt 4.6.2) on: ?? ???. 16 22:55:39 2011 -# Project: library.pro -# Template: app -# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger -o Makefile library.pro -############################################################################# - -####### Compiler, tools and options - -CC = gcc -CXX = g++ -DEFINES = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) -CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) -INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -LINK = g++ -LFLAGS = -LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread -AR = ar cqs -RANLIB = -QMAKE = /usr/bin/qmake-qt4 -TAR = tar -cf -COMPRESS = gzip -9f -COPY = cp -f -SED = sed -COPY_FILE = $(COPY) -COPY_DIR = $(COPY) -r -STRIP = strip -INSTALL_FILE = install -m 644 -p -INSTALL_DIR = $(COPY_DIR) -INSTALL_PROGRAM = install -m 755 -p -DEL_FILE = rm -f -SYMLINK = ln -f -s -DEL_DIR = rmdir -MOVE = mv -f -CHK_DIR_EXISTS= test -d -MKDIR = mkdir -p - -####### Output directory - -OBJECTS_DIR = ./ - -####### Files - -SOURCES = ../test/testfile.cpp -OBJECTS = testfile.o -DIST = /usr/share/qt4/mkspecs/common/g++.conf \ - /usr/share/qt4/mkspecs/common/unix.conf \ - /usr/share/qt4/mkspecs/common/linux.conf \ - /usr/share/qt4/mkspecs/qconfig.pri \ - /usr/share/qt4/mkspecs/features/qt_functions.prf \ - /usr/share/qt4/mkspecs/features/qt_config.prf \ - /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /usr/share/qt4/mkspecs/features/default_pre.prf \ - /usr/share/qt4/mkspecs/features/debug.prf \ - /usr/share/qt4/mkspecs/features/default_post.prf \ - /usr/share/qt4/mkspecs/features/warn_on.prf \ - /usr/share/qt4/mkspecs/features/qt.prf \ - /usr/share/qt4/mkspecs/features/unix/thread.prf \ - /usr/share/qt4/mkspecs/features/moc.prf \ - /usr/share/qt4/mkspecs/features/resources.prf \ - /usr/share/qt4/mkspecs/features/uic.prf \ - /usr/share/qt4/mkspecs/features/yacc.prf \ - /usr/share/qt4/mkspecs/features/lex.prf \ - /usr/share/qt4/mkspecs/features/include_source_dir.prf \ - library.pro -QMAKE_TARGET = library -DESTDIR = -TARGET = library - -first: all -####### Implicit rules - -.SUFFIXES: .o .c .cpp .cc .cxx .C - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.cc.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.cxx.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.C.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.c.o: - $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" - -####### Build rules - -all: Makefile $(TARGET) - -$(TARGET): $(OBJECTS) - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) - -Makefile: library.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ - /usr/share/qt4/mkspecs/common/unix.conf \ - /usr/share/qt4/mkspecs/common/linux.conf \ - /usr/share/qt4/mkspecs/qconfig.pri \ - /usr/share/qt4/mkspecs/features/qt_functions.prf \ - /usr/share/qt4/mkspecs/features/qt_config.prf \ - /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /usr/share/qt4/mkspecs/features/default_pre.prf \ - /usr/share/qt4/mkspecs/features/debug.prf \ - /usr/share/qt4/mkspecs/features/default_post.prf \ - /usr/share/qt4/mkspecs/features/warn_on.prf \ - /usr/share/qt4/mkspecs/features/qt.prf \ - /usr/share/qt4/mkspecs/features/unix/thread.prf \ - /usr/share/qt4/mkspecs/features/moc.prf \ - /usr/share/qt4/mkspecs/features/resources.prf \ - /usr/share/qt4/mkspecs/features/uic.prf \ - /usr/share/qt4/mkspecs/features/yacc.prf \ - /usr/share/qt4/mkspecs/features/lex.prf \ - /usr/share/qt4/mkspecs/features/include_source_dir.prf \ - /usr/lib/libQtGui.prl \ - /usr/lib/libQtCore.prl - $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger -o Makefile library.pro -/usr/share/qt4/mkspecs/common/g++.conf: -/usr/share/qt4/mkspecs/common/unix.conf: -/usr/share/qt4/mkspecs/common/linux.conf: -/usr/share/qt4/mkspecs/qconfig.pri: -/usr/share/qt4/mkspecs/features/qt_functions.prf: -/usr/share/qt4/mkspecs/features/qt_config.prf: -/usr/share/qt4/mkspecs/features/exclusive_builds.prf: -/usr/share/qt4/mkspecs/features/default_pre.prf: -/usr/share/qt4/mkspecs/features/debug.prf: -/usr/share/qt4/mkspecs/features/default_post.prf: -/usr/share/qt4/mkspecs/features/warn_on.prf: -/usr/share/qt4/mkspecs/features/qt.prf: -/usr/share/qt4/mkspecs/features/unix/thread.prf: -/usr/share/qt4/mkspecs/features/moc.prf: -/usr/share/qt4/mkspecs/features/resources.prf: -/usr/share/qt4/mkspecs/features/uic.prf: -/usr/share/qt4/mkspecs/features/yacc.prf: -/usr/share/qt4/mkspecs/features/lex.prf: -/usr/share/qt4/mkspecs/features/include_source_dir.prf: -/usr/lib/libQtGui.prl: -/usr/lib/libQtCore.prl: -qmake: FORCE - @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger -o Makefile library.pro - -dist: - @$(CHK_DIR_EXISTS) .tmp/library1.0.0 || $(MKDIR) .tmp/library1.0.0 - $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/library1.0.0/ && $(COPY_FILE) --parents ../include/basecode.h .tmp/library1.0.0/ && $(COPY_FILE) --parents ../test/testfile.cpp .tmp/library1.0.0/ && (cd `dirname .tmp/library1.0.0` && $(TAR) library1.0.0.tar library1.0.0 && $(COMPRESS) library1.0.0.tar) && $(MOVE) `dirname .tmp/library1.0.0`/library1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/library1.0.0 - - -clean:compiler_clean - -$(DEL_FILE) $(OBJECTS) - -$(DEL_FILE) *~ core *.core - - -####### Sub-libraries - -distclean: clean - -$(DEL_FILE) $(TARGET) - -$(DEL_FILE) Makefile - - -mocclean: compiler_moc_header_clean compiler_moc_source_clean - -mocables: compiler_moc_header_make_all compiler_moc_source_make_all - -compiler_moc_header_make_all: -compiler_moc_header_clean: -compiler_rcc_make_all: -compiler_rcc_clean: -compiler_image_collection_make_all: qmake_image_collection.cpp -compiler_image_collection_clean: - -$(DEL_FILE) qmake_image_collection.cpp -compiler_moc_source_make_all: -compiler_moc_source_clean: -compiler_uic_make_all: -compiler_uic_clean: -compiler_yacc_decl_make_all: -compiler_yacc_decl_clean: -compiler_yacc_impl_make_all: -compiler_yacc_impl_clean: -compiler_lex_make_all: -compiler_lex_clean: -compiler_clean: - -####### Compile - -testfile.o: ../test/testfile.cpp ../src/lib.cpp \ - ../include/basecode.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o testfile.o ../test/testfile.cpp - -####### Install - -install: FORCE - -uninstall: FORCE - -FORCE: - diff --git a/VarBase/library/library b/VarBase/library/library deleted file mode 100755 index 0cf607c..0000000 Binary files a/VarBase/library/library and /dev/null differ diff --git a/VarBase/library/library.pro b/VarBase/library/library.pro deleted file mode 100644 index b03f074..0000000 --- a/VarBase/library/library.pro +++ /dev/null @@ -1,4 +0,0 @@ -HEADERS += ../include/basecode.h -SOURCES += ../src/lib.cpp \ - ../test/testfile.cpp -OTHER_FILES += varbase.xml diff --git a/VarBase/note b/VarBase/note index 0726a84..351c472 100644 --- a/VarBase/note +++ b/VarBase/note @@ -1,8 +1,7 @@ 4ый вариант: Аносов(cosmovolk@gmail.com), Петушков(dakil-nae@yandex.ru) Тесты для основных функций - test/testfile.cpp -Диаграмма классов - diagram.png +Диаграмма классов - doc/diagram.png Библиотечный файл - include/basecode.h Файл проверки тестов - test/testfile.cpp -Определение методов класса - src/lib.cpp -Прецеденты класса - precendents -Все что связано с проектом - library/ +Определение методов класса - src/basecode.cpp +Прецеденты класса - doc/precendents diff --git a/VarBase/src/lib.cpp b/VarBase/src/basecode.cpp similarity index 92% rename from VarBase/src/lib.cpp rename to VarBase/src/basecode.cpp index dc8e886..9f45733 100644 --- a/VarBase/src/lib.cpp +++ b/VarBase/src/basecode.cpp @@ -1,10 +1,13 @@ +//основной код библиотеки #include"../include/basecode.h" -#include -#include -#include -#define SHMSZ 2097152 -key_t SharedMemoryKey=27153925; +key_t SharedMemoryKey; + +void MakeKey() +{ + srand(time(0)); + SharedMemoryKey=(key_t)rand(); +} DoubleVar::DoubleVar(string newName) { @@ -190,7 +193,7 @@ int Library::Save() return 1; } -Library* MakeSharedLibrary() +Library* ConnectToSharedMemory() { int shmid; if((shmid=shmget(SharedMemoryKey,SHMSZ, IPC_CREAT | 0666))<0) @@ -201,3 +204,11 @@ Library* MakeSharedLibrary() shml=(Library *)shmat(shmid,NULL,0); return shml; } + +Library* CreateLibrary() +{ + MakeKey(); + Library* SMM=ConnectToSharedMemory(); + Library* SML=new(SMM) Library; + return SML; +} diff --git a/VarBase/test/testfile.cpp b/VarBase/test/testfile.cpp index 0718000..129d787 100644 --- a/VarBase/test/testfile.cpp +++ b/VarBase/test/testfile.cpp @@ -1,7 +1,9 @@ //tests -#include "../src/lib.cpp" +#include "pthread.h" +#include "../include/basecode.h" Library testLib; string mVarName="testn1"; +string mSMVarName="BL2"; int TestAddVar() { @@ -25,6 +27,57 @@ int TestDeleteVar() return 0; } +int SMTestAddVar() +{ + Library *L=ConnectToSharedMemory(); + if(L->Find(mSMVarName)==NULL) + { + if(L->Create(mSMVarName,8)==NULL) return 1; + } + return 0; +} + +int SMTestFindVar() +{ + Library *L=ConnectToSharedMemory(); + if(L->Find("BL1")==NULL) return 1; + return 0; +} + +int SMTestDeleteVar() +{ + Library *L=ConnectToSharedMemory(); + if(L->Delete("BL1")==1) return 1; + if(L->Find("BL1")) return 1; + return 0; +} + +void* funk(void* arg) +{ + Library* cl=ConnectToSharedMemory(); + IntVar* iv=(IntVar*)cl->Find("Int_prim"); + int j=0; + while(j<15) + { + iv->setValue(iv->getValue()+1); + sleep(2); + j++; + } +} + +void* funk1(void *arg) +{ + Library* cl=ConnectToSharedMemory(); + IntVar* iv=(IntVar*)cl->Find("Int_prim"); + int j=0; + while(j<15) + { + cout<getValue()<getName()<<" - "<<((StringVar*)testLib.libr[0])->getValue()<getName()<<" - "<<((IntVar*)testLib.libr[1])->getValue()<Create("BB1","string"); - shmL->Create("BLA","string"); - shmL->Save(); - shmdt(shmL); - return 0; + Library *cl; + cl=CreateLibrary(); + cl->Create("BB1","string"); + cl->Create("BL1","string"); + cl->Create("Int_prim",(int)1); + cout<<"After create library in shared memory and add 2 elements"<libr[0]->getName()<<" - "<<((StringVar*)cl->libr[0])->getValue()<libr[1]->getName()<<" - "<<((StringVar*)cl->libr[1])->getValue()<Save(); + j++; + } } diff --git a/VarBase/testlibrary b/VarBase/testlibrary new file mode 100755 index 0000000..cae4cca Binary files /dev/null and b/VarBase/testlibrary differ diff --git a/VarBase/library/varbase.xml b/VarBase/varbase.xml similarity index 51% rename from VarBase/library/varbase.xml rename to VarBase/varbase.xml index 4cf4cd2..7b78497 100644 --- a/VarBase/library/varbase.xml +++ b/VarBase/varbase.xml @@ -1,5 +1,6 @@ Переменная 1 -Переменная 2 +Переменная 2 +Переменная 3 diff --git a/Viewer/Doc/UML_DIAGRAMMA1VARIANT.png b/Viewer/Doc/UML_DIAGRAMMA1VARIANT.png new file mode 100644 index 0000000..2f670a0 Binary files /dev/null and b/Viewer/Doc/UML_DIAGRAMMA1VARIANT.png differ diff --git a/Viewer/Viewer.rar b/Viewer/Viewer.rar new file mode 100644 index 0000000..2d0de15 Binary files /dev/null and b/Viewer/Viewer.rar differ diff --git a/Viewer/include/DoubleDigit.h b/Viewer/include/DoubleDigit.h new file mode 100644 index 0000000..417c6d6 --- /dev/null +++ b/Viewer/include/DoubleDigit.h @@ -0,0 +1,20 @@ +//классы для дробных чисел +#ifndef DOUBLEDIGIT_H +#define DOUBLEDIGIT_H +#include "../include/mainwindow.h" +#include "../VarBase/include/basecode.h" +#include + +class DoubleDigit: public MainWindow +{ + double value; + + public: + DoubleDigit(string name, double newval); + + void setDigit(string name, double nDigit); + double getDigit(); + void show(QPainter *p, int x, int y); +}; + +#endif diff --git a/Viewer/include/Ellipse.h b/Viewer/include/Ellipse.h new file mode 100644 index 0000000..b8a0ef9 --- /dev/null +++ b/Viewer/include/Ellipse.h @@ -0,0 +1,26 @@ +#ifndef ELLIPSE_H +#define ELLIPSE_H +#include +#include +//#include "mainwindow.h" +#include "shape.h" + +class Ellipse : public Shape +{ + int r1, r2; +public: + + Ellipse(string nx, int nxv, + string ny, int nyv, + string nr1, int nr1v, + string nr2, int nr2v, + QColor ncolv); + int getVarFromBase(string name, int newval); + void show(QPainter *p1); + void setx(string name, int newx); + void sety(string name, int newy); + void setr1(string name, int newr1); + void setr2(string name, int newr2); +}; + +#endif // ELLIPSE_H diff --git a/Viewer/include/IntDigit.h b/Viewer/include/IntDigit.h new file mode 100644 index 0000000..a49511b --- /dev/null +++ b/Viewer/include/IntDigit.h @@ -0,0 +1,19 @@ +//класс для целых чисел +#ifndef INTDIGIT_H +#define INTDIGIT_H +#include "../include/mainwindow.h" +#include "../VarBase/include/basecode.h" +#include + +class IntDigit: public MainWindow +{ + int value; + + public: + IntDigit(string name, int newval); + + void setDigit(string name, int nDigit); + int getDigit(); + void show(QPainter *p, int x, int y); + }; +#endif diff --git a/Viewer/include/Line.h b/Viewer/include/Line.h new file mode 100644 index 0000000..5973030 --- /dev/null +++ b/Viewer/include/Line.h @@ -0,0 +1,33 @@ +//класс линия +#ifndef LINE_H +#define LINE_H +#include +#include +#include "../Viewer/include/shape.h" +#include +//#include "../VarBase/include/basecode.h" +//#include "../Viewer/include/shape.h" + +class Line: public Shape +{ + public: + Line(string nx1, int nx1v, + string ny1, int ny1v, + string nx2, int nx2v, + string ny2, int ny2v, + QColor ncolv); + + void setx1(string name, int nx1); + int getx1(); + void setx2(string name, int nx2); + int getx2(); + void sety1(string name, int ny1); + int gety1(); + void sety2(string name, int ny2); + int gety2(); + void setcolor(int ncolor); + QColor getcolor(); + void show(QPainter *painter); + int getVarFromBase(string name, int newval); +}; +#endif diff --git a/Viewer/include/String.h b/Viewer/include/String.h new file mode 100644 index 0000000..b5d7708 --- /dev/null +++ b/Viewer/include/String.h @@ -0,0 +1,21 @@ +//класс строка +#ifndef STRING_H +#define STRING_H +#include +#include +#include "../Viewer/include/mainwindow.h" +#include + +class String: public MainWindow +{ + const char* data; + + public: + String(string name, const char* ndata); + + const char* getVarFromBase(string name, const char* newval); + void setData(string name, const char* ndata); + const char* getData(); + void show(QPainter *p, int x, int y); +}; +#endif diff --git a/Viewer/include/circle.h b/Viewer/include/circle.h new file mode 100644 index 0000000..e06840e --- /dev/null +++ b/Viewer/include/circle.h @@ -0,0 +1,28 @@ +#ifndef CIRCLE_H +#define CIRCLE_H +#include +#include +//#include "mainwindow.h" +#include "shape.h" + +class Circle : public Shape +{ + int r; +public: + //Circle(); + //Circle(int initUID, int initX, int initY, int initR, QColor initColour=0); + //~Circle(); + Circle(string nx, int nxv, + string ny, int nyv, + string nr, int nrv, + QColor ncolv); + int getVarFromBase(string name, int newval); + void show(QPainter *p1); + void hide(); + void setx(string name, int newx); + void sety(string name, int newy); + void setr(string name, int newr); + void refresh(){} +}; + +#endif // CIRCLE_H diff --git a/Viewer/include/mainwindow.h b/Viewer/include/mainwindow.h new file mode 100644 index 0000000..d5d05d1 --- /dev/null +++ b/Viewer/include/mainwindow.h @@ -0,0 +1,42 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +//#include "../Viewer/include/circle.h" +//#include "../Viewer/include/square.h" +//#include "../Viewer/include/Line.h" +//#include "../Viewer/include/String.h" +#include "../VarBase/include/basecode.h" +//#include "shape.h" +//#include "../Viewer/include/IntDigit.h" +//#include "../Viewer/include/DoubleDigit.h" + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + Library *lib; + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + void paintEvent(QPaintEvent *); + +private: + //key_t SHMKey; + // Массивы окружностей и квадратов + //Circle *circles[50]; + //int nCircles; + //Square *squares[50]; + //int nSquares; + + //экземпляры Линии и Строки + + +private slots: + void on_pushButton_clicked(); +}; + +#endif // MAINWINDOW_H diff --git a/Viewer/res/include/numberbox.h b/Viewer/include/numberbox.h similarity index 100% rename from Viewer/res/include/numberbox.h rename to Viewer/include/numberbox.h diff --git a/Viewer/res/include/shape.h b/Viewer/include/shape.h similarity index 63% rename from Viewer/res/include/shape.h rename to Viewer/include/shape.h index 4162db3..58e9ffb 100644 --- a/Viewer/res/include/shape.h +++ b/Viewer/include/shape.h @@ -1,28 +1,27 @@ #ifndef SHAPE_H #define SHAPE_H #include -//#include "mainwindow.h" +#include "../Viewer/include/mainwindow.h" #include -class Shape +class Shape: public MainWindow { // int a; protected: bool isVisible; int uid; int x, y; - QColor colour; + int x1, y1, x2, y2; + QColor color; public: Shape(); - Shape(int initUID, int initX, int initY, QColor initColour=0); - ~Shape(); + Shape(int initUID, int initX, int initY, QColor initColor=0); + //~Shape(); virtual void show(); - virtual void refresh()=0; virtual void hide(); virtual void move(int newX, int newY); - //virtual void change(int newA, QColor newColour); - virtual void setColour(QColor newColour); + virtual void setColor(QColor newColor); virtual void setUID(int newUID); // Universal accessors virtual int getX(); diff --git a/Viewer/include/square.h b/Viewer/include/square.h new file mode 100644 index 0000000..93148a1 --- /dev/null +++ b/Viewer/include/square.h @@ -0,0 +1,24 @@ +#ifndef SQUARE_H +#define SQUARE_H +#include "shape.h" +#include + +class Square : public Shape +{ + int a; +public: + Square(string nx, int nxv, + string ny, int nyv, + string na, int nav, + QColor ncolv); + int getVarFromBase(string name, int newval); + //Square(); + //Square(int initUID, int initX, int initY, int initA, QColor initColour=0); + //~Square(); + void show(QPainter *p); + void hide(); + void setA(int newA); + void refresh(){} +}; + +#endif // SQUARE_H diff --git a/Viewer/pr2 - v1/Makefile b/Viewer/pr2 - v1/Makefile deleted file mode 100644 index 0cf9021..0000000 --- a/Viewer/pr2 - v1/Makefile +++ /dev/null @@ -1,248 +0,0 @@ -############################################################################# -# Makefile for building: pr2 -# Generated by qmake (2.01a) (Qt 4.6.2) on: ?? ???. 5 18:41:27 2011 -# Project: pr2.pro -# Template: app -# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile pr2.pro -############################################################################# - -####### Compiler, tools and options - -CC = gcc -CXX = g++ -DEFINES = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) -CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) -INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -LINK = g++ -LFLAGS = -LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread -AR = ar cqs -RANLIB = -QMAKE = /usr/bin/qmake-qt4 -TAR = tar -cf -COMPRESS = gzip -9f -COPY = cp -f -SED = sed -COPY_FILE = $(COPY) -COPY_DIR = $(COPY) -r -STRIP = strip -INSTALL_FILE = install -m 644 -p -INSTALL_DIR = $(COPY_DIR) -INSTALL_PROGRAM = install -m 755 -p -DEL_FILE = rm -f -SYMLINK = ln -f -s -DEL_DIR = rmdir -MOVE = mv -f -CHK_DIR_EXISTS= test -d -MKDIR = mkdir -p - -####### Output directory - -OBJECTS_DIR = ./ - -####### Files - -SOURCES = main.cpp \ - mainwindow.cpp \ - shape.cpp \ - circle.cpp \ - square.cpp \ - numberbox.cpp moc_mainwindow.cpp \ - moc_numberbox.cpp -OBJECTS = main.o \ - mainwindow.o \ - shape.o \ - circle.o \ - square.o \ - numberbox.o \ - moc_mainwindow.o \ - moc_numberbox.o -DIST = /usr/share/qt4/mkspecs/common/g++.conf \ - /usr/share/qt4/mkspecs/common/unix.conf \ - /usr/share/qt4/mkspecs/common/linux.conf \ - /usr/share/qt4/mkspecs/qconfig.pri \ - /usr/share/qt4/mkspecs/features/qt_functions.prf \ - /usr/share/qt4/mkspecs/features/qt_config.prf \ - /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /usr/share/qt4/mkspecs/features/default_pre.prf \ - /usr/share/qt4/mkspecs/features/debug.prf \ - /usr/share/qt4/mkspecs/features/default_post.prf \ - /usr/share/qt4/mkspecs/features/warn_on.prf \ - /usr/share/qt4/mkspecs/features/qt.prf \ - /usr/share/qt4/mkspecs/features/unix/thread.prf \ - /usr/share/qt4/mkspecs/features/moc.prf \ - /usr/share/qt4/mkspecs/features/resources.prf \ - /usr/share/qt4/mkspecs/features/uic.prf \ - /usr/share/qt4/mkspecs/features/yacc.prf \ - /usr/share/qt4/mkspecs/features/lex.prf \ - /usr/share/qt4/mkspecs/features/include_source_dir.prf \ - pr2.pro -QMAKE_TARGET = pr2 -DESTDIR = -TARGET = pr2 - -first: all -####### Implicit rules - -.SUFFIXES: .o .c .cpp .cc .cxx .C - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.cc.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.cxx.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.C.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.c.o: - $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" - -####### Build rules - -all: Makefile $(TARGET) - -$(TARGET): ui_mainwindow.h $(OBJECTS) - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) - -Makefile: pr2.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ - /usr/share/qt4/mkspecs/common/unix.conf \ - /usr/share/qt4/mkspecs/common/linux.conf \ - /usr/share/qt4/mkspecs/qconfig.pri \ - /usr/share/qt4/mkspecs/features/qt_functions.prf \ - /usr/share/qt4/mkspecs/features/qt_config.prf \ - /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /usr/share/qt4/mkspecs/features/default_pre.prf \ - /usr/share/qt4/mkspecs/features/debug.prf \ - /usr/share/qt4/mkspecs/features/default_post.prf \ - /usr/share/qt4/mkspecs/features/warn_on.prf \ - /usr/share/qt4/mkspecs/features/qt.prf \ - /usr/share/qt4/mkspecs/features/unix/thread.prf \ - /usr/share/qt4/mkspecs/features/moc.prf \ - /usr/share/qt4/mkspecs/features/resources.prf \ - /usr/share/qt4/mkspecs/features/uic.prf \ - /usr/share/qt4/mkspecs/features/yacc.prf \ - /usr/share/qt4/mkspecs/features/lex.prf \ - /usr/share/qt4/mkspecs/features/include_source_dir.prf \ - /usr/lib/libQtGui.prl \ - /usr/lib/libQtCore.prl - $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile pr2.pro -/usr/share/qt4/mkspecs/common/g++.conf: -/usr/share/qt4/mkspecs/common/unix.conf: -/usr/share/qt4/mkspecs/common/linux.conf: -/usr/share/qt4/mkspecs/qconfig.pri: -/usr/share/qt4/mkspecs/features/qt_functions.prf: -/usr/share/qt4/mkspecs/features/qt_config.prf: -/usr/share/qt4/mkspecs/features/exclusive_builds.prf: -/usr/share/qt4/mkspecs/features/default_pre.prf: -/usr/share/qt4/mkspecs/features/debug.prf: -/usr/share/qt4/mkspecs/features/default_post.prf: -/usr/share/qt4/mkspecs/features/warn_on.prf: -/usr/share/qt4/mkspecs/features/qt.prf: -/usr/share/qt4/mkspecs/features/unix/thread.prf: -/usr/share/qt4/mkspecs/features/moc.prf: -/usr/share/qt4/mkspecs/features/resources.prf: -/usr/share/qt4/mkspecs/features/uic.prf: -/usr/share/qt4/mkspecs/features/yacc.prf: -/usr/share/qt4/mkspecs/features/lex.prf: -/usr/share/qt4/mkspecs/features/include_source_dir.prf: -/usr/lib/libQtGui.prl: -/usr/lib/libQtCore.prl: -qmake: FORCE - @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile pr2.pro - -dist: - @$(CHK_DIR_EXISTS) .tmp/pr21.0.0 || $(MKDIR) .tmp/pr21.0.0 - $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/pr21.0.0/ && $(COPY_FILE) --parents mainwindow.h shape.h circle.h square.h numberbox.h .tmp/pr21.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp shape.cpp circle.cpp square.cpp numberbox.cpp .tmp/pr21.0.0/ && $(COPY_FILE) --parents mainwindow.ui .tmp/pr21.0.0/ && (cd `dirname .tmp/pr21.0.0` && $(TAR) pr21.0.0.tar pr21.0.0 && $(COMPRESS) pr21.0.0.tar) && $(MOVE) `dirname .tmp/pr21.0.0`/pr21.0.0.tar.gz . && $(DEL_FILE) -r .tmp/pr21.0.0 - - -clean:compiler_clean - -$(DEL_FILE) $(OBJECTS) - -$(DEL_FILE) *~ core *.core - - -####### Sub-libraries - -distclean: clean - -$(DEL_FILE) $(TARGET) - -$(DEL_FILE) Makefile - - -mocclean: compiler_moc_header_clean compiler_moc_source_clean - -mocables: compiler_moc_header_make_all compiler_moc_source_make_all - -compiler_moc_header_make_all: moc_mainwindow.cpp moc_numberbox.cpp -compiler_moc_header_clean: - -$(DEL_FILE) moc_mainwindow.cpp moc_numberbox.cpp -moc_mainwindow.cpp: mainwindow.h - /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp - -moc_numberbox.cpp: numberbox.h - /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) numberbox.h -o moc_numberbox.cpp - -compiler_rcc_make_all: -compiler_rcc_clean: -compiler_image_collection_make_all: qmake_image_collection.cpp -compiler_image_collection_clean: - -$(DEL_FILE) qmake_image_collection.cpp -compiler_moc_source_make_all: -compiler_moc_source_clean: -compiler_uic_make_all: ui_mainwindow.h -compiler_uic_clean: - -$(DEL_FILE) ui_mainwindow.h -ui_mainwindow.h: mainwindow.ui - /usr/bin/uic-qt4 mainwindow.ui -o ui_mainwindow.h - -compiler_yacc_decl_make_all: -compiler_yacc_decl_clean: -compiler_yacc_impl_make_all: -compiler_yacc_impl_clean: -compiler_lex_make_all: -compiler_lex_clean: -compiler_clean: compiler_moc_header_clean compiler_uic_clean - -####### Compile - -main.o: main.cpp mainwindow.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp - -mainwindow.o: mainwindow.cpp mainwindow.h \ - ui_mainwindow.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp - -shape.o: shape.cpp shape.h \ - mainwindow.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o shape.o shape.cpp - -circle.o: circle.cpp circle.h \ - mainwindow.h \ - shape.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o circle.o circle.cpp - -square.o: square.cpp square.h \ - shape.h \ - mainwindow.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o square.o square.cpp - -numberbox.o: numberbox.cpp numberbox.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o numberbox.o numberbox.cpp - -moc_mainwindow.o: moc_mainwindow.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp - -moc_numberbox.o: moc_numberbox.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_numberbox.o moc_numberbox.cpp - -####### Install - -install: FORCE - -uninstall: FORCE - -FORCE: - diff --git a/Viewer/pr2 - v1/circle.cpp b/Viewer/pr2 - v1/circle.cpp deleted file mode 100644 index f8653ca..0000000 --- a/Viewer/pr2 - v1/circle.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "circle.h" -#include -#include "mainwindow.h" - -Circle::Circle() -{ -} - -Circle::Circle(int initUID, int initX, int initY, int initR, QColor initColour): - Shape(initUID, initX, initY, initColour), r(initR) -{ - //r = initR; -} - -void Circle::setR(int newR) -{ - r = newR; -} - -void Circle::show(QPainter *painter) // TODO: a parameter indicating where to draw should be passed here -{ - Shape::show(); - QPen pen(colour); - painter->setPen(pen); - painter->drawEllipse(x, y, r*2, r*2); - //QPainter painter(window) - //window-> - -} - -void Circle::hide() -{ - Shape::hide(); - -} diff --git a/Viewer/pr2 - v1/circle.h b/Viewer/pr2 - v1/circle.h deleted file mode 100644 index 3ff0e49..0000000 --- a/Viewer/pr2 - v1/circle.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef CIRCLE_H -#define CIRCLE_H -#include -#include -//#include "mainwindow.h" -#include "shape.h" - -class Circle : public Shape -{ - int r; -public: - Circle(); - Circle(int initUID, int initX, int initY, int initR, QColor initColour=0); - ~Circle(); - void show(QPainter *p1); - void hide(); - void setR(int newR); - void refresh(){} -}; - -#endif // CIRCLE_H diff --git a/Viewer/pr2 - v1/circle.o b/Viewer/pr2 - v1/circle.o deleted file mode 100644 index 294579d..0000000 Binary files a/Viewer/pr2 - v1/circle.o and /dev/null differ diff --git a/Viewer/pr2 - v1/main.cpp b/Viewer/pr2 - v1/main.cpp deleted file mode 100644 index 9ae175b..0000000 --- a/Viewer/pr2 - v1/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - MainWindow w; - w.show(); - - return a.exec(); -} diff --git a/Viewer/pr2 - v1/main.o b/Viewer/pr2 - v1/main.o deleted file mode 100644 index 7b40a6d..0000000 Binary files a/Viewer/pr2 - v1/main.o and /dev/null differ diff --git a/Viewer/pr2 - v1/mainwindow.cpp b/Viewer/pr2 - v1/mainwindow.cpp deleted file mode 100644 index 33f8959..0000000 --- a/Viewer/pr2 - v1/mainwindow.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "mainwindow.h" -#include "ui_mainwindow.h" -#include -#include -#include "circle.h" -#include "square.h" - -#define rnd(a, b) (a)+random()%((b)-(a)) - -MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::MainWindow) -{ - ui->setupUi(this); - - // Здесь, в конструкторе ОКНА, создаём массив окружностей - QColor c1; - nCircles = 0; - while (nCircles<24) - { - c1.setRgb(rnd(100, 200), rnd(150, 250), rnd(120, 160)); - nCircles++; - circles[nCircles-1] = new Circle(nCircles*2, rnd(20, 200), rnd(30, 120), rnd(20, 30), c1); - } - //QColor::setRgb() - -} - -MainWindow::~MainWindow() -{ - delete ui; -} - -void MainWindow::paintEvent(QPaintEvent *) -{ - QPainter p1(this); - //p1.drawEllipse(40, 40, 10, 5); - - int i; - - // При каждой перерисовке выводим массив окружностей на экран - for (i = 0; i< nCircles; i++) - circles[i]->show(&p1); -} - -void MainWindow::on_pushButton_clicked() -{ - QPainter p1(this); - p1.drawEllipse(40, 40, 10, 5); - QGraphicsScene *gs1 = new QGraphicsScene(); -} diff --git a/Viewer/pr2 - v1/mainwindow.h b/Viewer/pr2 - v1/mainwindow.h deleted file mode 100644 index 6d9142c..0000000 --- a/Viewer/pr2 - v1/mainwindow.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include "circle.h" -#include "square.h" -//#include "shape.h" - -namespace Ui { - class MainWindow; -} - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - - void paintEvent(QPaintEvent *); - -private: - Ui::MainWindow *ui; - // Массивы окружностей и квадратов - Circle *circles[50]; - int nCircles; - Square *squares[50]; - int nSquares; - -private slots: - void on_pushButton_clicked(); -}; - -#endif // MAINWINDOW_H diff --git a/Viewer/pr2 - v1/mainwindow.o b/Viewer/pr2 - v1/mainwindow.o deleted file mode 100644 index 9d97164..0000000 Binary files a/Viewer/pr2 - v1/mainwindow.o and /dev/null differ diff --git a/Viewer/pr2 - v1/mainwindow.ui b/Viewer/pr2 - v1/mainwindow.ui deleted file mode 100644 index 6f10840..0000000 --- a/Viewer/pr2 - v1/mainwindow.ui +++ /dev/null @@ -1,74 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 400 - 300 - - - - MainWindow - - - - - - 280 - 130 - 31 - 31 - - - - - - - 240 - 180 - 93 - 27 - - - - PushButton - - - - - - 110 - 170 - 71 - 41 - - - - - - - - 0 - 0 - 400 - 23 - - - - - - TopToolBarArea - - - false - - - - - - - - diff --git a/Viewer/pr2 - v1/moc_mainwindow.cpp b/Viewer/pr2 - v1/moc_mainwindow.cpp deleted file mode 100644 index d26b66e..0000000 --- a/Viewer/pr2 - v1/moc_mainwindow.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'mainwindow.h' -** -** Created: Mon Dec 5 20:39:01 2011 -** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "mainwindow.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'mainwindow.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.6.2. 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 -static const uint qt_meta_data_MainWindow[] = { - - // content: - 4, // revision - 0, // classname - 0, 0, // classinfo - 1, 14, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount - - // slots: signature, parameters, type, tag, flags - 12, 11, 11, 11, 0x08, - - 0 // eod -}; - -static const char qt_meta_stringdata_MainWindow[] = { - "MainWindow\0\0on_pushButton_clicked()\0" -}; - -const QMetaObject MainWindow::staticMetaObject = { - { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow, - qt_meta_data_MainWindow, 0 } -}; - -#ifdef Q_NO_DATA_RELOCATION -const QMetaObject &MainWindow::getStaticMetaObject() { return staticMetaObject; } -#endif //Q_NO_DATA_RELOCATION - -const QMetaObject *MainWindow::metaObject() const -{ - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; -} - -void *MainWindow::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_MainWindow)) - return static_cast(const_cast< MainWindow*>(this)); - return QMainWindow::qt_metacast(_clname); -} - -int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QMainWindow::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - if (_c == QMetaObject::InvokeMetaMethod) { - switch (_id) { - case 0: on_pushButton_clicked(); break; - default: ; - } - _id -= 1; - } - return _id; -} -QT_END_MOC_NAMESPACE diff --git a/Viewer/pr2 - v1/moc_mainwindow.o b/Viewer/pr2 - v1/moc_mainwindow.o deleted file mode 100644 index dbb76d8..0000000 Binary files a/Viewer/pr2 - v1/moc_mainwindow.o and /dev/null differ diff --git a/Viewer/pr2 - v1/moc_numberbox.cpp b/Viewer/pr2 - v1/moc_numberbox.cpp deleted file mode 100644 index 19a2ae6..0000000 --- a/Viewer/pr2 - v1/moc_numberbox.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'numberbox.h' -** -** Created: Mon Dec 5 18:57:39 2011 -** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "numberbox.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'numberbox.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.6.2. 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 -static const uint qt_meta_data_NumberBox[] = { - - // content: - 4, // revision - 0, // classname - 0, 0, // classinfo - 0, 0, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount - - 0 // eod -}; - -static const char qt_meta_stringdata_NumberBox[] = { - "NumberBox\0" -}; - -const QMetaObject NumberBox::staticMetaObject = { - { &QPlainTextEdit::staticMetaObject, qt_meta_stringdata_NumberBox, - qt_meta_data_NumberBox, 0 } -}; - -#ifdef Q_NO_DATA_RELOCATION -const QMetaObject &NumberBox::getStaticMetaObject() { return staticMetaObject; } -#endif //Q_NO_DATA_RELOCATION - -const QMetaObject *NumberBox::metaObject() const -{ - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; -} - -void *NumberBox::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_NumberBox)) - return static_cast(const_cast< NumberBox*>(this)); - return QPlainTextEdit::qt_metacast(_clname); -} - -int NumberBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QPlainTextEdit::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - return _id; -} -QT_END_MOC_NAMESPACE diff --git a/Viewer/pr2 - v1/moc_numberbox.o b/Viewer/pr2 - v1/moc_numberbox.o deleted file mode 100644 index 695b798..0000000 Binary files a/Viewer/pr2 - v1/moc_numberbox.o and /dev/null differ diff --git a/Viewer/pr2 - v1/numberbox.cpp b/Viewer/pr2 - v1/numberbox.cpp deleted file mode 100644 index 5a996eb..0000000 --- a/Viewer/pr2 - v1/numberbox.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "numberbox.h" - -NumberBox::NumberBox(QWidget *parent) : - QPlainTextEdit(parent) -{ - -} diff --git a/Viewer/pr2 - v1/numberbox.h b/Viewer/pr2 - v1/numberbox.h deleted file mode 100644 index bbfd842..0000000 --- a/Viewer/pr2 - v1/numberbox.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef NUMBERBOX_H -#define NUMBERBOX_H - -#include - -class NumberBox : public QPlainTextEdit -{ -Q_OBJECT -public: - explicit NumberBox(QWidget *parent = 0); - -signals: - -public slots: - -}; - -#endif // NUMBERBOX_H diff --git a/Viewer/pr2 - v1/numberbox.o b/Viewer/pr2 - v1/numberbox.o deleted file mode 100644 index c6cb6ca..0000000 Binary files a/Viewer/pr2 - v1/numberbox.o and /dev/null differ diff --git a/Viewer/pr2 - v1/pr2 b/Viewer/pr2 - v1/pr2 deleted file mode 100755 index 2a9d381..0000000 Binary files a/Viewer/pr2 - v1/pr2 and /dev/null differ diff --git a/Viewer/pr2 - v1/pr2.pro b/Viewer/pr2 - v1/pr2.pro deleted file mode 100644 index 8c5d1d2..0000000 --- a/Viewer/pr2 - v1/pr2.pro +++ /dev/null @@ -1,19 +0,0 @@ -# ------------------------------------------------- -# Project created by QtCreator 2011-12-02T15:24:41 -# ------------------------------------------------- -QT += core \ - gui -TARGET = pr2 -TEMPLATE = app -SOURCES += main.cpp \ - mainwindow.cpp \ - shape.cpp \ - circle.cpp \ - square.cpp \ - numberbox.cpp -HEADERS += mainwindow.h \ - shape.h \ - circle.h \ - square.h \ - numberbox.h -FORMS += mainwindow.ui diff --git a/Viewer/pr2 - v1/pr2.pro.user b/Viewer/pr2 - v1/pr2.pro.user deleted file mode 100644 index e2ca751..0000000 --- a/Viewer/pr2 - v1/pr2.pro.user +++ /dev/null @@ -1,245 +0,0 @@ - - - - RunConfiguration0-BaseEnvironmentBase - 2 - - - RunConfiguration0-CommandLineArguments - - - - RunConfiguration0-ProFile - pr2.pro - - - RunConfiguration0-RunConfiguration.name - pr2 - - - RunConfiguration0-UseDyldImageSuffix - false - - - RunConfiguration0-UseTerminal - false - - - RunConfiguration0-UserEnvironmentChanges - - - - RunConfiguration0-UserSetName - false - - - RunConfiguration0-UserSetWorkingDirectory - false - - - RunConfiguration0-UserWorkingDirectory - - - - RunConfiguration0-type - Qt4ProjectManager.Qt4RunConfiguration - - - activeRunConfiguration - 0 - - - activebuildconfiguration - Debug - - - buildConfiguration-Debug - - Debug - 0 - 0 - - 2 - - - - buildConfiguration-Release - - Release - 0 - - 0 - - - - buildconfiguration-Debug-buildstep0 - - Debug - - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-UUss8td4U1,guid=64d9097067de8313a93a92184eedb95e - DEFAULTS_PATH=/usr/share/gconf/gnome.default.path - DESKTOP_SESSION=gnome - DISPLAY=:0.0 - GDMSESSION=gnome - GDM_KEYBOARD_LAYOUT=us - GDM_LANG=ru_RU.utf8 - GNOME_DESKTOP_SESSION_ID=this-is-deprecated - GNOME_KEYRING_CONTROL=/tmp/keyring-onCrxt - GNOME_KEYRING_PID=1140 - GTK_MODULES=canberra-gtk-module - HOME=/home/owner - LANG=ru_RU.utf8 - LD_LIBRARY_PATH=/usr/lib/qtcreator - LOGNAME=owner - MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path - ORBIT_SOCKETDIR=/tmp/orbit-owner - PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games - PWD=/home/owner - QTDIR=/usr/share/qt4 - SESSION_MANAGER=local/owner-desktop:@/tmp/.ICE-unix/1158,unix/owner-desktop:/tmp/.ICE-unix/1158 - SHELL=/bin/bash - SPEECHD_PORT=7560 - SSH_AGENT_PID=1222 - SSH_AUTH_SOCK=/tmp/keyring-onCrxt/ssh - USER=owner - USERNAME=owner - XAUTHORITY=/var/run/gdm/auth-for-owner-gXZp8X/database - XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg - XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/ - XDG_SESSION_COOKIE=e25a00838b58c329d213bac84ed0f185-1324202334.379420-1503744629 - - - /home/owner/Рабочий стол/QT Projects/ТРПО/pr2bak/pr2.pro - -spec - linux-g++ - -r - CONFIG+=debug - - /usr/bin/qmake-qt4 - false - /home/owner/Рабочий стол/QT Projects/ТРПО/pr2bak - - - - buildconfiguration-Debug-buildstep1 - - Debug - - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-UUss8td4U1,guid=64d9097067de8313a93a92184eedb95e - DEFAULTS_PATH=/usr/share/gconf/gnome.default.path - DESKTOP_SESSION=gnome - DISPLAY=:0.0 - GDMSESSION=gnome - GDM_KEYBOARD_LAYOUT=us - GDM_LANG=ru_RU.utf8 - GNOME_DESKTOP_SESSION_ID=this-is-deprecated - GNOME_KEYRING_CONTROL=/tmp/keyring-onCrxt - GNOME_KEYRING_PID=1140 - GTK_MODULES=canberra-gtk-module - HOME=/home/owner - LANG=ru_RU.utf8 - LD_LIBRARY_PATH=/usr/lib/qtcreator - LOGNAME=owner - MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path - ORBIT_SOCKETDIR=/tmp/orbit-owner - PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games - PWD=/home/owner - QTDIR=/usr/share/qt4 - SESSION_MANAGER=local/owner-desktop:@/tmp/.ICE-unix/1158,unix/owner-desktop:/tmp/.ICE-unix/1158 - SHELL=/bin/bash - SPEECHD_PORT=7560 - SSH_AGENT_PID=1222 - SSH_AUTH_SOCK=/tmp/keyring-onCrxt/ssh - USER=owner - USERNAME=owner - XAUTHORITY=/var/run/gdm/auth-for-owner-gXZp8X/database - XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg - XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/ - XDG_SESSION_COOKIE=e25a00838b58c329d213bac84ed0f185-1324202334.379420-1503744629 - - false - - -w - - /usr/bin/make - true - /home/owner/Рабочий стол/QT Projects/ТРПО/pr2bak - - - - buildconfiguration-Debug-cleanstep0 - - Debug - true - - clean - - - - - buildconfiguration-Release-buildstep0 - - Release - - - - buildconfiguration-Release-buildstep1 - - Release - - - - buildconfiguration-Release-cleanstep0 - - Release - - - - buildconfigurations - - Debug - Release - - - - buildstep0 - - - - - - - buildstep1 - - - - - - buildsteps - - trolltech.qt4projectmanager.qmake - trolltech.qt4projectmanager.make - - - - cleanstep0 - - - true - - - - cleansteps - - trolltech.qt4projectmanager.make - - - - defaultFileEncoding - System - - - project - - - diff --git a/Viewer/pr2 - v1/shape.cpp b/Viewer/pr2 - v1/shape.cpp deleted file mode 100644 index 8547c6d..0000000 --- a/Viewer/pr2 - v1/shape.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "shape.h" - -Shape::Shape() -{ -} - -Shape::Shape(int initUID, int initX, int initY, QColor initColour) -{ - uid = initUID; - x = initX; - y = initY; - colour = initColour; -} - -void Shape::move(int newX, int newY) -{ - x = newX; - y = newY; -} - -void Shape::hide() -{ - isVisible = false; -} - -void Shape::show() -{ - - isVisible = true; -} - -void Shape::setColour(QColor newColour) -{ - colour = newColour; -} - -void Shape::setUID(int newUID) -{ - uid = newUID; -} - -int Shape::getX() -{ - return x; -} - -int Shape::getY() -{ - return y; -} - -bool Shape::checkIsVisible() -{ - return isVisible; -} diff --git a/Viewer/pr2 - v1/shape.h b/Viewer/pr2 - v1/shape.h deleted file mode 100644 index 4162db3..0000000 --- a/Viewer/pr2 - v1/shape.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef SHAPE_H -#define SHAPE_H -#include -//#include "mainwindow.h" -#include - -class Shape -{ -// int a; -protected: - bool isVisible; - int uid; - int x, y; - QColor colour; - -public: - Shape(); - Shape(int initUID, int initX, int initY, QColor initColour=0); - ~Shape(); - virtual void show(); - virtual void refresh()=0; - virtual void hide(); - virtual void move(int newX, int newY); - //virtual void change(int newA, QColor newColour); - virtual void setColour(QColor newColour); - virtual void setUID(int newUID); - // Universal accessors - virtual int getX(); - virtual int getY(); - virtual bool checkIsVisible(); -// virtual void setA - -}; - -#endif // SHAPE_H diff --git a/Viewer/pr2 - v1/shape.o b/Viewer/pr2 - v1/shape.o deleted file mode 100644 index 8de386c..0000000 Binary files a/Viewer/pr2 - v1/shape.o and /dev/null differ diff --git a/Viewer/pr2 - v1/square.cpp b/Viewer/pr2 - v1/square.cpp deleted file mode 100644 index 625793d..0000000 --- a/Viewer/pr2 - v1/square.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "square.h" - -Square::Square() -{ -} - -Square::Square(int initUID, int initX, int initY, int initA, QColor initColour): - Shape(initUID, initX, initY, initColour), a(initA) -{ - -} - -void Square::setA(int newA) -{ - a = newA; -} - -void Square::show(QPainter *painter) -{ - Shape::show(); - QPen pen(colour); - painter->setPen(pen); - painter->drawRect(x, y, a, a); - //QPainter painter(this); - -} - -void Square::hide() -{ - Shape::hide(); - -} diff --git a/Viewer/pr2 - v1/square.h b/Viewer/pr2 - v1/square.h deleted file mode 100644 index a997db9..0000000 --- a/Viewer/pr2 - v1/square.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef SQUARE_H -#define SQUARE_H -#include "shape.h" -#include - -class Square : public Shape -{ - int a; -public: - Square(); - Square(int initUID, int initX, int initY, int initA, QColor initColour=0); - ~Square(); - void show(QPainter *p); - void hide(); - void setA(int newA); - void refresh(){} -}; - -#endif // SQUARE_H diff --git a/Viewer/pr2 - v1/square.o b/Viewer/pr2 - v1/square.o deleted file mode 100644 index 7569087..0000000 Binary files a/Viewer/pr2 - v1/square.o and /dev/null differ diff --git a/Viewer/pr2 - v1/ui_mainwindow.h b/Viewer/pr2 - v1/ui_mainwindow.h deleted file mode 100644 index 7f89384..0000000 --- a/Viewer/pr2 - v1/ui_mainwindow.h +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'mainwindow.ui' -** -** Created: Mon Dec 5 19:36:19 2011 -** by: Qt User Interface Compiler version 4.6.2 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_MAINWINDOW_H -#define UI_MAINWINDOW_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_MainWindow -{ -public: - QWidget *centralWidget; - QPlainTextEdit *plainTextEdit; - QPushButton *pushButton; - QGraphicsView *graphicsView; - QMenuBar *menuBar; - QToolBar *mainToolBar; - QStatusBar *statusBar; - - void setupUi(QMainWindow *MainWindow) - { - if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); - MainWindow->resize(400, 300); - centralWidget = new QWidget(MainWindow); - centralWidget->setObjectName(QString::fromUtf8("centralWidget")); - plainTextEdit = new QPlainTextEdit(centralWidget); - plainTextEdit->setObjectName(QString::fromUtf8("plainTextEdit")); - plainTextEdit->setGeometry(QRect(280, 130, 31, 31)); - pushButton = new QPushButton(centralWidget); - pushButton->setObjectName(QString::fromUtf8("pushButton")); - pushButton->setGeometry(QRect(240, 180, 93, 27)); - graphicsView = new QGraphicsView(centralWidget); - graphicsView->setObjectName(QString::fromUtf8("graphicsView")); - graphicsView->setGeometry(QRect(110, 170, 71, 41)); - MainWindow->setCentralWidget(centralWidget); - menuBar = new QMenuBar(MainWindow); - menuBar->setObjectName(QString::fromUtf8("menuBar")); - menuBar->setGeometry(QRect(0, 0, 400, 23)); - MainWindow->setMenuBar(menuBar); - mainToolBar = new QToolBar(MainWindow); - mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); - MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar); - statusBar = new QStatusBar(MainWindow); - statusBar->setObjectName(QString::fromUtf8("statusBar")); - MainWindow->setStatusBar(statusBar); - - retranslateUi(MainWindow); - - QMetaObject::connectSlotsByName(MainWindow); - } // setupUi - - void retranslateUi(QMainWindow *MainWindow) - { - MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8)); - pushButton->setText(QApplication::translate("MainWindow", "PushButton", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - -}; - -namespace Ui { - class MainWindow: public Ui_MainWindow {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_MAINWINDOW_H diff --git a/Viewer/pr2/Makefile b/Viewer/pr2/Makefile deleted file mode 100644 index 0cf9021..0000000 --- a/Viewer/pr2/Makefile +++ /dev/null @@ -1,248 +0,0 @@ -############################################################################# -# Makefile for building: pr2 -# Generated by qmake (2.01a) (Qt 4.6.2) on: ?? ???. 5 18:41:27 2011 -# Project: pr2.pro -# Template: app -# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile pr2.pro -############################################################################# - -####### Compiler, tools and options - -CC = gcc -CXX = g++ -DEFINES = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) -CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) -INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -LINK = g++ -LFLAGS = -LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread -AR = ar cqs -RANLIB = -QMAKE = /usr/bin/qmake-qt4 -TAR = tar -cf -COMPRESS = gzip -9f -COPY = cp -f -SED = sed -COPY_FILE = $(COPY) -COPY_DIR = $(COPY) -r -STRIP = strip -INSTALL_FILE = install -m 644 -p -INSTALL_DIR = $(COPY_DIR) -INSTALL_PROGRAM = install -m 755 -p -DEL_FILE = rm -f -SYMLINK = ln -f -s -DEL_DIR = rmdir -MOVE = mv -f -CHK_DIR_EXISTS= test -d -MKDIR = mkdir -p - -####### Output directory - -OBJECTS_DIR = ./ - -####### Files - -SOURCES = main.cpp \ - mainwindow.cpp \ - shape.cpp \ - circle.cpp \ - square.cpp \ - numberbox.cpp moc_mainwindow.cpp \ - moc_numberbox.cpp -OBJECTS = main.o \ - mainwindow.o \ - shape.o \ - circle.o \ - square.o \ - numberbox.o \ - moc_mainwindow.o \ - moc_numberbox.o -DIST = /usr/share/qt4/mkspecs/common/g++.conf \ - /usr/share/qt4/mkspecs/common/unix.conf \ - /usr/share/qt4/mkspecs/common/linux.conf \ - /usr/share/qt4/mkspecs/qconfig.pri \ - /usr/share/qt4/mkspecs/features/qt_functions.prf \ - /usr/share/qt4/mkspecs/features/qt_config.prf \ - /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /usr/share/qt4/mkspecs/features/default_pre.prf \ - /usr/share/qt4/mkspecs/features/debug.prf \ - /usr/share/qt4/mkspecs/features/default_post.prf \ - /usr/share/qt4/mkspecs/features/warn_on.prf \ - /usr/share/qt4/mkspecs/features/qt.prf \ - /usr/share/qt4/mkspecs/features/unix/thread.prf \ - /usr/share/qt4/mkspecs/features/moc.prf \ - /usr/share/qt4/mkspecs/features/resources.prf \ - /usr/share/qt4/mkspecs/features/uic.prf \ - /usr/share/qt4/mkspecs/features/yacc.prf \ - /usr/share/qt4/mkspecs/features/lex.prf \ - /usr/share/qt4/mkspecs/features/include_source_dir.prf \ - pr2.pro -QMAKE_TARGET = pr2 -DESTDIR = -TARGET = pr2 - -first: all -####### Implicit rules - -.SUFFIXES: .o .c .cpp .cc .cxx .C - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.cc.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.cxx.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.C.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.c.o: - $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" - -####### Build rules - -all: Makefile $(TARGET) - -$(TARGET): ui_mainwindow.h $(OBJECTS) - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) - -Makefile: pr2.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ - /usr/share/qt4/mkspecs/common/unix.conf \ - /usr/share/qt4/mkspecs/common/linux.conf \ - /usr/share/qt4/mkspecs/qconfig.pri \ - /usr/share/qt4/mkspecs/features/qt_functions.prf \ - /usr/share/qt4/mkspecs/features/qt_config.prf \ - /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /usr/share/qt4/mkspecs/features/default_pre.prf \ - /usr/share/qt4/mkspecs/features/debug.prf \ - /usr/share/qt4/mkspecs/features/default_post.prf \ - /usr/share/qt4/mkspecs/features/warn_on.prf \ - /usr/share/qt4/mkspecs/features/qt.prf \ - /usr/share/qt4/mkspecs/features/unix/thread.prf \ - /usr/share/qt4/mkspecs/features/moc.prf \ - /usr/share/qt4/mkspecs/features/resources.prf \ - /usr/share/qt4/mkspecs/features/uic.prf \ - /usr/share/qt4/mkspecs/features/yacc.prf \ - /usr/share/qt4/mkspecs/features/lex.prf \ - /usr/share/qt4/mkspecs/features/include_source_dir.prf \ - /usr/lib/libQtGui.prl \ - /usr/lib/libQtCore.prl - $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile pr2.pro -/usr/share/qt4/mkspecs/common/g++.conf: -/usr/share/qt4/mkspecs/common/unix.conf: -/usr/share/qt4/mkspecs/common/linux.conf: -/usr/share/qt4/mkspecs/qconfig.pri: -/usr/share/qt4/mkspecs/features/qt_functions.prf: -/usr/share/qt4/mkspecs/features/qt_config.prf: -/usr/share/qt4/mkspecs/features/exclusive_builds.prf: -/usr/share/qt4/mkspecs/features/default_pre.prf: -/usr/share/qt4/mkspecs/features/debug.prf: -/usr/share/qt4/mkspecs/features/default_post.prf: -/usr/share/qt4/mkspecs/features/warn_on.prf: -/usr/share/qt4/mkspecs/features/qt.prf: -/usr/share/qt4/mkspecs/features/unix/thread.prf: -/usr/share/qt4/mkspecs/features/moc.prf: -/usr/share/qt4/mkspecs/features/resources.prf: -/usr/share/qt4/mkspecs/features/uic.prf: -/usr/share/qt4/mkspecs/features/yacc.prf: -/usr/share/qt4/mkspecs/features/lex.prf: -/usr/share/qt4/mkspecs/features/include_source_dir.prf: -/usr/lib/libQtGui.prl: -/usr/lib/libQtCore.prl: -qmake: FORCE - @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile pr2.pro - -dist: - @$(CHK_DIR_EXISTS) .tmp/pr21.0.0 || $(MKDIR) .tmp/pr21.0.0 - $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/pr21.0.0/ && $(COPY_FILE) --parents mainwindow.h shape.h circle.h square.h numberbox.h .tmp/pr21.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp shape.cpp circle.cpp square.cpp numberbox.cpp .tmp/pr21.0.0/ && $(COPY_FILE) --parents mainwindow.ui .tmp/pr21.0.0/ && (cd `dirname .tmp/pr21.0.0` && $(TAR) pr21.0.0.tar pr21.0.0 && $(COMPRESS) pr21.0.0.tar) && $(MOVE) `dirname .tmp/pr21.0.0`/pr21.0.0.tar.gz . && $(DEL_FILE) -r .tmp/pr21.0.0 - - -clean:compiler_clean - -$(DEL_FILE) $(OBJECTS) - -$(DEL_FILE) *~ core *.core - - -####### Sub-libraries - -distclean: clean - -$(DEL_FILE) $(TARGET) - -$(DEL_FILE) Makefile - - -mocclean: compiler_moc_header_clean compiler_moc_source_clean - -mocables: compiler_moc_header_make_all compiler_moc_source_make_all - -compiler_moc_header_make_all: moc_mainwindow.cpp moc_numberbox.cpp -compiler_moc_header_clean: - -$(DEL_FILE) moc_mainwindow.cpp moc_numberbox.cpp -moc_mainwindow.cpp: mainwindow.h - /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp - -moc_numberbox.cpp: numberbox.h - /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) numberbox.h -o moc_numberbox.cpp - -compiler_rcc_make_all: -compiler_rcc_clean: -compiler_image_collection_make_all: qmake_image_collection.cpp -compiler_image_collection_clean: - -$(DEL_FILE) qmake_image_collection.cpp -compiler_moc_source_make_all: -compiler_moc_source_clean: -compiler_uic_make_all: ui_mainwindow.h -compiler_uic_clean: - -$(DEL_FILE) ui_mainwindow.h -ui_mainwindow.h: mainwindow.ui - /usr/bin/uic-qt4 mainwindow.ui -o ui_mainwindow.h - -compiler_yacc_decl_make_all: -compiler_yacc_decl_clean: -compiler_yacc_impl_make_all: -compiler_yacc_impl_clean: -compiler_lex_make_all: -compiler_lex_clean: -compiler_clean: compiler_moc_header_clean compiler_uic_clean - -####### Compile - -main.o: main.cpp mainwindow.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp - -mainwindow.o: mainwindow.cpp mainwindow.h \ - ui_mainwindow.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp - -shape.o: shape.cpp shape.h \ - mainwindow.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o shape.o shape.cpp - -circle.o: circle.cpp circle.h \ - mainwindow.h \ - shape.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o circle.o circle.cpp - -square.o: square.cpp square.h \ - shape.h \ - mainwindow.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o square.o square.cpp - -numberbox.o: numberbox.cpp numberbox.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o numberbox.o numberbox.cpp - -moc_mainwindow.o: moc_mainwindow.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp - -moc_numberbox.o: moc_numberbox.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_numberbox.o moc_numberbox.cpp - -####### Install - -install: FORCE - -uninstall: FORCE - -FORCE: - diff --git a/Viewer/pr2/circle.cpp b/Viewer/pr2/circle.cpp deleted file mode 100644 index f8653ca..0000000 --- a/Viewer/pr2/circle.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "circle.h" -#include -#include "mainwindow.h" - -Circle::Circle() -{ -} - -Circle::Circle(int initUID, int initX, int initY, int initR, QColor initColour): - Shape(initUID, initX, initY, initColour), r(initR) -{ - //r = initR; -} - -void Circle::setR(int newR) -{ - r = newR; -} - -void Circle::show(QPainter *painter) // TODO: a parameter indicating where to draw should be passed here -{ - Shape::show(); - QPen pen(colour); - painter->setPen(pen); - painter->drawEllipse(x, y, r*2, r*2); - //QPainter painter(window) - //window-> - -} - -void Circle::hide() -{ - Shape::hide(); - -} diff --git a/Viewer/pr2/circle.h b/Viewer/pr2/circle.h deleted file mode 100644 index 3ff0e49..0000000 --- a/Viewer/pr2/circle.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef CIRCLE_H -#define CIRCLE_H -#include -#include -//#include "mainwindow.h" -#include "shape.h" - -class Circle : public Shape -{ - int r; -public: - Circle(); - Circle(int initUID, int initX, int initY, int initR, QColor initColour=0); - ~Circle(); - void show(QPainter *p1); - void hide(); - void setR(int newR); - void refresh(){} -}; - -#endif // CIRCLE_H diff --git a/Viewer/pr2/circle.o b/Viewer/pr2/circle.o deleted file mode 100644 index 294579d..0000000 Binary files a/Viewer/pr2/circle.o and /dev/null differ diff --git a/Viewer/pr2/main.cpp b/Viewer/pr2/main.cpp deleted file mode 100644 index 9ae175b..0000000 --- a/Viewer/pr2/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - MainWindow w; - w.show(); - - return a.exec(); -} diff --git a/Viewer/pr2/main.o b/Viewer/pr2/main.o deleted file mode 100644 index 7b40a6d..0000000 Binary files a/Viewer/pr2/main.o and /dev/null differ diff --git a/Viewer/pr2/mainwindow.cpp b/Viewer/pr2/mainwindow.cpp deleted file mode 100644 index 33f8959..0000000 --- a/Viewer/pr2/mainwindow.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "mainwindow.h" -#include "ui_mainwindow.h" -#include -#include -#include "circle.h" -#include "square.h" - -#define rnd(a, b) (a)+random()%((b)-(a)) - -MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::MainWindow) -{ - ui->setupUi(this); - - // Здесь, в конструкторе ОКНА, создаём массив окружностей - QColor c1; - nCircles = 0; - while (nCircles<24) - { - c1.setRgb(rnd(100, 200), rnd(150, 250), rnd(120, 160)); - nCircles++; - circles[nCircles-1] = new Circle(nCircles*2, rnd(20, 200), rnd(30, 120), rnd(20, 30), c1); - } - //QColor::setRgb() - -} - -MainWindow::~MainWindow() -{ - delete ui; -} - -void MainWindow::paintEvent(QPaintEvent *) -{ - QPainter p1(this); - //p1.drawEllipse(40, 40, 10, 5); - - int i; - - // При каждой перерисовке выводим массив окружностей на экран - for (i = 0; i< nCircles; i++) - circles[i]->show(&p1); -} - -void MainWindow::on_pushButton_clicked() -{ - QPainter p1(this); - p1.drawEllipse(40, 40, 10, 5); - QGraphicsScene *gs1 = new QGraphicsScene(); -} diff --git a/Viewer/pr2/mainwindow.h b/Viewer/pr2/mainwindow.h deleted file mode 100644 index 6d9142c..0000000 --- a/Viewer/pr2/mainwindow.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include "circle.h" -#include "square.h" -//#include "shape.h" - -namespace Ui { - class MainWindow; -} - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - - void paintEvent(QPaintEvent *); - -private: - Ui::MainWindow *ui; - // Массивы окружностей и квадратов - Circle *circles[50]; - int nCircles; - Square *squares[50]; - int nSquares; - -private slots: - void on_pushButton_clicked(); -}; - -#endif // MAINWINDOW_H diff --git a/Viewer/pr2/mainwindow.o b/Viewer/pr2/mainwindow.o deleted file mode 100644 index 9d97164..0000000 Binary files a/Viewer/pr2/mainwindow.o and /dev/null differ diff --git a/Viewer/pr2/mainwindow.ui b/Viewer/pr2/mainwindow.ui deleted file mode 100644 index 6f10840..0000000 --- a/Viewer/pr2/mainwindow.ui +++ /dev/null @@ -1,74 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 400 - 300 - - - - MainWindow - - - - - - 280 - 130 - 31 - 31 - - - - - - - 240 - 180 - 93 - 27 - - - - PushButton - - - - - - 110 - 170 - 71 - 41 - - - - - - - - 0 - 0 - 400 - 23 - - - - - - TopToolBarArea - - - false - - - - - - - - diff --git a/Viewer/pr2/moc_mainwindow.cpp b/Viewer/pr2/moc_mainwindow.cpp deleted file mode 100644 index d26b66e..0000000 --- a/Viewer/pr2/moc_mainwindow.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'mainwindow.h' -** -** Created: Mon Dec 5 20:39:01 2011 -** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "mainwindow.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'mainwindow.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.6.2. 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 -static const uint qt_meta_data_MainWindow[] = { - - // content: - 4, // revision - 0, // classname - 0, 0, // classinfo - 1, 14, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount - - // slots: signature, parameters, type, tag, flags - 12, 11, 11, 11, 0x08, - - 0 // eod -}; - -static const char qt_meta_stringdata_MainWindow[] = { - "MainWindow\0\0on_pushButton_clicked()\0" -}; - -const QMetaObject MainWindow::staticMetaObject = { - { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow, - qt_meta_data_MainWindow, 0 } -}; - -#ifdef Q_NO_DATA_RELOCATION -const QMetaObject &MainWindow::getStaticMetaObject() { return staticMetaObject; } -#endif //Q_NO_DATA_RELOCATION - -const QMetaObject *MainWindow::metaObject() const -{ - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; -} - -void *MainWindow::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_MainWindow)) - return static_cast(const_cast< MainWindow*>(this)); - return QMainWindow::qt_metacast(_clname); -} - -int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QMainWindow::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - if (_c == QMetaObject::InvokeMetaMethod) { - switch (_id) { - case 0: on_pushButton_clicked(); break; - default: ; - } - _id -= 1; - } - return _id; -} -QT_END_MOC_NAMESPACE diff --git a/Viewer/pr2/moc_mainwindow.o b/Viewer/pr2/moc_mainwindow.o deleted file mode 100644 index dbb76d8..0000000 Binary files a/Viewer/pr2/moc_mainwindow.o and /dev/null differ diff --git a/Viewer/pr2/moc_numberbox.cpp b/Viewer/pr2/moc_numberbox.cpp deleted file mode 100644 index 19a2ae6..0000000 --- a/Viewer/pr2/moc_numberbox.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'numberbox.h' -** -** Created: Mon Dec 5 18:57:39 2011 -** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "numberbox.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'numberbox.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.6.2. 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 -static const uint qt_meta_data_NumberBox[] = { - - // content: - 4, // revision - 0, // classname - 0, 0, // classinfo - 0, 0, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount - - 0 // eod -}; - -static const char qt_meta_stringdata_NumberBox[] = { - "NumberBox\0" -}; - -const QMetaObject NumberBox::staticMetaObject = { - { &QPlainTextEdit::staticMetaObject, qt_meta_stringdata_NumberBox, - qt_meta_data_NumberBox, 0 } -}; - -#ifdef Q_NO_DATA_RELOCATION -const QMetaObject &NumberBox::getStaticMetaObject() { return staticMetaObject; } -#endif //Q_NO_DATA_RELOCATION - -const QMetaObject *NumberBox::metaObject() const -{ - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; -} - -void *NumberBox::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_NumberBox)) - return static_cast(const_cast< NumberBox*>(this)); - return QPlainTextEdit::qt_metacast(_clname); -} - -int NumberBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QPlainTextEdit::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - return _id; -} -QT_END_MOC_NAMESPACE diff --git a/Viewer/pr2/moc_numberbox.o b/Viewer/pr2/moc_numberbox.o deleted file mode 100644 index 695b798..0000000 Binary files a/Viewer/pr2/moc_numberbox.o and /dev/null differ diff --git a/Viewer/pr2/numberbox.cpp b/Viewer/pr2/numberbox.cpp deleted file mode 100644 index 5a996eb..0000000 --- a/Viewer/pr2/numberbox.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "numberbox.h" - -NumberBox::NumberBox(QWidget *parent) : - QPlainTextEdit(parent) -{ - -} diff --git a/Viewer/pr2/numberbox.h b/Viewer/pr2/numberbox.h deleted file mode 100644 index bbfd842..0000000 --- a/Viewer/pr2/numberbox.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef NUMBERBOX_H -#define NUMBERBOX_H - -#include - -class NumberBox : public QPlainTextEdit -{ -Q_OBJECT -public: - explicit NumberBox(QWidget *parent = 0); - -signals: - -public slots: - -}; - -#endif // NUMBERBOX_H diff --git a/Viewer/pr2/numberbox.o b/Viewer/pr2/numberbox.o deleted file mode 100644 index c6cb6ca..0000000 Binary files a/Viewer/pr2/numberbox.o and /dev/null differ diff --git a/Viewer/pr2/pr2 b/Viewer/pr2/pr2 deleted file mode 100755 index 2a9d381..0000000 Binary files a/Viewer/pr2/pr2 and /dev/null differ diff --git a/Viewer/pr2/pr2.pro b/Viewer/pr2/pr2.pro deleted file mode 100644 index 8c5d1d2..0000000 --- a/Viewer/pr2/pr2.pro +++ /dev/null @@ -1,19 +0,0 @@ -# ------------------------------------------------- -# Project created by QtCreator 2011-12-02T15:24:41 -# ------------------------------------------------- -QT += core \ - gui -TARGET = pr2 -TEMPLATE = app -SOURCES += main.cpp \ - mainwindow.cpp \ - shape.cpp \ - circle.cpp \ - square.cpp \ - numberbox.cpp -HEADERS += mainwindow.h \ - shape.h \ - circle.h \ - square.h \ - numberbox.h -FORMS += mainwindow.ui diff --git a/Viewer/pr2/pr2.pro.user b/Viewer/pr2/pr2.pro.user deleted file mode 100644 index e2ca751..0000000 --- a/Viewer/pr2/pr2.pro.user +++ /dev/null @@ -1,245 +0,0 @@ - - - - RunConfiguration0-BaseEnvironmentBase - 2 - - - RunConfiguration0-CommandLineArguments - - - - RunConfiguration0-ProFile - pr2.pro - - - RunConfiguration0-RunConfiguration.name - pr2 - - - RunConfiguration0-UseDyldImageSuffix - false - - - RunConfiguration0-UseTerminal - false - - - RunConfiguration0-UserEnvironmentChanges - - - - RunConfiguration0-UserSetName - false - - - RunConfiguration0-UserSetWorkingDirectory - false - - - RunConfiguration0-UserWorkingDirectory - - - - RunConfiguration0-type - Qt4ProjectManager.Qt4RunConfiguration - - - activeRunConfiguration - 0 - - - activebuildconfiguration - Debug - - - buildConfiguration-Debug - - Debug - 0 - 0 - - 2 - - - - buildConfiguration-Release - - Release - 0 - - 0 - - - - buildconfiguration-Debug-buildstep0 - - Debug - - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-UUss8td4U1,guid=64d9097067de8313a93a92184eedb95e - DEFAULTS_PATH=/usr/share/gconf/gnome.default.path - DESKTOP_SESSION=gnome - DISPLAY=:0.0 - GDMSESSION=gnome - GDM_KEYBOARD_LAYOUT=us - GDM_LANG=ru_RU.utf8 - GNOME_DESKTOP_SESSION_ID=this-is-deprecated - GNOME_KEYRING_CONTROL=/tmp/keyring-onCrxt - GNOME_KEYRING_PID=1140 - GTK_MODULES=canberra-gtk-module - HOME=/home/owner - LANG=ru_RU.utf8 - LD_LIBRARY_PATH=/usr/lib/qtcreator - LOGNAME=owner - MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path - ORBIT_SOCKETDIR=/tmp/orbit-owner - PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games - PWD=/home/owner - QTDIR=/usr/share/qt4 - SESSION_MANAGER=local/owner-desktop:@/tmp/.ICE-unix/1158,unix/owner-desktop:/tmp/.ICE-unix/1158 - SHELL=/bin/bash - SPEECHD_PORT=7560 - SSH_AGENT_PID=1222 - SSH_AUTH_SOCK=/tmp/keyring-onCrxt/ssh - USER=owner - USERNAME=owner - XAUTHORITY=/var/run/gdm/auth-for-owner-gXZp8X/database - XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg - XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/ - XDG_SESSION_COOKIE=e25a00838b58c329d213bac84ed0f185-1324202334.379420-1503744629 - - - /home/owner/Рабочий стол/QT Projects/ТРПО/pr2bak/pr2.pro - -spec - linux-g++ - -r - CONFIG+=debug - - /usr/bin/qmake-qt4 - false - /home/owner/Рабочий стол/QT Projects/ТРПО/pr2bak - - - - buildconfiguration-Debug-buildstep1 - - Debug - - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-UUss8td4U1,guid=64d9097067de8313a93a92184eedb95e - DEFAULTS_PATH=/usr/share/gconf/gnome.default.path - DESKTOP_SESSION=gnome - DISPLAY=:0.0 - GDMSESSION=gnome - GDM_KEYBOARD_LAYOUT=us - GDM_LANG=ru_RU.utf8 - GNOME_DESKTOP_SESSION_ID=this-is-deprecated - GNOME_KEYRING_CONTROL=/tmp/keyring-onCrxt - GNOME_KEYRING_PID=1140 - GTK_MODULES=canberra-gtk-module - HOME=/home/owner - LANG=ru_RU.utf8 - LD_LIBRARY_PATH=/usr/lib/qtcreator - LOGNAME=owner - MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path - ORBIT_SOCKETDIR=/tmp/orbit-owner - PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games - PWD=/home/owner - QTDIR=/usr/share/qt4 - SESSION_MANAGER=local/owner-desktop:@/tmp/.ICE-unix/1158,unix/owner-desktop:/tmp/.ICE-unix/1158 - SHELL=/bin/bash - SPEECHD_PORT=7560 - SSH_AGENT_PID=1222 - SSH_AUTH_SOCK=/tmp/keyring-onCrxt/ssh - USER=owner - USERNAME=owner - XAUTHORITY=/var/run/gdm/auth-for-owner-gXZp8X/database - XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg - XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/ - XDG_SESSION_COOKIE=e25a00838b58c329d213bac84ed0f185-1324202334.379420-1503744629 - - false - - -w - - /usr/bin/make - true - /home/owner/Рабочий стол/QT Projects/ТРПО/pr2bak - - - - buildconfiguration-Debug-cleanstep0 - - Debug - true - - clean - - - - - buildconfiguration-Release-buildstep0 - - Release - - - - buildconfiguration-Release-buildstep1 - - Release - - - - buildconfiguration-Release-cleanstep0 - - Release - - - - buildconfigurations - - Debug - Release - - - - buildstep0 - - - - - - - buildstep1 - - - - - - buildsteps - - trolltech.qt4projectmanager.qmake - trolltech.qt4projectmanager.make - - - - cleanstep0 - - - true - - - - cleansteps - - trolltech.qt4projectmanager.make - - - - defaultFileEncoding - System - - - project - - - diff --git a/Viewer/pr2/shape.h b/Viewer/pr2/shape.h deleted file mode 100644 index 4162db3..0000000 --- a/Viewer/pr2/shape.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef SHAPE_H -#define SHAPE_H -#include -//#include "mainwindow.h" -#include - -class Shape -{ -// int a; -protected: - bool isVisible; - int uid; - int x, y; - QColor colour; - -public: - Shape(); - Shape(int initUID, int initX, int initY, QColor initColour=0); - ~Shape(); - virtual void show(); - virtual void refresh()=0; - virtual void hide(); - virtual void move(int newX, int newY); - //virtual void change(int newA, QColor newColour); - virtual void setColour(QColor newColour); - virtual void setUID(int newUID); - // Universal accessors - virtual int getX(); - virtual int getY(); - virtual bool checkIsVisible(); -// virtual void setA - -}; - -#endif // SHAPE_H diff --git a/Viewer/pr2/shape.o b/Viewer/pr2/shape.o deleted file mode 100644 index 8de386c..0000000 Binary files a/Viewer/pr2/shape.o and /dev/null differ diff --git a/Viewer/pr2/square.cpp b/Viewer/pr2/square.cpp deleted file mode 100644 index 625793d..0000000 --- a/Viewer/pr2/square.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "square.h" - -Square::Square() -{ -} - -Square::Square(int initUID, int initX, int initY, int initA, QColor initColour): - Shape(initUID, initX, initY, initColour), a(initA) -{ - -} - -void Square::setA(int newA) -{ - a = newA; -} - -void Square::show(QPainter *painter) -{ - Shape::show(); - QPen pen(colour); - painter->setPen(pen); - painter->drawRect(x, y, a, a); - //QPainter painter(this); - -} - -void Square::hide() -{ - Shape::hide(); - -} diff --git a/Viewer/pr2/square.h b/Viewer/pr2/square.h deleted file mode 100644 index a997db9..0000000 --- a/Viewer/pr2/square.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef SQUARE_H -#define SQUARE_H -#include "shape.h" -#include - -class Square : public Shape -{ - int a; -public: - Square(); - Square(int initUID, int initX, int initY, int initA, QColor initColour=0); - ~Square(); - void show(QPainter *p); - void hide(); - void setA(int newA); - void refresh(){} -}; - -#endif // SQUARE_H diff --git a/Viewer/pr2/square.o b/Viewer/pr2/square.o deleted file mode 100644 index 7569087..0000000 Binary files a/Viewer/pr2/square.o and /dev/null differ diff --git a/Viewer/pr2/ui_mainwindow.h b/Viewer/pr2/ui_mainwindow.h deleted file mode 100644 index 7f89384..0000000 --- a/Viewer/pr2/ui_mainwindow.h +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'mainwindow.ui' -** -** Created: Mon Dec 5 19:36:19 2011 -** by: Qt User Interface Compiler version 4.6.2 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_MAINWINDOW_H -#define UI_MAINWINDOW_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_MainWindow -{ -public: - QWidget *centralWidget; - QPlainTextEdit *plainTextEdit; - QPushButton *pushButton; - QGraphicsView *graphicsView; - QMenuBar *menuBar; - QToolBar *mainToolBar; - QStatusBar *statusBar; - - void setupUi(QMainWindow *MainWindow) - { - if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); - MainWindow->resize(400, 300); - centralWidget = new QWidget(MainWindow); - centralWidget->setObjectName(QString::fromUtf8("centralWidget")); - plainTextEdit = new QPlainTextEdit(centralWidget); - plainTextEdit->setObjectName(QString::fromUtf8("plainTextEdit")); - plainTextEdit->setGeometry(QRect(280, 130, 31, 31)); - pushButton = new QPushButton(centralWidget); - pushButton->setObjectName(QString::fromUtf8("pushButton")); - pushButton->setGeometry(QRect(240, 180, 93, 27)); - graphicsView = new QGraphicsView(centralWidget); - graphicsView->setObjectName(QString::fromUtf8("graphicsView")); - graphicsView->setGeometry(QRect(110, 170, 71, 41)); - MainWindow->setCentralWidget(centralWidget); - menuBar = new QMenuBar(MainWindow); - menuBar->setObjectName(QString::fromUtf8("menuBar")); - menuBar->setGeometry(QRect(0, 0, 400, 23)); - MainWindow->setMenuBar(menuBar); - mainToolBar = new QToolBar(MainWindow); - mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); - MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar); - statusBar = new QStatusBar(MainWindow); - statusBar->setObjectName(QString::fromUtf8("statusBar")); - MainWindow->setStatusBar(statusBar); - - retranslateUi(MainWindow); - - QMetaObject::connectSlotsByName(MainWindow); - } // setupUi - - void retranslateUi(QMainWindow *MainWindow) - { - MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8)); - pushButton->setText(QApplication::translate("MainWindow", "PushButton", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - -}; - -namespace Ui { - class MainWindow: public Ui_MainWindow {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_MAINWINDOW_H diff --git a/Viewer/res/circle.cpp b/Viewer/res/circle.cpp deleted file mode 100644 index 8882be9..0000000 --- a/Viewer/res/circle.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "include/circle.h" -#include -#include "include/mainwindow.h" - -Circle::Circle() -{ -} - -Circle::Circle(int initUID, int initX, int initY, int initR, QColor initColour): - Shape(initUID, initX, initY, initColour), r(initR) -{ - //r = initR; -} - -void Circle::setR(int newR) -{ - r = newR; -} - -void Circle::show(QPainter *painter) // TODO: a parameter indicating where to draw should be passed here -{ - Shape::show(); - QPen pen(colour); - painter->setPen(pen); - painter->drawEllipse(x, y, r*2, r*2); - //QPainter painter(window) - //window-> - -} - -void Circle::hide() -{ - Shape::hide(); - -} diff --git a/Viewer/res/include/circle.h b/Viewer/res/include/circle.h deleted file mode 100644 index 3ff0e49..0000000 --- a/Viewer/res/include/circle.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef CIRCLE_H -#define CIRCLE_H -#include -#include -//#include "mainwindow.h" -#include "shape.h" - -class Circle : public Shape -{ - int r; -public: - Circle(); - Circle(int initUID, int initX, int initY, int initR, QColor initColour=0); - ~Circle(); - void show(QPainter *p1); - void hide(); - void setR(int newR); - void refresh(){} -}; - -#endif // CIRCLE_H diff --git a/Viewer/res/include/mainwindow.h b/Viewer/res/include/mainwindow.h deleted file mode 100644 index 5976dc9..0000000 --- a/Viewer/res/include/mainwindow.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include "circle.h" -#include "square.h" -//#include "shape.h" - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - - void paintEvent(QPaintEvent *); - -private: - // Массивы окружностей и квадратов - Circle *circles[50]; - int nCircles; - Square *squares[50]; - int nSquares; - -private slots: - void on_pushButton_clicked(); -}; - -#endif // MAINWINDOW_H diff --git a/Viewer/res/include/square.h b/Viewer/res/include/square.h deleted file mode 100644 index a997db9..0000000 --- a/Viewer/res/include/square.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef SQUARE_H -#define SQUARE_H -#include "shape.h" -#include - -class Square : public Shape -{ - int a; -public: - Square(); - Square(int initUID, int initX, int initY, int initA, QColor initColour=0); - ~Square(); - void show(QPainter *p); - void hide(); - void setA(int newA); - void refresh(){} -}; - -#endif // SQUARE_H diff --git a/Viewer/res/main.cpp b/Viewer/res/main.cpp deleted file mode 100644 index 005dec6..0000000 --- a/Viewer/res/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "include/mainwindow.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - MainWindow w; - w.show(); - - return a.exec(); -} diff --git a/Viewer/res/mainwindow.cpp b/Viewer/res/mainwindow.cpp deleted file mode 100644 index 8e52d1d..0000000 --- a/Viewer/res/mainwindow.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "include/mainwindow.h" -#include "ui_mainwindow.h" -#include -#include -#include "include/circle.h" -#include "include/square.h" -#include "include/numberbox.h" - -#define rnd(a, b) (a)+random()%((b)-(a)) - -MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent) -{ - NumberBox *l=new NumberBox(this); - l->show(); - l->move(230,150); - resize(400,200); - // Здесь, в конструкторе ОКНА, создаём массив окружностей - QColor c1; - nCircles = 0; - while (nCircles<24) - { - c1.setRgb(rnd(100, 200), rnd(150, 250), rnd(120, 160)); - nCircles++; - circles[nCircles-1] = new Circle(nCircles*2, rnd(20, 200), rnd(30, 120), rnd(20, 30), c1); - } - //QColor::setRgb() - -} - -MainWindow::~MainWindow() -{ -} - -void MainWindow::paintEvent(QPaintEvent *) -{ - QPainter p1(this); - //p1.drawEllipse(40, 40, 10, 5); - - int i; - - // При каждой перерисовке выводим массив окружностей на экран - for (i = 0; i< nCircles; i++) - circles[i]->show(&p1); -} - -void MainWindow::on_pushButton_clicked() -{ - QPainter p1(this); - p1.drawEllipse(40, 40, 10, 5); - QGraphicsScene *gs1 = new QGraphicsScene(); -} diff --git a/Viewer/res/mainwindow.ui b/Viewer/res/mainwindow.ui deleted file mode 100644 index 86d702e..0000000 --- a/Viewer/res/mainwindow.ui +++ /dev/null @@ -1,64 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 400 - 300 - - - - MainWindow - - - - - - 280 - 200 - 93 - 27 - - - - PushButton - - - - - - 280 - 160 - 91 - 31 - - - - - - - - 0 - 0 - 400 - 25 - - - - - - TopToolBarArea - - - false - - - - - - - - diff --git a/Viewer/res/moc_mainwindow.cpp b/Viewer/res/moc_mainwindow.cpp deleted file mode 100644 index 28885c5..0000000 --- a/Viewer/res/moc_mainwindow.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'mainwindow.h' -** -** Created: Sun Dec 18 21:51:03 2011 -** by: The Qt Meta Object Compiler version 62 (Qt 4.7.2) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "include/mainwindow.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'mainwindow.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.7.2. 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 -static const uint qt_meta_data_MainWindow[] = { - - // content: - 5, // revision - 0, // classname - 0, 0, // classinfo - 1, 14, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount - - // slots: signature, parameters, type, tag, flags - 12, 11, 11, 11, 0x08, - - 0 // eod -}; - -static const char qt_meta_stringdata_MainWindow[] = { - "MainWindow\0\0on_pushButton_clicked()\0" -}; - -const QMetaObject MainWindow::staticMetaObject = { - { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow, - qt_meta_data_MainWindow, 0 } -}; - -#ifdef Q_NO_DATA_RELOCATION -const QMetaObject &MainWindow::getStaticMetaObject() { return staticMetaObject; } -#endif //Q_NO_DATA_RELOCATION - -const QMetaObject *MainWindow::metaObject() const -{ - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; -} - -void *MainWindow::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_MainWindow)) - return static_cast(const_cast< MainWindow*>(this)); - return QMainWindow::qt_metacast(_clname); -} - -int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QMainWindow::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - if (_c == QMetaObject::InvokeMetaMethod) { - switch (_id) { - case 0: on_pushButton_clicked(); break; - default: ; - } - _id -= 1; - } - return _id; -} -QT_END_MOC_NAMESPACE diff --git a/Viewer/res/moc_mainwindow.o b/Viewer/res/moc_mainwindow.o deleted file mode 100644 index ece963d..0000000 Binary files a/Viewer/res/moc_mainwindow.o and /dev/null differ diff --git a/Viewer/res/moc_numberbox.cpp b/Viewer/res/moc_numberbox.cpp deleted file mode 100644 index 553f6c4..0000000 --- a/Viewer/res/moc_numberbox.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'numberbox.h' -** -** Created: Sun Dec 18 21:47:54 2011 -** by: The Qt Meta Object Compiler version 62 (Qt 4.7.2) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "include/numberbox.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'numberbox.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.7.2. 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 -static const uint qt_meta_data_NumberBox[] = { - - // content: - 5, // revision - 0, // classname - 0, 0, // classinfo - 0, 0, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount - - 0 // eod -}; - -static const char qt_meta_stringdata_NumberBox[] = { - "NumberBox\0" -}; - -const QMetaObject NumberBox::staticMetaObject = { - { &QLineEdit::staticMetaObject, qt_meta_stringdata_NumberBox, - qt_meta_data_NumberBox, 0 } -}; - -#ifdef Q_NO_DATA_RELOCATION -const QMetaObject &NumberBox::getStaticMetaObject() { return staticMetaObject; } -#endif //Q_NO_DATA_RELOCATION - -const QMetaObject *NumberBox::metaObject() const -{ - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; -} - -void *NumberBox::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_NumberBox)) - return static_cast(const_cast< NumberBox*>(this)); - return QLineEdit::qt_metacast(_clname); -} - -int NumberBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QLineEdit::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - return _id; -} -QT_END_MOC_NAMESPACE diff --git a/Viewer/res/moc_numberbox.o b/Viewer/res/moc_numberbox.o deleted file mode 100644 index a85d79b..0000000 Binary files a/Viewer/res/moc_numberbox.o and /dev/null differ diff --git a/Viewer/res/pr2 b/Viewer/res/pr2 deleted file mode 100755 index c722313..0000000 Binary files a/Viewer/res/pr2 and /dev/null differ diff --git a/Viewer/res/pr2.pro b/Viewer/res/pr2.pro deleted file mode 100644 index 6559fc8..0000000 --- a/Viewer/res/pr2.pro +++ /dev/null @@ -1,24 +0,0 @@ -# ------------------------------------------------- -# Project created by QtCreator 2011-12-02T15:24:41 -# ------------------------------------------------- -QT += core \ - gui -TARGET = pr2 -TEMPLATE = app -SOURCES += main.cpp \ - mainwindow.cpp \ - shape.cpp \ - circle.cpp \ - square.cpp \ - numberbox.cpp -HEADERS += mainwindow.h \ - shape.h \ - circle.h \ - square.h \ - numberbox.h \ - include/mainwindow.h \ - include/numberbox.h \ - include/shape.h \ - include/circle.h \ - include/square.h -FORMS += mainwindow.ui diff --git a/Viewer/res/pr2.pro.user b/Viewer/res/pr2.pro.user deleted file mode 100644 index a5ea639..0000000 --- a/Viewer/res/pr2.pro.user +++ /dev/null @@ -1,273 +0,0 @@ - - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - Default - - - - ProjectExplorer.Project.Target.0 - - Настольный компьютер - - Qt4ProjectManager.Target.DesktopTarget - 0 - 0 - 0 - - - - qmake - - QtProjectManager.QMakeBuildStep - - QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger - QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger - - false - - - Сборка - - Qt4ProjectManager.MakeStep - false - - - - 2 - Сборка - - ProjectExplorer.BuildSteps.Build - - - - Сборка - - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - Очистка - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Qt в PATH Отладка - - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /home/valeriya/MAI_SCADA/Viewer/res - 2 - 0 - false - - - - - qmake - - QtProjectManager.QMakeBuildStep - - QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger - QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger - - false - - - Сборка - - Qt4ProjectManager.MakeStep - false - - - - 2 - Сборка - - ProjectExplorer.BuildSteps.Build - - - - Сборка - - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - Очистка - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Qt в PATH Релиз - - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /home/valeriya/MAI_SCADA/Viewer/res - 2 - 0 - false - - - - - qmake - - QtProjectManager.QMakeBuildStep - - false - - - Сборка - - Qt4ProjectManager.MakeStep - false - - - - 2 - Сборка - - ProjectExplorer.BuildSteps.Build - - - - Сборка - - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - Очистка - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - 4.7.2 Релиз - - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /home/valeriya/MAI_SCADA/Viewer/pr2-build-desktop - 4 - 0 - true - - - - - qmake - - QtProjectManager.QMakeBuildStep - - false - - - Сборка - - Qt4ProjectManager.MakeStep - false - - - - 2 - Сборка - - ProjectExplorer.BuildSteps.Build - - - - Сборка - - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - Очистка - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - 4.7.2 Отладка - - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /home/valeriya/MAI_SCADA/Viewer/pr2-build-desktop - 4 - 0 - true - - 4 - - - 0 - Установка - - ProjectExplorer.BuildSteps.Deploy - - 1 - Без установки - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - pr2 - - Qt4ProjectManager.Qt4RunConfiguration - 2 - - pr2.pro - false - false - - false - - 3768 - true - false - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.EnvironmentId - {b1f6268d-4849-4366-84a4-1a7dbc4e4f25} - - - ProjectExplorer.Project.Updater.FileVersion - 8 - - diff --git a/Viewer/res/shape.cpp b/Viewer/res/shape.cpp deleted file mode 100644 index aa14c67..0000000 --- a/Viewer/res/shape.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "include/shape.h" - -Shape::Shape() -{ -} - -Shape::Shape(int initUID, int initX, int initY, QColor initColour) -{ - uid = initUID; - x = initX; - y = initY; - colour = initColour; -} - -void Shape::move(int newX, int newY) -{ - x = newX; - y = newY; -} - -void Shape::hide() -{ - isVisible = false; -} - -void Shape::show() -{ - - isVisible = true; -} - -void Shape::setColour(QColor newColour) -{ - colour = newColour; -} - -void Shape::setUID(int newUID) -{ - uid = newUID; -} - -int Shape::getX() -{ - return x; -} - -int Shape::getY() -{ - return y; -} - -bool Shape::checkIsVisible() -{ - return isVisible; -} diff --git a/Viewer/res/square.cpp b/Viewer/res/square.cpp deleted file mode 100644 index 4ff3e94..0000000 --- a/Viewer/res/square.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "include/square.h" - -Square::Square() -{ -} - -Square::Square(int initUID, int initX, int initY, int initA, QColor initColour): - Shape(initUID, initX, initY, initColour), a(initA) -{ - -} - -void Square::setA(int newA) -{ - a = newA; -} - -void Square::show(QPainter *painter) -{ - Shape::show(); - QPen pen(colour); - painter->setPen(pen); - painter->drawRect(x, y, a, a); - //QPainter painter(this); - -} - -void Square::hide() -{ - Shape::hide(); - -} diff --git a/Viewer/res/ui_mainwindow.h b/Viewer/res/ui_mainwindow.h deleted file mode 100644 index 6a08741..0000000 --- a/Viewer/res/ui_mainwindow.h +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'mainwindow.ui' -** -** Created: Sun Dec 18 21:47:40 2011 -** by: Qt User Interface Compiler version 4.7.2 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_MAINWINDOW_H -#define UI_MAINWINDOW_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_MainWindow -{ -public: - QWidget *centralWidget; - QPushButton *pushButton; - QLineEdit *lineEdit; - QMenuBar *menuBar; - QToolBar *mainToolBar; - QStatusBar *statusBar; - - void setupUi(QMainWindow *MainWindow) - { - if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); - MainWindow->resize(400, 300); - centralWidget = new QWidget(MainWindow); - centralWidget->setObjectName(QString::fromUtf8("centralWidget")); - pushButton = new QPushButton(centralWidget); - pushButton->setObjectName(QString::fromUtf8("pushButton")); - pushButton->setGeometry(QRect(280, 200, 93, 27)); - lineEdit = new QLineEdit(centralWidget); - lineEdit->setObjectName(QString::fromUtf8("lineEdit")); - lineEdit->setGeometry(QRect(280, 160, 91, 31)); - MainWindow->setCentralWidget(centralWidget); - menuBar = new QMenuBar(MainWindow); - menuBar->setObjectName(QString::fromUtf8("menuBar")); - menuBar->setGeometry(QRect(0, 0, 400, 25)); - MainWindow->setMenuBar(menuBar); - mainToolBar = new QToolBar(MainWindow); - mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); - MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar); - statusBar = new QStatusBar(MainWindow); - statusBar->setObjectName(QString::fromUtf8("statusBar")); - MainWindow->setStatusBar(statusBar); - - retranslateUi(MainWindow); - - QMetaObject::connectSlotsByName(MainWindow); - } // setupUi - - void retranslateUi(QMainWindow *MainWindow) - { - MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8)); - pushButton->setText(QApplication::translate("MainWindow", "PushButton", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - -}; - -namespace Ui { - class MainWindow: public Ui_MainWindow {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_MAINWINDOW_H diff --git a/Viewer/src/Button.cpp b/Viewer/src/Button.cpp new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Viewer/src/Button.cpp @@ -0,0 +1 @@ + diff --git a/Viewer/src/DoubleDigit.cpp b/Viewer/src/DoubleDigit.cpp new file mode 100644 index 0000000..82cbf67 --- /dev/null +++ b/Viewer/src/DoubleDigit.cpp @@ -0,0 +1,40 @@ +#include "../include/DoubleDigit.h" +#include +#include "../VarBase/include/basecode.h" +DoubleDigit::DoubleDigit(string name, double newval) +{ + //Library *l; + DoubleVar *v; + lib=MkSM(); + lib->Load(); + if((v=(DoubleVar*)lib->Find(name))==0) + { + lib->Create(name, newval); + lib->Save(); + v=(DoubleVar*)lib->Find(name); + } + setDigit(name, v->getValue()); +} + +void DoubleDigit::setDigit(string name, double nDigit) +{ + lib->Delete(name); + value=nDigit; + lib->Create(name, value); + lib->Save(); +} + +double DoubleDigit::getDigit() +{ + return value; +} + +void DoubleDigit::show(QPainter *p, int x, int y) +{ + QString a; + QTextStream str(&a); + str<setPen(pen); + p->drawText(x,y,a); +} diff --git a/Viewer/src/Ellipse.cpp b/Viewer/src/Ellipse.cpp new file mode 100644 index 0000000..d9549f5 --- /dev/null +++ b/Viewer/src/Ellipse.cpp @@ -0,0 +1,73 @@ +#include "../include/Ellipse.h" +#include +#include "../include/mainwindow.h" + +Ellipse::Ellipse(string nx, int nxv, + string ny, int nyv, + string nr1, int nr1v, + string nr2, int nr2v, + QColor ncolv) +{ + x=getVarFromBase(nx, nxv); + y=getVarFromBase(ny, nyv); + r1=getVarFromBase(nr1, nr1v); + r2=getVarFromBase(nr2, nr2v); + color=ncolv; +} + +int Ellipse::getVarFromBase(string name, int newval) +{ + IntVar *v; + lib=MkSM(); + lib->Load(); + if((v=(IntVar*)lib->Find(name))==0) + { + lib->Create(name, newval); + lib->Save(); + v=(IntVar*)lib->Find(name); + } + return (v->getValue()); +} + +void Ellipse::setx(string name, int newx) +{ + if(lib->Find(name)==0) return; + lib->Delete(name); + x=newx; + lib->Create(name, x); + lib->Save(); +} + +void Ellipse::sety(string name, int newy) +{ + if(lib->Find(name)==0) return; + lib->Delete(name); + y=newy; + lib->Create(name, y); + lib->Save(); +} + +void Ellipse::setr1(string name, int newr1) +{ + if(lib->Find(name)==0) return; + lib->Delete(name); + r1=newr1; + lib->Create(name, r1); + lib->Save(); +} + +void Ellipse::setr2(string name, int newr2) +{ + if(lib->Find(name)==0) return; + lib->Delete(name); + r2=newr2; + lib->Create(name, r2); + lib->Save(); +} + +void Ellipse::show(QPainter *p) +{ + QPen pen(color); + p->setPen(pen); + p->drawEllipse(x, y, r1, r2); +} diff --git a/Viewer/src/IntDigit.cpp b/Viewer/src/IntDigit.cpp new file mode 100644 index 0000000..683f85e --- /dev/null +++ b/Viewer/src/IntDigit.cpp @@ -0,0 +1,41 @@ +#include "../include/IntDigit.h" +#include + +IntDigit::IntDigit(string name, int newval) +{ + //Library *l; + IntVar *v; + lib=MkSM(); + lib->Load(); + if((v=(IntVar*)lib->Find(name))==0) + { + lib->Create(name, newval); + lib->Save(); + v=(IntVar*)lib->Find(name); + } + setDigit(name, v->getValue()); +} + +void IntDigit::setDigit(string name, int nDigit) +{ + if(lib->Find(name)==0) return; + lib->Delete(name); + value=nDigit; + lib->Create(name, value); + lib->Save(); +} + +int IntDigit::getDigit() +{ + return value; +} + +void IntDigit::show(QPainter *p, int x, int y) +{ + QString a; + QTextStream str(&a); + str<setPen(pen); + p->drawText(x, y, a); +} diff --git a/Viewer/src/Line.cpp b/Viewer/src/Line.cpp new file mode 100644 index 0000000..dc482b1 --- /dev/null +++ b/Viewer/src/Line.cpp @@ -0,0 +1,105 @@ +#include +#include "../include/mainwindow.h" +#include "../include/Line.h" + +Line::Line(string nx1, int nx1v, + string ny1, int ny1v, + string nx2, int nx2v, + string ny2, int ny2v, + QColor ncolv) +{ + x1=getVarFromBase(nx1, nx1v); + y1=getVarFromBase(ny1, ny1v); + x2=getVarFromBase(nx2, nx2v); + y2=getVarFromBase(ny2, ny2v); + color=ncolv; +} + +int Line::getVarFromBase(string name, int newval) +{ + IntVar *v; + lib=MkSM(); + lib->Load(); + if((v=(IntVar*)lib->Find(name))==0) + { + lib->Create(name, newval); + lib->Save(); + v=(IntVar*)lib->Find(name); + } + return (v->getValue()); +} + + +void Line::setx1(string name, int nx1) +{ + if(lib->Find(name)==0) return; + lib->Delete(name); + x1=nx1; + lib->Create(name, x1); + lib->Save(); +} + +void Line::setx2(string name, int nx2) +{ + if(lib->Find(name)==0) return; + lib->Delete(name); + x2=nx2; + lib->Create(name, x2); + lib->Save(); +} + +void Line::sety1(string name, int ny1) +{ + if(lib->Find(name)==0) return; + lib->Delete(name); + y1=ny1; + lib->Create(name, y1); + lib->Save(); +} + +void Line::sety2(string name, int ny2) +{ + if(lib->Find(name)==0) return; + lib->Delete(name); + y2=ny2; + lib->Create(name, y2); + lib->Save(); +} + +int Line::getx1() +{ + return x1; +} + +int Line::getx2() +{ + return x2; +} + +int Line::gety1() +{ + return y1; +} + +int Line::gety2() +{ + return y2; +} + +void Line::setcolor(int ncolor) +{ + color=ncolor; +} + +QColor Line::getcolor() +{ + return color; +} + +void Line::show(QPainter *p) +{ + //Shape::show(); + QPen pen(color); + p->setPen(pen); + p->drawLine(x1, y1, x2, y2); +} diff --git a/Viewer/src/String.cpp b/Viewer/src/String.cpp new file mode 100644 index 0000000..e5601cc --- /dev/null +++ b/Viewer/src/String.cpp @@ -0,0 +1,50 @@ +#include "../include/String.h" +#include + +String::String(string name, const char* ndata) +{ + StringVar *v; + lib=MkSM(); + lib->Load(); + if((v=(StringVar*)lib->Find(name))==0) + { + lib->Create(name, ndata); + lib->Save(); + v=(StringVar*)lib->Find(name); + } + setData(name, v->getValue().c_str());// c_str() переводит string в const char * +} + +void String::setData(string name, const char* ndata) +{ + lib->Delete(name); + data=ndata; + lib->Create(name, data); + lib->Save(); +} + +const char* String::getData() +{ + return data; +} + +/*int String::setX(int nx) +{ + x=nx; + return 0; +} + +int String::setY(int ny) +{ + y=ny; + return 0; +}*/ + +void String::show(QPainter *p, int x, int y) +{ + QString a; + a=QString::fromLocal8Bit(data); + QPen pen("BLACK"); + p->setPen(pen); + p->drawText(x,y,a); +} diff --git a/Viewer/src/circle.cpp b/Viewer/src/circle.cpp new file mode 100644 index 0000000..5e7b78e --- /dev/null +++ b/Viewer/src/circle.cpp @@ -0,0 +1,80 @@ +#include "../include/circle.h" +#include +#include "../include/mainwindow.h" +/* +Circle::Circle() +{ +} + +Circle::Circle(int initUID, int initX, int initY, int initR, QColor initColour): + Shape(initUID, initX, initY, initColour), r(initR) +{ + //r = initR; +} +*/ + +Circle::Circle(string nx, int nxv, + string ny, int nyv, + string nr, int nrv, + QColor ncolv) +{ + x=getVarFromBase(nx, nxv); + y=getVarFromBase(ny, nyv); + r=getVarFromBase(nr, nrv); + color=ncolv; +} + +int Circle::getVarFromBase(string name, int newval) +{ + IntVar *v; + lib=MkSM(); + lib->Load(); + if((v=(IntVar*)lib->Find(name))==0) + { + lib->Create(name, newval); + lib->Save(); + v=(IntVar*)lib->Find(name); + } + return (v->getValue()); +} + +void Circle::setx(string name, int newx) +{ + lib->Delete(name); + x=newx; + lib->Create(name, x); + lib->Save(); +} + +void Circle::sety(string name, int newy) +{ + lib->Delete(name); + y=newy; + lib->Create(name, y); + lib->Save(); +} + +void Circle::setr(string name, int newr) +{ + lib->Delete(name); + r=newr; + lib->Create(name, r); + lib->Save(); +} + +void Circle::show(QPainter *painter) // TODO: a parameter indicating where to draw should be passed here +{ + Shape::show(); + QPen pen(color); + painter->setPen(pen); + painter->drawEllipse(x, y, r*2, r*2); + //QPainter painter(window) + //window-> + +} + +void Circle::hide() +{ + Shape::hide(); + +} diff --git a/Viewer/src/main.cpp b/Viewer/src/main.cpp new file mode 100644 index 0000000..5abebb9 --- /dev/null +++ b/Viewer/src/main.cpp @@ -0,0 +1,13 @@ +#include +#include "../include/mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.lib=new Library; + w.lib=MkSM(); + w.lib->Load(); + w.show(); + return a.exec(); +} diff --git a/Viewer/src/mainwindow.cpp b/Viewer/src/mainwindow.cpp new file mode 100644 index 0000000..20e2f6f --- /dev/null +++ b/Viewer/src/mainwindow.cpp @@ -0,0 +1,86 @@ +#include "../include/mainwindow.h" +//#include "ui_mainwindow.h" +#include "../include/circle.h" +#include "../include/square.h" +#include "../include/numberbox.h" +#include "../include/Line.h" +#include "../include/String.h" +#include "../include/IntDigit.h" +#include "../include/DoubleDigit.h" +#include "../include/Ellipse.h" +#include + +#define rnd(a, b) (a)+random()%((b)-(a)) + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent) +{ + NumberBox *l=new NumberBox(this); + l->show(); + l->move(230,150); + resize(400,200); + // Здесь, в конструкторе ОКНА, создаём массив окружностей + //QColor c1; + //nCircles = 0; + //while (nCircles<24) + //{ + //c1.setRgb(rnd(100, 200), rnd(150, 250), rnd(120, 160)); + // nCircles++; + // circles[nCircles-1] = new Circle(nCircles*2, rnd(20, 200), rnd(30, 120), rnd(20, 30), c1); + //} + //QColor::setRgb() + +} + +MainWindow::~MainWindow() +{ +} + +void MainWindow::paintEvent(QPaintEvent *) +{ + /* сейчас здесь банальный тест работы модулей + если кто додумается какого хрена double не выводит дробную часть - исправьте пожалуйста + */ + + + Line l1("line1_x1", 70, "line1_y1", 100, "line1_x2", 150, "line1_y2", 250, "YELLOW"); + String str1("string1", "String проверка !№;%:?*"); + IntDigit d1("d1",128); + DoubleDigit d2("d2", 312.12); + Square sq1("square1_x", 20, "square1_y", 20, "square1_a", 20, "RED"); + Circle cr1("circle1_x", 160, "circle1_y", 90, "circle1_r", 25, "GREEN"); + Ellipse el1("ellipse1_x", 120, "ellipse1_y", 120, "ellipse1_r1", 20, "ellipse1_r2", 40, "BLUE"); + QPainter p1(this); + //p1.drawEllipse(40, 40, 10, 5); + + //int i; + + // При каждой перерисовке выводим массив окружностей на экран + //for (i = 0; i< nCircles; i++) + // circles[i]->show(&p1); + //l1.setx1(120); + //l1.sety1(120); + //l1.setx2(200); + //l1.sety2(200); + //l1.setcolor(0); + l1.show(&p1); + sq1.show(&p1); + cr1.show(&p1); + el1.show(&p1); + //l1.show(&p1); + //s1.setData("Test по-русски"); + //s1.setX(200); + //s1.setY(120); + str1.show(&p1, 100, 50); + d1.show(&p1, 100, 120); + d2.show(&p1, 50, 100); + //p1.drawText (200, 120, s1.show()); + //p1.drawText (100, 120, d1.show()); +} + +void MainWindow::on_pushButton_clicked() +{ + QPainter p1(this); + p1.drawEllipse(40, 40, 10, 5); + QGraphicsScene *gs1 = new QGraphicsScene(); +} diff --git a/Viewer/res/numberbox.cpp b/Viewer/src/numberbox.cpp similarity index 82% rename from Viewer/res/numberbox.cpp rename to Viewer/src/numberbox.cpp index bcc7853..f487657 100644 --- a/Viewer/res/numberbox.cpp +++ b/Viewer/src/numberbox.cpp @@ -1,4 +1,4 @@ -#include "include/numberbox.h" +#include "../include/numberbox.h" #include NumberBox::NumberBox(QWidget *parent) : diff --git a/Viewer/pr2/shape.cpp b/Viewer/src/shape.cpp similarity index 70% rename from Viewer/pr2/shape.cpp rename to Viewer/src/shape.cpp index 8547c6d..9e24353 100644 --- a/Viewer/pr2/shape.cpp +++ b/Viewer/src/shape.cpp @@ -1,15 +1,15 @@ -#include "shape.h" +#include "../include/shape.h" Shape::Shape() { } -Shape::Shape(int initUID, int initX, int initY, QColor initColour) +Shape::Shape(int initUID, int initX, int initY, QColor initColor) { uid = initUID; x = initX; y = initY; - colour = initColour; + color = initColor; } void Shape::move(int newX, int newY) @@ -29,9 +29,9 @@ void Shape::show() isVisible = true; } -void Shape::setColour(QColor newColour) +void Shape::setColor(QColor newColor) { - colour = newColour; + color = newColor; } void Shape::setUID(int newUID) diff --git a/Viewer/src/square.cpp b/Viewer/src/square.cpp new file mode 100644 index 0000000..26206c4 --- /dev/null +++ b/Viewer/src/square.cpp @@ -0,0 +1,57 @@ +#include "../include/square.h" +/* +Square::Square() +{ +} + +Square::Square(int initUID, int initX, int initY, int initA, QColor initColour): + Shape(initUID, initX, initY, initColour), a(initA) +{ + +} +*/ +Square::Square(string nx, int nxv, + string ny, int nyv, + string na, int nav, + QColor ncolv) +{ + x=getVarFromBase(nx, nxv); + y=getVarFromBase(ny, nyv); + a=getVarFromBase(na, nav); +color=ncolv; +} + +int Square::getVarFromBase(string name, int newval) +{ + IntVar *v; + lib=MkSM(); + lib->Load(); + if((v=(IntVar*)lib->Find(name))==0) + { + lib->Create(name, newval); + lib->Save(); + v=(IntVar*)lib->Find(name); + } + return (v->getValue()); +} + +void Square::setA(int newA) +{ + a = newA; +} + +void Square::show(QPainter *painter) +{ + Shape::show(); + QPen pen(color); + painter->setPen(pen); + painter->drawRect(x, y, a, a); + //QPainter painter(this); + +} + +void Square::hide() +{ + Shape::hide(); + +} diff --git a/Viewer/res/Makefile b/project-build-desktop/Makefile similarity index 50% rename from Viewer/res/Makefile rename to project-build-desktop/Makefile index 066e7ee..aed20c2 100644 --- a/Viewer/res/Makefile +++ b/project-build-desktop/Makefile @@ -1,9 +1,9 @@ ############################################################################# -# Makefile for building: pr2 -# Generated by qmake (2.01a) (Qt 4.7.2) on: ?? ???. 18 21:52:41 2011 -# Project: pr2.pro +# Makefile for building: project +# Generated by qmake (2.01a) (Qt 4.7.0) on: ?? ???. 30 03:26:34 2011 +# Project: ../project/project.pro # Template: app -# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger -o Makefile pr2.pro +# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug -o Makefile ../project/project.pro ############################################################################# ####### Compiler, tools and options @@ -13,7 +13,7 @@ CXX = g++ DEFINES = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) -INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. +INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I../project -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I../project -I. LINK = g++ LFLAGS = LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread @@ -43,21 +43,33 @@ OBJECTS_DIR = ./ ####### Files -SOURCES = main.cpp \ - mainwindow.cpp \ - shape.cpp \ - circle.cpp \ - square.cpp \ - numberbox.cpp moc_mainwindow.cpp \ - moc_numberbox.cpp -OBJECTS = main.o \ - mainwindow.o \ - shape.o \ - circle.o \ +SOURCES = ../Viewer/src/String.cpp \ + ../Viewer/src/square.cpp \ + ../Viewer/src/shape.cpp \ + ../Viewer/src/numberbox.cpp \ + ../Viewer/src/mainwindow.cpp \ + ../Viewer/src/main.cpp \ + ../Viewer/src/Line.cpp \ + ../Viewer/src/circle.cpp \ + ../VarBase/src/lib.cpp \ + ../Viewer/src/IntDigit.cpp \ + ../Viewer/src/DoubleDigit.cpp \ + ../Viewer/src/Ellipse.cpp moc_numberbox.cpp \ + moc_mainwindow.cpp +OBJECTS = String.o \ square.o \ + shape.o \ numberbox.o \ - moc_mainwindow.o \ - moc_numberbox.o + mainwindow.o \ + main.o \ + Line.o \ + circle.o \ + lib.o \ + IntDigit.o \ + DoubleDigit.o \ + Ellipse.o \ + moc_numberbox.o \ + moc_mainwindow.o DIST = /usr/share/qt4/mkspecs/common/g++.conf \ /usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/linux.conf \ @@ -78,10 +90,10 @@ DIST = /usr/share/qt4/mkspecs/common/g++.conf \ /usr/share/qt4/mkspecs/features/yacc.prf \ /usr/share/qt4/mkspecs/features/lex.prf \ /usr/share/qt4/mkspecs/features/include_source_dir.prf \ - pr2.pro -QMAKE_TARGET = pr2 + ../project/project.pro +QMAKE_TARGET = project DESTDIR = -TARGET = pr2 +TARGET = project first: all ####### Implicit rules @@ -107,10 +119,10 @@ first: all all: Makefile $(TARGET) -$(TARGET): ui_mainwindow.h $(OBJECTS) +$(TARGET): $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) -Makefile: pr2.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ +Makefile: ../project/project.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ /usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/linux.conf \ /usr/share/qt4/mkspecs/qconfig.pri \ @@ -132,7 +144,7 @@ Makefile: pr2.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mk /usr/share/qt4/mkspecs/features/include_source_dir.prf \ /usr/lib/libQtGui.prl \ /usr/lib/libQtCore.prl - $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger -o Makefile pr2.pro + $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug -o Makefile ../project/project.pro /usr/share/qt4/mkspecs/common/g++.conf: /usr/share/qt4/mkspecs/common/unix.conf: /usr/share/qt4/mkspecs/common/linux.conf: @@ -156,11 +168,11 @@ Makefile: pr2.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mk /usr/lib/libQtGui.prl: /usr/lib/libQtCore.prl: qmake: FORCE - @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger -o Makefile pr2.pro + @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug -o Makefile ../project/project.pro dist: - @$(CHK_DIR_EXISTS) .tmp/pr21.0.0 || $(MKDIR) .tmp/pr21.0.0 - $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/pr21.0.0/ && $(COPY_FILE) --parents mainwindow.h shape.h circle.h square.h numberbox.h include/mainwindow.h include/numberbox.h include/shape.h include/circle.h include/square.h .tmp/pr21.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp shape.cpp circle.cpp square.cpp numberbox.cpp .tmp/pr21.0.0/ && $(COPY_FILE) --parents mainwindow.ui .tmp/pr21.0.0/ && (cd `dirname .tmp/pr21.0.0` && $(TAR) pr21.0.0.tar pr21.0.0 && $(COMPRESS) pr21.0.0.tar) && $(MOVE) `dirname .tmp/pr21.0.0`/pr21.0.0.tar.gz . && $(DEL_FILE) -r .tmp/pr21.0.0 + @$(CHK_DIR_EXISTS) ../project/.tmp/project1.0.0 || $(MKDIR) ../project/.tmp/project1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) ../project/.tmp/project1.0.0/ && $(COPY_FILE) --parents ../Viewer/include/String.h ../Viewer/include/square.h ../Viewer/include/shape.h ../Viewer/include/numberbox.h ../Viewer/include/mainwindow.h ../Viewer/include/Line.h ../Viewer/include/circle.h ../VarBase/include/basecode.h ../Viewer/include/IntDigit.h ../Viewer/include/DoubleDigit.h ../Viewer/include/Ellipse.h ../project/.tmp/project1.0.0/ && $(COPY_FILE) --parents ../Viewer/src/String.cpp ../Viewer/src/square.cpp ../Viewer/src/shape.cpp ../Viewer/src/numberbox.cpp ../Viewer/src/mainwindow.cpp ../Viewer/src/main.cpp ../Viewer/src/Line.cpp ../Viewer/src/circle.cpp ../VarBase/src/lib.cpp ../Viewer/src/IntDigit.cpp ../Viewer/src/DoubleDigit.cpp ../Viewer/src/Ellipse.cpp ../project/.tmp/project1.0.0/ && (cd `dirname ../project/.tmp/project1.0.0` && $(TAR) project1.0.0.tar project1.0.0 && $(COMPRESS) project1.0.0.tar) && $(MOVE) `dirname ../project/.tmp/project1.0.0`/project1.0.0.tar.gz . && $(DEL_FILE) -r ../project/.tmp/project1.0.0 clean:compiler_clean @@ -181,17 +193,15 @@ mocclean: compiler_moc_header_clean compiler_moc_source_clean mocables: compiler_moc_header_make_all compiler_moc_source_make_all -compiler_moc_header_make_all: moc_mainwindow.cpp moc_numberbox.cpp +compiler_moc_header_make_all: moc_numberbox.cpp moc_mainwindow.cpp compiler_moc_header_clean: - -$(DEL_FILE) moc_mainwindow.cpp moc_numberbox.cpp -moc_mainwindow.cpp: include/circle.h \ - include/shape.h \ - include/square.h \ - include/mainwindow.h - /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) include/mainwindow.h -o moc_mainwindow.cpp + -$(DEL_FILE) moc_numberbox.cpp moc_mainwindow.cpp +moc_numberbox.cpp: ../Viewer/include/numberbox.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) ../Viewer/include/numberbox.h -o moc_numberbox.cpp -moc_numberbox.cpp: include/numberbox.h - /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) include/numberbox.h -o moc_numberbox.cpp +moc_mainwindow.cpp: ../VarBase/include/basecode.h \ + ../Viewer/include/mainwindow.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) ../Viewer/include/mainwindow.h -o moc_mainwindow.cpp compiler_rcc_make_all: compiler_rcc_clean: @@ -200,58 +210,91 @@ compiler_image_collection_clean: -$(DEL_FILE) qmake_image_collection.cpp compiler_moc_source_make_all: compiler_moc_source_clean: -compiler_uic_make_all: ui_mainwindow.h +compiler_uic_make_all: compiler_uic_clean: - -$(DEL_FILE) ui_mainwindow.h -ui_mainwindow.h: mainwindow.ui - /usr/bin/uic-qt4 mainwindow.ui -o ui_mainwindow.h - compiler_yacc_decl_make_all: compiler_yacc_decl_clean: compiler_yacc_impl_make_all: compiler_yacc_impl_clean: compiler_lex_make_all: compiler_lex_clean: -compiler_clean: compiler_moc_header_clean compiler_uic_clean +compiler_clean: compiler_moc_header_clean ####### Compile -main.o: main.cpp include/mainwindow.h \ - include/circle.h \ - include/shape.h \ - include/square.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp - -mainwindow.o: mainwindow.cpp include/mainwindow.h \ - include/circle.h \ - include/shape.h \ - include/square.h \ - ui_mainwindow.h \ - include/numberbox.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp +String.o: ../Viewer/src/String.cpp ../Viewer/include/String.h \ + ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o String.o ../Viewer/src/String.cpp + +square.o: ../Viewer/src/square.cpp ../Viewer/include/square.h \ + ../Viewer/include/shape.h \ + ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o square.o ../Viewer/src/square.cpp + +shape.o: ../Viewer/src/shape.cpp ../Viewer/include/shape.h \ + ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o shape.o ../Viewer/src/shape.cpp + +numberbox.o: ../Viewer/src/numberbox.cpp ../Viewer/include/numberbox.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o numberbox.o ../Viewer/src/numberbox.cpp + +mainwindow.o: ../Viewer/src/mainwindow.cpp ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h \ + ../Viewer/include/circle.h \ + ../Viewer/include/shape.h \ + ../Viewer/include/square.h \ + ../Viewer/include/numberbox.h \ + ../Viewer/include/Line.h \ + ../Viewer/include/String.h \ + ../Viewer/include/IntDigit.h \ + ../Viewer/include/DoubleDigit.h \ + ../Viewer/include/Ellipse.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o ../Viewer/src/mainwindow.cpp + +main.o: ../Viewer/src/main.cpp ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../Viewer/src/main.cpp + +Line.o: ../Viewer/src/Line.cpp ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h \ + ../Viewer/include/Line.h \ + ../Viewer/include/shape.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Line.o ../Viewer/src/Line.cpp + +circle.o: ../Viewer/src/circle.cpp ../Viewer/include/circle.h \ + ../Viewer/include/shape.h \ + ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o circle.o ../Viewer/src/circle.cpp + +lib.o: ../VarBase/src/lib.cpp ../VarBase/include/basecode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o lib.o ../VarBase/src/lib.cpp + +IntDigit.o: ../Viewer/src/IntDigit.cpp ../Viewer/include/IntDigit.h \ + ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o IntDigit.o ../Viewer/src/IntDigit.cpp + +DoubleDigit.o: ../Viewer/src/DoubleDigit.cpp ../Viewer/include/DoubleDigit.h \ + ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o DoubleDigit.o ../Viewer/src/DoubleDigit.cpp + +Ellipse.o: ../Viewer/src/Ellipse.cpp ../Viewer/include/Ellipse.h \ + ../Viewer/include/shape.h \ + ../Viewer/include/mainwindow.h \ + ../VarBase/include/basecode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Ellipse.o ../Viewer/src/Ellipse.cpp -shape.o: shape.cpp include/shape.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o shape.o shape.cpp - -circle.o: circle.cpp include/circle.h \ - include/shape.h \ - include/mainwindow.h \ - include/square.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o circle.o circle.cpp - -square.o: square.cpp include/square.h \ - include/shape.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o square.o square.cpp - -numberbox.o: numberbox.cpp include/numberbox.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o numberbox.o numberbox.cpp +moc_numberbox.o: moc_numberbox.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_numberbox.o moc_numberbox.cpp moc_mainwindow.o: moc_mainwindow.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp -moc_numberbox.o: moc_numberbox.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_numberbox.o moc_numberbox.cpp - ####### Install install: FORCE diff --git a/project-build-desktop/varbase.xml b/project-build-desktop/varbase.xml new file mode 100644 index 0000000..e69de29 diff --git a/project/project.pro b/project/project.pro new file mode 100644 index 0000000..4f976c3 --- /dev/null +++ b/project/project.pro @@ -0,0 +1,44 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2011-12-22T17:40:15 +# +#------------------------------------------------- + +QT += core gui + +TARGET = project +TEMPLATE = app + + +SOURCES += \ + ../Viewer/src/String.cpp \ + ../Viewer/src/square.cpp \ + ../Viewer/src/shape.cpp \ + ../Viewer/src/numberbox.cpp \ + ../Viewer/src/mainwindow.cpp \ + ../Viewer/src/main.cpp \ + ../Viewer/src/Line.cpp \ + ../Viewer/src/circle.cpp \ + ../VarBase/src/lib.cpp \ + ../Viewer/src/IntDigit.cpp \ + ../Viewer/src/DoubleDigit.cpp \ + ../Viewer/src/Ellipse.cpp + +HEADERS += \ + ../Viewer/include/String.h \ + ../Viewer/include/square.h \ + ../Viewer/include/shape.h \ + ../Viewer/include/numberbox.h \ + ../Viewer/include/mainwindow.h \ + ../Viewer/include/Line.h \ + ../Viewer/include/circle.h \ + ../VarBase/include/basecode.h \ + ../Viewer/include/IntDigit.h \ + ../Viewer/include/DoubleDigit.h \ + ../Viewer/include/Ellipse.h + +FORMS += + +OTHER_FILES += \ + varbase.xml \ + ../project-build-desktop/varbase.xml diff --git a/project/project.pro.user b/project/project.pro.user new file mode 100644 index 0000000..c9ff909 --- /dev/null +++ b/project/project.pro.user @@ -0,0 +1,113 @@ + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + System + + + + ProjectExplorer.Project.Target.0 + + Настольный компьютер + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + + + qmake + QtProjectManager.QMakeBuildStep + + + + Сборка + Qt4ProjectManager.MakeStep + false + + + + 2 + + Сборка + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Отладка + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/president/1/MAI_SCADA/project-build-desktop + 2 + 0 + true + + + + qmake + QtProjectManager.QMakeBuildStep + + + + Сборка + Qt4ProjectManager.MakeStep + false + + + + 2 + + Сборка + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Релиз + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/president/1/MAI_SCADA/project-build-desktop + 2 + 0 + true + + 2 + + project + Qt4ProjectManager.Qt4RunConfiguration + 2 + + project.pro + false + false + + false + false + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 4 + + diff --git a/project/project.pro.user.1.3 b/project/project.pro.user.1.3 new file mode 100644 index 0000000..e69de29 diff --git a/project/project.user b/project/project.user new file mode 100644 index 0000000..d9a4cfd --- /dev/null +++ b/project/project.user @@ -0,0 +1,113 @@ + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + System + + + + ProjectExplorer.Project.Target.0 + + Настольный компьютер + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + + + qmake + QtProjectManager.QMakeBuildStep + + + + Сборка + Qt4ProjectManager.MakeStep + false + + + + 2 + + Сборка + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Отладка + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/president/nashe-build-desktop + 2 + 0 + true + + + + qmake + QtProjectManager.QMakeBuildStep + + + + Сборка + Qt4ProjectManager.MakeStep + false + + + + 2 + + Сборка + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Релиз + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/president/nashe-build-desktop + 2 + 0 + true + + 2 + + nashe + Qt4ProjectManager.Qt4RunConfiguration + 2 + + nashe.pro + false + false + + false + false + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 4 + +