Diffstat (limited to 'noncore/apps/opie-console/dialdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/dialdialog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp index 8bf32f9..0ace8f7 100644 --- a/noncore/apps/opie-console/dialdialog.cpp +++ b/noncore/apps/opie-console/dialdialog.cpp @@ -47,49 +47,57 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f int x = 0, y = 0; for ( int i = 0 ; i < 9; i++ ) { QPushButton *number = new QPushButton( this ); number->setText( QString( "%1" ).arg( i + 1 ) ); QFont number_font( number->font() ); number_font.setBold( TRUE ); number->setFont( number_font ); dialButtons->insert( number ); layout->addWidget( number, x, y ); if ( y < 2 ) { y++; } else { x++; y = 0; } } connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) ); mainLayout->addStretch( 0 ); mainLayout->addWidget( textLabel ); mainLayout->addWidget( LCD ); mainLayout->addStretch( 0 ); mainLayout->addLayout( layout ); mainLayout->addStretch( 0 ); } void DialDialog::slotEnterNumber( int number ) { // pretty stupid, just for testing .-) m_number = ( m_number * 10 ) + number; qDebug( QString("%1").arg( m_number ) ); LCD->display( m_number ); } DialDialog::~DialDialog() { } QString DialDialog::number() { return QString( "%1").arg( m_number ); + } + +void DialDialog::setNumber( int number ) +{ + m_number = number; + LCD->display( m_number ); +} + |