This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KPlotWidget // KPlotObject named in nested name specifier ?!

Tags: None
(comma "," separated)
seuchato
Registered Member
Posts
4
Karma
0
Hi all

I am trying to follow this https://techbase.kde.org/Development/Tutorials/KPlotWidget.

I am trying to do this on:
PC i5 4790s, 32 GB Ram
OpenSUSE Leap 15.3, up to date as of Feb. 25th 22
Kdevelop from official suse repo, version 5.6.1, KDE Frameworks 5.76.0, Qt 5.12.7 (compiled against 5.12.7), The xcb windowsystem

in mainwindow.cpp I have a funtion
Code: Select all
void MainWindow::SetPlot()
{
   
    ui->kplotwidget->setMinimumSize( 400, 400 );
    ui->kplotwidget->setAntialiasing( true );

    // Set the boundaries of the plot to display the full extent of the sine curve:
    ui->kplotwidget->setLimits( -0.1, 6.38, -1.1, 1.1 );

    // Create a KPlotObject which will display data
    // points by connecting them with red line segments
    // with a width of 2 pixels:
    KPlotObject *sineobj = new KPlotObject( Qt::red, KPlotObject::Lines, 2 ); // this fails!
   
    ui->kplotwidget->update();
   
}


The error I get is this:
mainwindow.cpp:63:54: error: incomplete type 'KPlotObject' named in nested name specifier
kplotwidget.h:17:7: note: forward declaration of 'KPlotObject'


How can I solve this?
greez
chris
seuchato
Registered Member
Posts
4
Karma
0
Hi
Got it solved:
Code: Select all
#include <KPlotObject>
#include <KPlotAxis>
#include <KPlotPoint>

needs to be added and that's it. Got it from here: https://gist.github.com/wiless/5711253

greez
chris


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]