Logo Search packages:      
Sourcecode: sailcut version File versions  Download package

CWidgetProfile::CWidgetProfile ( QWidget *  parent,
CProfile ptr,
QString  caption,
CWidgetProfileVert vert 
)

The constructor.

Parameters:
parent the parent dialog
ptr a pointer to the profile we are displaying / editing
caption caption for the profile view (e.g. top,middle..)
vert the vertical repartition widget

Definition at line 122 of file widgetprofile.cpp.

References active, CProfile::getDepth(), CProfile::getLeech(), CProfile::getLuff(), languageChange(), lblDepth, lblDraw, lblLeech, lblLuff, lblPercent, profile, slotChanged(), spinDepth, spinLeech, and spinLuff.

        : QWidget(parent), widgetVert(vert)
{
    profile = ptr;

    QHBoxLayout *layout = new QHBoxLayout( this );

    QGroupBox *grpProfile = new QGroupBox( this );
//    grpProfile->setAlignment( int( QGroupBox::AlignCenter | QGroupBox::AlignRight | QGroupBox::AlignLeft ) );
//    grpProfile->setColumnLayout(0, Qt::Vertical );
    
    QGridLayout *grpProfileLayout = new QGridLayout( grpProfile );
    grpProfileLayout->setAlignment( Qt::AlignTop );
    grpProfile->setTitle(caption);

    // add the spin boxes
    QHBoxLayout *spinBoxesLayout = new QHBoxLayout();

    // luff
    lblLuff = new QLabel( grpProfile );
    lblLuff->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    spinBoxesLayout->addWidget( lblLuff );

    spinLuff = new QSpinBox( grpProfile );
    spinLuff->setMaximum( 12 );
    spinLuff->setMinimum( 1 );
    spinLuff->setValue( 1 );
    spinBoxesLayout->addWidget( spinLuff );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
    spinBoxesLayout->addItem( spacer );

    // depth
    lblDepth = new QLabel( grpProfile );
    lblDepth->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    spinBoxesLayout->addWidget( lblDepth );

    spinDepth = new QSpinBox( grpProfile );
    spinDepth->setMaximum( 20 );
    spinDepth->setMinimum( 1 );
    spinDepth->setValue( 10 );
    spinBoxesLayout->addWidget( spinDepth );

    lblPercent = new QLabel( grpProfile );
    spinBoxesLayout->addWidget( lblPercent );
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
    spinBoxesLayout->addItem( spacer_2 );

    // leech
    lblLeech = new QLabel( grpProfile );
    spinBoxesLayout->addWidget( lblLeech );

    spinLeech = new QSpinBox( grpProfile );
    spinLeech->setMinimum( -4 );
    spinLeech->setMaximum( 8 );
    spinBoxesLayout->addWidget( spinLeech );

    grpProfileLayout->addLayout( spinBoxesLayout, 1, 0 );
    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    grpProfileLayout->addItem( spacer_3, 0, 0 );

    layout->addWidget( grpProfile );
    languageChange();
    resize( QSize(527, 159).expandedTo(minimumSizeHint()) );

    // signals and slots connections
    connect( spinLuff, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) );
    connect( spinDepth, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) );
    connect( spinLeech, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) );


    // create the drawing area
    lblDraw = new CLabelProfile( grpProfile, profile );
    grpProfileLayout->addWidget( lblDraw, 0, 0 );

    // we set the "active" flag to false so that we can set the initial
    // values without slotChanged being triggered
    active = false;
    spinLeech->setValue( int(profile->getLeech()*50) );
    spinLuff->setValue( int(profile->getLuff()) );
    spinDepth->setValue( int(profile->getDepth()*100) );
    active = true;
}


Generated by  Doxygen 1.6.0   Back to index