当前位置: 首页>>代码示例>>C++>>正文


C++ QwtPlotCurve::isVisible方法代码示例

本文整理汇总了C++中QwtPlotCurve::isVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotCurve::isVisible方法的具体用法?C++ QwtPlotCurve::isVisible怎么用?C++ QwtPlotCurve::isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QwtPlotCurve的用法示例。


在下文中一共展示了QwtPlotCurve::isVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: savePlotSettings

void plotsDialog::savePlotSettings()
{

#ifdef Q_OS_WIN32
    QFile file("plotTemp.xml");
#endif
#ifdef Q_OS_MAC
    QDir dir = qApp->applicationDirPath();
    /*dir.cdUp();*/
    /*dir.cdUp();*/
    /*dir.cdUp();*/
    QString bundleDir(dir.absolutePath());
    QFile ofile(globalpara.caseName),file(bundleDir+"/plotTemp.xml");
#endif
    QTextStream stream;
    stream.setDevice(&file);
    QDomDocument doc;
    QDomElement plotData, currentPlot, general, legend, grid, curve;

    if(!file.open(QIODevice::ReadWrite | QIODevice::Text))
    {
        globalpara.reportError("Failed to open and load case file for plot data.",this);
        return;
    }
    else
    {
        if(!doc.setContent(&file))
        {
            globalpara.reportError("Failed to set document for the xml file for plot data.",this);
            file.close();
            return;
        }
        else
        {
            plotData = doc.elementsByTagName("plotData").at(0).toElement();

            for(int i = 0; i < tabs->count(); i++)
            {
                Plot* set_plot = dynamic_cast<Plot*>(tabs->widget(i));
                currentPlot = plotData.elementsByTagName(tabs->tabText(i)).at(0).toElement();

                //general
                if(currentPlot.elementsByTagName("general").count()==0)
                {
                    general = doc.createElement("general");
                    currentPlot.appendChild(general);
                }
                else general = currentPlot.elementsByTagName("general").at(0).toElement();
                general.setAttribute("bgColor",set_plot->canvasBackground().color().name());
                general.setAttribute("lMargin",set_plot->contentsMargins().left());
                general.setAttribute("rMargin",set_plot->contentsMargins().right());
                general.setAttribute("tMargin",set_plot->contentsMargins().top());
                general.setAttribute("bMargin",set_plot->contentsMargins().bottom());
                general.setAttribute("plotTitle",set_plot->title().text());
                general.setAttribute("xTitle",set_plot->axisTitle(QwtPlot::xBottom).text());
                general.setAttribute("yTitle",set_plot->axisTitle(QwtPlot::yLeft).text());

                //legend
                if(currentPlot.elementsByTagName("legend").count()==0)
                {
                    legend = doc.createElement("legend");
                    currentPlot.appendChild(legend);
                }
                else legend = currentPlot.elementsByTagName("legend").at(0).toElement();
                if(set_plot->externalLegend!=NULL||set_plot->internalLegend->isVisible())
                {
                    legend.setAttribute("plotLegend","on");
                    if(set_plot->internalLegend->isVisible())
                    {
                        legend.setAttribute("extInt","int");
                        legend.setAttribute("nCol",set_plot->internalLegend->maxColumns());
                        legend.setAttribute("legendSize",set_plot->internalLegend->font().pointSize());
                    }
                    else if(set_plot->externalLegend!=NULL)
                    {
                        legend.setAttribute("extInt","ext");
                        legend.setAttribute("extPos",0);
                    }
                }
                else legend.setAttribute("plotLegend","off");

                //grid
                if(currentPlot.elementsByTagName("grid").count()==0)
                {
                    grid = doc.createElement("grid");
                    currentPlot.appendChild(grid);
                }
                else grid = currentPlot.elementsByTagName("grid").at(0).toElement();
                if(set_plot->grid->xEnabled()||set_plot->grid->yEnabled())
                {
                    if(set_plot->grid->xEnabled())
                        grid.setAttribute("xMaj","on");
                    else grid.setAttribute("xMaj","off");
                    if(set_plot->grid->yEnabled())
                        grid.setAttribute("yMaj","on");
                    else grid.setAttribute("yMaj","off");
                    grid.setAttribute("majColor",set_plot->grid->majorPen().color().name());
                    grid.setAttribute("majSize",set_plot->grid->majorPen().width());
                    int styleCode;
                    if(set_plot->grid->majorPen().style()==Qt::NoPen)
//.........这里部分代码省略.........
开发者ID:oabdelaziz,项目名称:SorpSim,代码行数:101,代码来源:plotsdialog.cpp


注:本文中的QwtPlotCurve::isVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。