QwtText QwtSupersciptsScaleDraw::label(double value) const { char f; int prec; labelFormat(f, prec); QString txt = QLocale().toString(transformValue(value), 'e', prec); QStringList list = txt.split( "e", QString::SkipEmptyParts); if (list[0].toDouble() == 0.0) return QString("0"); QString s= list[1]; int l = s.length(); QChar sign = s[0]; s.remove (sign); while (l>1 && s.startsWith ("0", false)) { s.remove ( 0, 1 ); l = s.length(); } if (sign == '-') s.prepend(sign); if (list[0] == "1") return QwtText("10<sup>" + s + "</sup>"); else return QwtText(list[0] + "x10<sup>" + s + "</sup>"); }
void FctnDialog::statSwitch(int i){ int j = factory->getVariables(op); labelFormat(i!=1); if(j == 2){ label2->setHidden(i == 1); line2->setHidden(i == 1); } else if (j==3){ label3->setHidden(i == 1); line3->setHidden(i == 1); } else{ label4->setHidden(i == 1); line4->setHidden(i == 1); } }
QgsGraduatedSymbolRenderer *QgsGraduatedSymbolRenderer::clone() const { QgsGraduatedSymbolRenderer *r = new QgsGraduatedSymbolRenderer( mAttrName, mRanges ); r->setMode( mMode ); if ( mSourceSymbol ) r->setSourceSymbol( mSourceSymbol->clone() ); if ( mSourceColorRamp ) { r->setSourceColorRamp( mSourceColorRamp->clone() ); } r->setUsingSymbolLevels( usingSymbolLevels() ); r->setDataDefinedSizeLegend( mDataDefinedSizeLegend ? new QgsDataDefinedSizeLegend( *mDataDefinedSizeLegend ) : nullptr ); r->setLabelFormat( labelFormat() ); r->setGraduatedMethod( graduatedMethod() ); copyRendererData( r ); return r; }
QgsGraduatedSymbolRenderer* QgsGraduatedSymbolRenderer::clone() const { QgsGraduatedSymbolRenderer* r = new QgsGraduatedSymbolRenderer( mAttrName, mRanges ); r->setMode( mMode ); if ( mSourceSymbol.data() ) r->setSourceSymbol( mSourceSymbol->clone() ); if ( mSourceColorRamp.data() ) { r->setSourceColorRamp( mSourceColorRamp->clone() ); r->setInvertedColorRamp( mInvertedColorRamp ); } r->setUsingSymbolLevels( usingSymbolLevels() ); r->setLabelFormat( labelFormat() ); r->setGraduatedMethod( graduatedMethod() ); copyRendererData( r ); return r; }
QgsFeatureRendererV2* QgsGraduatedSymbolRendererV2::clone() const { QgsGraduatedSymbolRendererV2* r = new QgsGraduatedSymbolRendererV2( mAttrName, mRanges ); r->setMode( mMode ); if ( mSourceSymbol.data() ) r->setSourceSymbol( mSourceSymbol->clone() ); if ( mSourceColorRamp.data() ) { r->setSourceColorRamp( mSourceColorRamp->clone() ); r->setInvertedColorRamp( mInvertedColorRamp ); } r->setUsingSymbolLevels( usingSymbolLevels() ); r->setSizeScaleField( sizeScaleField() ); r->setLabelFormat( labelFormat() ); r->setGraduatedMethod( graduatedMethod() ); copyPaintEffect( r ); return r; }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RiuGridCrossQwtPlot::selectSample(QwtPlotCurve* curve, int sampleNumber) { QPointF sample = curve->sample(sampleNumber); m_selectedPointMarker->setValue(sample); m_selectedPointMarker->setAxes(QwtPlot::xBottom, QwtPlot::yLeft); m_selectedPointMarker->attach(this); QString curveName, xAxisName, yAxisName; if (curveText(curve, &curveName, &xAxisName, &yAxisName)) { QString labelFormat("<div style=\"margin: 4px;\"><b>%1:</b><br/>%2 = %3, %4 = %5</div>"); QString labelString = labelFormat.arg(curveName).arg(xAxisName).arg(sample.x()).arg(yAxisName).arg(sample.y()); QwtText curveLabel(labelString, QwtText::RichText); curveLabel.setBackgroundBrush(QBrush(QColor(250, 250, 250, 220))); curveLabel.setPaintAttribute(QwtText::PaintBackground); curveLabel.setBorderPen(QPen(Qt::black, 1.0)); curveLabel.setBorderRadius(2.0); m_selectedPointMarker->setLabel(curveLabel); } replot(); }
void FctnDialog::make_visible(/*MaceInt characteristic,*/ QListWidgetItem *item){ ok = false; QVariant func_type; func_type = item->data(100); op = func_type.toString(); fctnCode = factory->getCode(op); info->setHtml(factory->help_info(op,fctnCode)); if (fctnCode == 200) { func_type = item->data(101); op = func_type.toString(); } pLabel->setHidden(true); pBox->setHidden(true); pLabel2->setHidden(true); pBox2->setHidden(true); label1->setVisible(true); line1->setVisible(true); line1->setContextMenuPolicy(Qt::DefaultContextMenu); if(fctnCode >= 100){ setWindowTitle(factory->get_typeName(fctnCode)); labelFormat(!tab->currentIndex()); selectLabels(); } line1->all = true; tab->setVisible(fctnCode == 131); linesFormat(factory->getVariables(op),fctnCode,tab->currentIndex()); line1->clear(); line2->clear(); line3->clear(); line4->clear(); this->setMaximumHeight(80); if(fctnCode <100){ line1->all = false; } else { line1->all = true; line2->all = true; line3->all = true; line4->all = true; } info->setHidden(true); layout()->setSizeConstraint(QLayout::SetFixedSize); but->setFocus(); emit hello(); this->show(); }