-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnot_component.cpp
72 lines (61 loc) · 1.65 KB
/
not_component.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "not_component.h"
NOT_component::NOT_component()
{
imekomp="not";
tip=1;
}
void NOT_component::PaintComp(QPainter &p)
{
if(!ref.isNull())
{
if(selektovan==true){
p.setPen(Qt::red);
}
else
{
p.setPen(Qt::black);
}
QPoint lStart(ref.x()+20,ref.y());
QPoint lEnd(ref.x()+20,ref.y()+80);
QPoint centar(ref.x()+65,ref.y()+40);
//pinovi
p.drawLine(ref.x(),ref.y()+40,lStart.x(),lStart.y()+40);
// p.drawLine(ref.x(),ref.y()+50,lStart.x(),lStart.y()+50);
p.drawLine(ref.x()+70,ref.y()+40,ref.x()+90,ref.y()+40);
//komponenta
p.drawLine(lStart.x(),lStart.y(),lEnd.x(),lEnd.y());
p.drawLine(lStart.x(),lStart.y(),lStart.x()+40,lStart.y()+40);
p.drawLine(lEnd.x(),lEnd.y(),lEnd.x()+40,lEnd.y()-40);
p.drawEllipse(centar,5,5);
}
}
void NOT_component::setParent(QWidget *parent){
tabelica=new QTableWidget(parent);
}
void NOT_component::setTabelicu(int brUlaza){
tabelica->setRowCount(2);
tabelica->setColumnCount(2);
QTableWidgetItem *item;
item=new QTableWidgetItem();
QString s="0";
item->setText(s);
tabelica->setItem(0,0,item);
item=new QTableWidgetItem();
item->setText(s);
tabelica->setItem(1,1,item);
item=new QTableWidgetItem();
s="1";
item->setText(s);
tabelica->setItem(0,1,item);
item=new QTableWidgetItem();
item->setText(s);
tabelica->setItem(1,0,item);
tabelica->setWindowTitle("NOT");
}
void NOT_component::mojaFja()
{
if(ulazi[0]==0)
this->promenioSamSe(1);
else
this->promenioSamSe(0);
}