Menu

[r20]: / trunk / src / convbitsgui.cpp  Maximize  Restore  History

Download this file

48 lines (37 with data), 1.4 kB

 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
/*
convbits - gui for manipulating decimal, hexadecimal and binary representation of integers
Copyright (C) 2011 Cedric Boudinet <bouced@gmx.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "convbitsgui.hpp"
#include <stdio.h>
#include <QLabel>
#include "convbits.xpm"
#include "bitrow.hpp"
#include <QIcon>
#include <QPixmap>
convBitsGui::convBitsGui(QWidget *parent)
: QWidget(parent)
{
_grid = new QGridLayout(this);
_grid->addWidget(new QLabel("Decimal :", this), 0, 0);
_grid->addWidget(new QLabel("Hexadecimal :", this), 0, 1);
for(int i=0;i<NB_BITS_SHOW; i++)
{
_grid->addWidget(new QLabel(QString("%1").arg(NB_BITS_SHOW-i-1),this),0,i+2);
}
for(int i=0;i<NB_ROWS_CONV;i++)
{
bitRow * br = new bitRow(this, 1+i);
}
setWindowIcon(QIcon(QPixmap(convbits_xpm)));
}