void UnderOverElement::layout( const AttributeManager* am ) { double thinSpace = am->layoutSpacing( this ); double accent = am->boolOf( "accent", this ); //Whether to add a space above double accentUnder = am->boolOf( "accentunder", this );//Whether to add a space below double largestWidth = m_baseElement->width(); largestWidth = qMax( m_underElement->width(), largestWidth ); largestWidth = qMax( m_overElement->width(), largestWidth ); QPointF origin( ( largestWidth - m_overElement->width() ) / 2.0, 0.0 ); m_overElement->setOrigin( origin ); origin.setX( ( largestWidth - m_baseElement->width() ) / 2.0 ); origin.setY( ( accent && m_overElement->height() != 0 ) ? 2*thinSpace : thinSpace ); m_baseElement->setOrigin( origin ); origin.setX( ( largestWidth - m_underElement->width())/2.0 ); origin.setY( origin.y() + accentUnder ? 2*thinSpace : thinSpace ); m_underElement->setOrigin( origin ); setWidth( largestWidth ); setHeight( origin.y() + m_underElement->height() ); setBaseLine( m_baseElement->origin().y() + m_baseElement->baseLine() ); }
void SpaceElement::layout( const AttributeManager* am ) { qreal height = am->doubleOf( "height", this ); setHeight( height + am->doubleOf( "depth", this ) ); setWidth( am->doubleOf( "width", this ) ); setBaseLine( height ); }
void SquareRootElement::layout( const AttributeManager* am ) { RowElement::layout( am ); kDebug(39001) << "Width: " << width(); kDebug(39001) << "Height: " << height(); double thinSpace = am->layoutSpacing( this ); double linethickness = 1; double symbolHeight = baseLine(); if( height() > symbolHeight*1.3 ) symbolHeight = height(); symbolHeight += thinSpace; double tickWidth = symbolHeight / 3.0; // Set the sqrt dimensions setWidth( tickWidth + width() + thinSpace ); setHeight( height() + thinSpace ); setBaseLine( baseLine() + thinSpace ); // Adapt the children's positions to the new offset QPointF childOffset( tickWidth + thinSpace, thinSpace ); foreach( BasicElement* element, childElements() ) element->setOrigin( element->origin() + childOffset ); // Draw the sqrt symbol into a QPainterPath as buffer m_rootSymbol = QPainterPath(); m_rootSymbol.moveTo( linethickness, 2.0 * symbolHeight / 3.0 ); m_rootSymbol.lineTo( 0 + tickWidth/2.0, symbolHeight-linethickness/2 ); m_rootSymbol.lineTo( 0 + tickWidth, linethickness/2 ); m_rootSymbol.lineTo( width() - linethickness/2, linethickness/2 ); }
void SquareRootElement::layout( const AttributeManager* am ) { RowElement::layout( am ); qreal thinSpace = am->layoutSpacing( this ); qreal symbolHeight = baseLine(); if( height() > symbolHeight*1.3 ) symbolHeight = height(); symbolHeight += thinSpace; qreal tickWidth = symbolHeight / 3.0; m_lineThickness = am->lineThickness(this); // Set the sqrt dimensions QPointF childOffset( tickWidth + thinSpace, thinSpace + m_lineThickness ); setWidth( width() + childOffset.x()); setHeight( height() + childOffset.y()); setBaseLine( baseLine() + childOffset.y()); // Adapt the children's positions to the new offset foreach( BasicElement* element, childElements() ) element->setOrigin( element->origin() + childOffset ); QRectF rect = childrenBoundingRect(); rect.translate(childOffset); setChildrenBoundingRect(rect); // Draw the sqrt symbol into a QPainterPath as buffer m_rootSymbol = QPainterPath(); m_rootSymbol.moveTo( m_lineThickness, 2.0 * symbolHeight / 3.0 ); m_rootSymbol.lineTo( 0 + tickWidth/2.0, symbolHeight-m_lineThickness/2 ); m_rootSymbol.lineTo( 0 + tickWidth, m_lineThickness/2 ); m_rootSymbol.lineTo( width() - m_lineThickness/2, m_lineThickness/2 ); }
SGMFastScanSettings& SGMFastScanSettings::operator =(const SGMFastScanSettings &other){ if(this != &other){ AMDbObject::operator=(other); setRunSeconds(other.runSeconds()); setMotorSettings(other.motorSettings()); setScalerTime(other.scalerTime()); setBaseLine(other.baseLine()); setUndulatorVelocity(other.undulatorVelocity()); } return *this; }
int RankManager::setGyoChaeSigi(){ cout << setBaseLine() << "분기입니다." << endl; setBaseLine(); // 랭킹정보받고 maesuIndex = getMeasueIndex(); if (maesuIndex != -1){ if (ExSection == 60){ if ((remainDay + 2) % 4 == 0){ maedoIndex = 40 - maesuIndex + 1; } else{ maedoIndex = 40 - maesuIndex; } } else{ maedoIndex = 40 - maesuIndex; } } cout << "매수 index : " << maesuIndex << endl; cout << "매도 index : " << maedoIndex << endl; return 0; }