File: infobox.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-- 683 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 "infobox.h"

InfoBox::InfoBox( string caption, string text, QWidget *parent ) : QDialog( parent )
{
	resize( 410, 250 );
	setMinimumSize( 250, 100 );

	setCaption( caption.c_str() );

	Bclose = new QPushButton( this );
	Bclose->setText( "Close" );

	multiline = new QMultiLineEdit( this );
	multiline->setWordWrap( QMultiLineEdit::WidgetWidth );
	multiline->setText( ( this->text = text ).c_str() );

	QObject::connect( Bclose, SIGNAL( clicked() ), this, SLOT( close() ) ); 

	show();
}

void InfoBox::resizeEvent( QResizeEvent * )
{
	int w = this->width(), h = this->height();

	multiline->setGeometry( 10, 10, w-20, h-60 );
	Bclose->setGeometry( w/2-45, h-40, 90, 30 );
}