~openhommdev/openhomm/gui

« back to all changes in this revision

Viewing changes to src/gui/hrWidget.cpp

  • Committer: Roman Fomin
  • Date: 2010-02-22 15:38:37 UTC
  • Revision ID: rfomin@gmail.com-20100222153837-7idkqlt3dt5br3ny
add border
pcx plugin: alpha channel

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
hrWidget::hrWidget(QObject *parent) : QObject(parent)
21
21
        , corner(0)
22
 
        , x(0)
23
 
        , y(0)
24
22
{
25
23
    corner |= topLeft;
26
24
}
27
25
 
28
 
QRect hrWidget::getRect()
 
26
QRect hrWidget::getRect() const
29
27
{
30
 
    rect.setRect(x, y, rect.width(), rect.height());
31
28
    return rect;
32
29
}
33
30
 
34
 
void hrWidget::setSize(QSize s)
 
31
/*void hrWidget::setSize(QSize s)
35
32
{
36
33
    rect.setWidth(s.width());
37
34
    rect.setHeight(s.height());
38
 
}
 
35
}*/
39
36
 
40
37
QVectorIterator<hrGraphicsItem> hrWidget::getItems() const
41
38
{
42
39
    return QVectorIterator<hrGraphicsItem>(items);
43
40
}
44
41
 
45
 
void hrWidget::addItem(hrGraphicsItem item)
46
 
{
47
 
    items.append(item);
48
 
}
49
 
 
50
 
hrGraphicsItem& hrWidget::modifyItem(int num)
51
 
{
52
 
    Q_ASSERT(num >= 0 && num < items.size());
53
 
    return items[num];
54
 
}
55
 
 
56
 
void hrWidget::clearItems()
57
 
{
58
 
    items.clear();
59
 
}
60
 
 
61
 
void hrWidget::setX(int x)
62
 
{
63
 
    this->x = x;
64
 
}
65
 
 
66
 
int hrWidget::getX() const
67
 
{
68
 
    return x;
69
 
}
70
 
 
71
 
void hrWidget::setY(int y)
72
 
{
73
 
    this->y = y;
74
 
}
75
 
 
76
 
int hrWidget::getY() const
77
 
{
78
 
    return y;
79
 
}
80
 
 
81
42
void hrWidget::setTopLeft(bool flag)
82
43
{
83
44
    if (flag)