File: keybox.cpp

package info (click to toggle)
kascade 1.0-beta10-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 964 kB
  • ctags: 815
  • sloc: cpp: 7,780; makefile: 39
file content (28 lines) | stat: -rw-r--r-- 614 bytes parent folder | download
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
#include "keybox.h"

KeyBox::KeyBox( QWidget *parent ) : QDialog( parent, 0, TRUE )
{
	resize( 250, 95 );

	label = new QLabel( "Enter the new key for this action", this );
	label->setAlignment( QLabel::AlignCenter );

	cancel = new QPushButton( "Cancel", this );
	connect( cancel, SIGNAL(clicked()), SLOT(reject()) );
}

void KeyBox::resizeEvent( QResizeEvent * )
{
	int width = this->width();
	int height = this->height();

	label->setGeometry( 10, 10, width-20, 30 );
	cancel->setGeometry( width/2-45, height-40, 90, 30 );
}	

void KeyBox::keyPressEvent( QKeyEvent *event )
{
	key = event->key();
	accept();
}