*/
Plot2d_QwtLegendLabel::~Plot2d_QwtLegendLabel()
{
+ delete mySymbol;
}
/*!
*/
void Plot2d_QwtLegendLabel::setSymbol( const QwtSymbol* theSymbol )
{
+ delete mySymbol;
mySymbol = new QwtSymbol( theSymbol->style(), theSymbol->brush(),
theSymbol->pen(), theSymbol->size() );
}
if ( itemMode() != QwtLegendData::ReadOnly )
iconRect.setX( iconRect.x() + ButtonFrame );
iconRect.setSize( QSize( icon().size().width() + spacing() ,
- icon().size().height() + spacing() ) );
+ icon().size().height() + spacing() ) );
iconRect.moveCenter( QPoint( iconRect.center().x(), cr.center().y() ) );
}
if( QWidget* widget = legend->legendWidget( itemInfo ) ) {
QwtLegendLabel* label = dynamic_cast<QwtLegendLabel*>( widget );
if( Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label ) {
- int aMode = Plot2d_QwtLegendLabel::IM_None;
- if( myYAxisIdentifierEnabled )
- aMode = myYAxis == QwtPlot::yRight ?
- Plot2d_QwtLegendLabel::IM_Right :
- Plot2d_QwtLegendLabel::IM_Left;
- anItem->setYAxisIdentifierMode( aMode );
-
- anItem->setSymbol( legendSymbol() );
- if( Plot2d_Plot2d* plot = dynamic_cast<Plot2d_Plot2d*>( thePlotItem->plot() ) )
- anItem->setSymbolType( plot->getLegendSymbolType() );
- anItem->setPen( legendPen() );
-
- anItem->setSelected( isSelected() );
- anItem->updateHighlit();
- anItem->repaint();
+ int aMode = Plot2d_QwtLegendLabel::IM_None;
+ if( myYAxisIdentifierEnabled )
+ aMode = myYAxis == QwtPlot::yRight ?
+ Plot2d_QwtLegendLabel::IM_Right :
+ Plot2d_QwtLegendLabel::IM_Left;
+ anItem->setYAxisIdentifierMode( aMode );
+
+ anItem->setSymbol( legendSymbol() );
+ if( Plot2d_Plot2d* plot = dynamic_cast<Plot2d_Plot2d*>( thePlotItem->plot() ) )
+ anItem->setSymbolType( plot->getLegendSymbolType() );
+ anItem->setPen( legendPen() );
+
+ anItem->setSelected( isSelected() );
+ anItem->updateHighlit();
+ anItem->repaint();
}
}
}
painter->drawLine(xp,ytop,xp,ybtm);
painter->drawLine(tickl,ybtm,tickr,ybtm);
}
- painter->restore();
+ painter->restore();
}
}
Sets histogram attributes
*/
void Plot2d_HistogramQwtItem::setHistogramAttribute( HistogramAttribute theAttr,
- bool isOn )
+ bool isOn )
{
if ( testHistogramAttribute( theAttr ) != isOn ) {
if ( isOn )
Draws histogram object
*/
void Plot2d_HistogramQwtItem::draw( QPainter* thePainter,
- const QwtScaleMap& theXMap,
- const QwtScaleMap& theYMap,
- const QRectF& ) const
+ const QwtScaleMap& theXMap,
+ const QwtScaleMap& theYMap,
+ const QRectF& ) const
{
thePainter->setPen( QPen( myColor ) );
Draws single bar of histogram
*/
void Plot2d_HistogramQwtItem::drawBar( QPainter* thePainter,
- Qt::Orientation,
- const QRect& theRect ) const
+ Qt::Orientation,
+ const QRect& theRect ) const
{
thePainter->save();
Draws histogram object
*/
void Plot2d_HistogramItem::draw( QPainter* thePainter,
- const QwtScaleMap& theXMap,
- const QwtScaleMap& theYMap,
- const QRectF& ) const
+ const QwtScaleMap& theXMap,
+ const QwtScaleMap& theYMap,
+ const QRectF& ) const
{
// nds: clear list of bar items
Plot2d_HistogramItem* anItem = (Plot2d_HistogramItem*)this;
Draws bar of histogram and on it bars of histograms with lower height.
*/
void Plot2d_HistogramItem::drawRectAndLowers( QPainter* thePainter,
- Qt::Orientation theOr,
- const QRect& theRect ) const
+ Qt::Orientation theOr,
+ const QRect& theRect ) const
{
QRect aRect = theRect;
// theRect has inversed coordinates on Y axis.
qMin( theRect.left(), aRects[i].left() ) ) {
if ( theRect.bottom() < aRects[i].bottom() )
if ( aRects[i].bottom() < aRes )
- aRes = aRects[i].bottom();
+ aRes = aRects[i].bottom();
}
}
}