from knop.h:
from knop.c:
{
setMaximumSize
( QSize( 50,
50 ) );
but
->setGeometry
( QRect( 0,
0,
50,
50 ) );
but->setCheckable(true);
but
->setFont
(QFont("Bitstream Vera Sans",
22,
QFont::Bold));
but->setFlat(true);
e
->setGeometry
( QRect( 5,
5,
40,
10 ) );
QFont e_font
( e
->font
() );
e_font.setPointSize( 10 );
e->setFont( e_font );
e->setFrame( FALSE );
resize
( QSize(50,
50).
expandedTo(minimumSizeHint
()) );
connect( but, SIGNAL(clicked()), SLOT(butClick()) );
init();
}
void knop::init()
{
#ifdef _WIN32
progPath = "/home/bartv/progs/sudoku/"; //linux
#else
progPath = "D:/qt/progs/sudoku/"; //windows
#endif
pWit.load("knopWit.png");
but->setPallete(palWit);
e->setPalette(palWit);
from knop.h:
QPixmap pWit;
QPalette palWit;
QString progPath;
from knop.c:
knop::knop(QWidget* parent)
: QWidget(parent)
{
setMaximumSize( QSize( 50, 50 ) );
but = new QPushButton("but", this);
but->setGeometry( QRect( 0, 0, 50, 50 ) );
but->setCheckable(true);
but->setFont(QFont("Bitstream Vera Sans",22,QFont::Bold));
but->setFlat(true);
e = new QLineEdit("e", this);
e->setGeometry( QRect( 5, 5, 40, 10 ) );
QFont e_font( e->font() );
e_font.setPointSize( 10 );
e->setFont( e_font );
e->setFrame( FALSE );
resize( QSize(50, 50).expandedTo(minimumSizeHint()) );
connect( but, SIGNAL(clicked()), SLOT(butClick()) );
init();
}
void knop::init()
{
#ifdef _WIN32
progPath = "/home/bartv/progs/sudoku/"; //linux
#else
progPath = "D:/qt/progs/sudoku/"; //windows
#endif
pWit.load("knopWit.png");
palWit.setBrush(QPalette::Active,QPalette::Window,QBrush(pWit));
palWit.setBrush(QPalette::Active,QPalette::Base,QColor(255,255,255));
palWit.setBrush(QPalette::Active,QPalette::Text,QColor(0,0,0));
palWit.setBrush(QPalette::Active,QPalette::ButtonText,QColor(0,0,0));
palWit.setBrush(QPalette::Inactive,QPalette::Window,QBrush(pWit));
palWit.setBrush(QPalette::Inactive,QPalette::Base,QColor(255,255,255));
palWit.setBrush(QPalette::Inactive,QPalette::Text,QColor(0,0,0));
palWit.setBrush(QPalette::Inactive,QPalette::ButtonText,QColor(0,0,0));
but->setPallete(palWit);
e->setPalette(palWit);
To copy to clipboard, switch view to plain text mode
Bookmarks