parent
ddb4da7102
commit
8bb265fd94
@ -0,0 +1,25 @@ |
||||
QT += core gui |
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets |
||||
|
||||
CONFIG += c++11 |
||||
|
||||
# You can make your code fail to compile if it uses deprecated APIs. |
||||
# In order to do so, uncomment the following line. |
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 |
||||
|
||||
SOURCES += \ |
||||
main.cpp \ |
||||
../qtsgraph.cpp |
||||
|
||||
HEADERS += \ |
||||
../qtsgraph.h |
||||
|
||||
FORMS += |
||||
|
||||
TRANSLATIONS += |
||||
|
||||
# Default rules for deployment. |
||||
qnx: target.path = /tmp/$${TARGET}/bin |
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin |
||||
!isEmpty(target.path): INSTALLS += target |
@ -0,0 +1,39 @@ |
||||
#include "../qtsgraph.h" |
||||
|
||||
int main(int argc, char *argv[]) |
||||
{ |
||||
QApplication a(argc, argv); |
||||
|
||||
/*
|
||||
* Задаётся размер и положение окна |
||||
* (int w = 640, int h = 480, int x = -1, int y = -1, QWidget *parent = nullptr) |
||||
* В случае отрицательного значения x или y, окно создаётся в центре экрана. |
||||
*/ |
||||
QTSGraph w(1024, 768); |
||||
|
||||
w.show(); |
||||
return a.exec(); |
||||
} |
||||
|
||||
void QTSGraph::PaintBox() |
||||
{ |
||||
// Начало рисования
|
||||
|
||||
SetColor(0x00AAAAAA); |
||||
Line(120, 120, 135, 260); |
||||
SetWidth(5); |
||||
SetColor(clBlue); |
||||
Line(110, 110, 125, 250); |
||||
PutPixel(100, 100, 0x00FF0000, 10); |
||||
Delay(2000); |
||||
PutPixel(300, 100); |
||||
int x = 1; |
||||
while(!MouseClicked() && x < 1024) |
||||
{ |
||||
PutPixel(x, 50, 0x555555+x*16, 5); |
||||
x += 1; |
||||
Delay(1); |
||||
} |
||||
|
||||
// Конец рисования
|
||||
} |
@ -1,22 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>QTSGraph</class> |
||||
<widget class="QMainWindow" name="QTSGraph"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>800</width> |
||||
<height>600</height> |
||||
</rect> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>QTSGraph</string> |
||||
</property> |
||||
<widget class="QWidget" name="centralwidget"/> |
||||
<widget class="QMenuBar" name="menubar"/> |
||||
<widget class="QStatusBar" name="statusbar"/> |
||||
</widget> |
||||
<resources/> |
||||
<connections/> |
||||
</ui> |
Loading…
Reference in new issue