Results 1 to 5 of 5

Thread: expected type-specifier before 'QwtLog10ScaleEngine'

  1. #1
    Join Date
    Mar 2014
    Posts
    11
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default expected type-specifier before 'QwtLog10ScaleEngine'

    Version: qwt 6.0.1
    I've tried to develop logarithmic scaling for Spectrum.
    I've used simple line to enable scaling plotspectrum->setAxisScaleEngine(QwtPlot::yLeft, new QwtLog10ScaleEngine);

    Problems: the data are not drawn, so the plot is empty and the compiler returns following error:"expected type-specifier before 'QwtLog10ScaleEngine'"
    Any help woulb be appreciated
    Here is my code:

    class SpectrumPlot : public QWidget
    {
    Q_OBJECT
    public:
    PlotSpektrum();
    private:
    QHBoxLayout* m_SpectrumLayout;
    QwtPlot* m_SpectrumPlot;
    QwtPlotCurve* m_SpectrumCurve;
    QwtPlotMarker* m_Marker;
    };

    SpectrumPlot::SpectrumPlot()
    {
    m_SpectrumLayout = new QHBoxLayout();
    m_SpectrumPlot = new QwtPlot();
    m_SpectrumCurve = new QwtPlotCurve();
    QwPlotGrid* pGrid = new QwtPlotGrid();
    QPen GridPen;
    GridPen.setColor(Qt::green);
    GridPen.setWidthF(0.7);
    GridPen.setStyle(Qt:ashLine);
    QPen SpectrumPen;
    SpectrumPen.setColor(Qt::white);

    pGrid->setRenderHint(QwtPlotItem::RenderAntialiased);
    pGrid->setPen(GridPen);
    pGrid->enableXMin(true);
    pGrid->attach(m_SpectrumPlot);
    m_SpectrumPlot->setTitle("Spectrum");
    m_SpectrumPlot->setCanvasBackground(QBrush(Qt::black));
    m_SpectrumPlot->setAutoDelete(true);
    m_SpectrumPlot->setAxisTitle(QwtPlot::xBottom, "Frequency Hz");
    m_SpectrumPlot->setAxisScale(QwtPlot::xBottom, 100, nNyquistFrequency);
    m_SpectrumPlot->setAxisScale(QwtPlot::yLeft, 0, 150);
    m_SpectrumPlot->setAxisScaleEngine(QwtPlot::xBottom, new QwtLog10ScaleEngine());
    m_SpectrumLayout->addWidget(m_SpectrumPlot);

    this->setLayout(m_SpectrumLayout);
    }

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: expected type-specifier before 'QwtLog10ScaleEngine'

    Qt Code:
    1. #include <qwt_scale_engine.h>
    To copy to clipboard, switch view to plain text mode 
    Uwe

  3. #3
    Join Date
    Mar 2014
    Posts
    11
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default Re: expected type-specifier before 'QwtLog10ScaleEngine'

    Uwe! I've already included< qwt_scale_engine.h>
    I have and I've had the same error


    Added after 7 minutes:


    here is my header
    #include "kiss_fft.h"
    #include "kiss_fftr.h"

    #include <QSharedPointer>
    #include <QWidget>
    #include <QHBoxLayout>
    #include <QVector>
    #include <qwt_plot.h>
    #include <qwt_plot_curve.h>
    #include <qwt_plot_grid.h>
    #include <qwt_scale_engine.h>
    #include <qwt_plot_marker.h>
    Last edited by Bangalaman; 4th July 2014 at 13:26.

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: expected type-specifier before 'QwtLog10ScaleEngine'

    Well - at least in Qwt 6.1 - the name of the class is QwtLogScaleEngine.

    Uwe

  5. #5
    Join Date
    Mar 2014
    Posts
    11
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default Re: expected type-specifier before 'QwtLog10ScaleEngine'

    Thank you for reply and help . it works fine now . my mystake was the Qwt's version , I already use Qwt 6.1 not 6.0.1, I've changed QwtLog10ScaleEngine to QwtLogScaleEngine

Similar Threads

  1. Replies: 1
    Last Post: 19th July 2012, 00:32
  2. Problems with QwtLog10ScaleEngine
    By Gordey1978 in forum Qwt
    Replies: 3
    Last Post: 28th September 2011, 08:06
  3. Replies: 12
    Last Post: 8th July 2011, 06:23
  4. expected type-specifier | not declared in this scope
    By Alain Delon in forum General Programming
    Replies: 2
    Last Post: 23rd February 2011, 08:17
  5. Replies: 12
    Last Post: 28th May 2010, 01:07

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.