Source Code (Use browser search to find items of interest.)

Class Index

kpresenter'ConfRectDia (./koffice/kpresenter/confrectdia.h:64)

class ConfRectDia : public QDialog
{
    Q_OBJECT

public:
    ConfRectDia( QWidget* parent, const char* );
    ~ConfRectDia();

    void setRnds( int _rx, int _ry );

    int getRndX()
    { return xRnd; }
    int getRndY()
    { return yRnd; }

protected:
    QLabel *lRndX, *lRndY;
    QLineEdit *eRndX, *eRndY;
    QGroupBox *gSettings, *gPreview;
    RectPreview *rectPreview;
    QPushButton *okBut, *applyBut, *cancelBut;

    int xRnd, yRnd;

protected slots:
    void rndXChanged( const QString & );
    void rndYChanged( const QString & );
    void Apply() { emit confRectDiaOk(); }

signals:
    void confRectDiaOk();

};

kpresenter'ConfRectDia::ConfRectDia() (./koffice/kpresenter/confrectdia.cc:68)

ConfRectDia::ConfRectDia( QWidget* parent, const char* name )
    : QDialog( parent, name, true )
{
    gSettings = new QGroupBox( i18n( "Settings" ), this );
    gSettings->move( 20, 20 );

    lRndX = new QLabel( i18n( "Roundedness X" ), gSettings );
    lRndX->resize( lRndX->sizeHint() );
    lRndX->move( 10, 20 );

    eRndX = new QLineEdit( gSettings );
    eRndX->setValidator( new QIntValidator( eRndX ) );
    eRndX->resize( eRndX->sizeHint() );
    eRndX->move( lRndX->x(), lRndX->y() + lRndX->height() + 5 );
    connect( eRndX, SIGNAL( textChanged( const QString & ) ), this, SLOT( rndXChanged( const QString & ) ) );

    lRndY = new QLabel( i18n( "Roundedness Y" ), gSettings );
    lRndY->resize( lRndY->sizeHint() );
    lRndY->move( eRndX->x(), eRndX->y() + eRndX->height() + 20 );

    eRndY = new QLineEdit( gSettings );
    eRndY->setValidator( new QIntValidator( eRndY ) );
    eRndY->resize( eRndY->sizeHint() );
    eRndY->move( lRndY->x(), lRndY->y() + lRndY->height() + 5 );
    connect( eRndY, SIGNAL( textChanged( const QString & ) ), this, SLOT( rndYChanged( const QString & ) ) );

    gSettings->resize(max(max(max(lRndX->x() + lRndX->width(),eRndX->x() + eRndX->width()),
                              lRndY->x() + lRndY->width() ), eRndY->x() + eRndY->width() ) + 20,
                      eRndY->y() + eRndY->height() + 20 );

    gPreview = new QGroupBox( i18n( "Preview" ), this );
    gPreview->move( gSettings->x() + gSettings->width() + 20, 20 );
    gPreview->resize( gSettings->size() );

    rectPreview = new RectPreview( gPreview, "preview" );
    rectPreview->setGeometry( 10, 20, gPreview->width() - 20, gPreview->height() - 30 );

    cancelBut = new QPushButton( this, "BCancel" );
    cancelBut->setText( i18n( "Cancel" ) );

    applyBut = new QPushButton( this, "BApply" );
    applyBut->setText( i18n( "Apply" ) );

    okBut = new QPushButton( this, "BOK" );
    okBut->setText( i18n( "OK" ) );
    okBut->setAutoRepeat( false );
    okBut->setAutoResize( false );
    okBut->setAutoDefault( true );
    okBut->setDefault( true );

    int butW = max(cancelBut->sizeHint().width(),
                   max(applyBut->sizeHint().width(),okBut->sizeHint().width()));
    int butH = cancelBut->sizeHint().height();

    cancelBut->resize( butW, butH );
    applyBut->resize( butW, butH );
    okBut->resize( butW, butH );

    cancelBut->move( gPreview->x() + gPreview->width() - butW, gPreview->y() + gPreview->height() + 25 );
    applyBut->move( cancelBut->x() - 5 - applyBut->width(), cancelBut->y() );
    okBut->move( applyBut->x() - 10 - okBut->width(), cancelBut->y() );

    connect( okBut, SIGNAL( clicked() ), this, SLOT( Apply() ) );
    connect( applyBut, SIGNAL( clicked() ), this, SLOT( Apply() ) );
    connect( cancelBut, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( okBut, SIGNAL( clicked() ), this, SLOT( accept() ) );

    resize( gPreview->x() + gPreview->width() + 20, gPreview->y() + gPreview->height() + 20 + butH + 20 );
}

/*===================== destructor ===============================*/

kpresenter'ConfRectDia::~ConfRectDia() (./koffice/kpresenter/confrectdia.cc:139)

ConfRectDia::~ConfRectDia()
{
}

/*================================================================*/

kpresenter'ConfRectDia::rndXChanged() (./koffice/kpresenter/confrectdia.cc:144)

void ConfRectDia::rndXChanged( const QString & _rx )
{
    xRnd = atoi( _rx );
    rectPreview->setRnds( xRnd, yRnd );
}

/*================================================================*/

kpresenter'ConfRectDia::rndYChanged() (./koffice/kpresenter/confrectdia.cc:151)

void ConfRectDia::rndYChanged( const QString & _ry )
{
    yRnd = atoi( _ry );
    rectPreview->setRnds( xRnd, yRnd );
}

/*================================================================*/

kpresenter'ConfRectDia::setRnds() (./koffice/kpresenter/confrectdia.cc:158)

void ConfRectDia::setRnds( int _rx, int _ry )
{
    xRnd = _rx;
    yRnd = _ry;
    rectPreview->setRnds( xRnd, yRnd );

    QString str;

    str.sprintf( "%d", xRnd );
    eRndX->setText( str );
    str.sprintf( "%d", yRnd );
    eRndY->setText( str );
}