MainWidget::MainWidget( QWidget* parent, const char* name ) : QFrame( parent, name ) { QBoxLayout *grid = new QHBoxLayout( this, 5 ); //(rows,col) bPainter = new BallPainter(); lsb = new LinesBoard(bPainter, this); grid->addWidget( lsb ); QBoxLayout *right = new QVBoxLayout(grid, 2); QLabel *label = new QLabel(i18n("Next balls:"), this); lPrompt = new LinesPrompt(bPainter, this); connect(lPrompt, SIGNAL(PromptPressed()), parent, SLOT(switchPrompt())); right->addWidget( label, 0, Qt::AlignBottom | Qt::AlignHCenter ); right->addWidget( lPrompt, 0, Qt::AlignTop | Qt::AlignHCenter ); grid->activate(); grid->freeze(0,0); // warning("width: %i height: %i", width(), height() ); // warning("wh: %i hh: %i", sizeHint().width(), sizeHint().height() ); }
/* Handles mouse press events for the LinesPrompt widget. */ void LinesPrompt::mousePressEvent( QMouseEvent* e ) { emit PromptPressed(); }