It does not work, if I use "parentWidget()->updateChromosome()". The error says:
plot.cpp:453: error: 'class QWidget' has no member named 'updateChromosome'
my mainFrame looks like this:
mainframe.h:
#include "plot.h"
#include <qwt_plot_picker.h>
using namespace std;
{
Q_OBJECT
public:
...
#include "plot.h"
#include <qwt_plot_picker.h>
using namespace std;
class mainFrame : public QMainWindow
{
Q_OBJECT
public:
mainFrame(QWidget *parent = 0);
...
To copy to clipboard, switch view to plain text mode
mainframe.cpp:
mainFrame
::mainFrame(QWidget *parent
){
ui.setupUi(this);
...
d_plot = new Plot(this);
layout_plot->addWidget(d_plot);
mainFrame::mainFrame(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
...
d_plot = new Plot(this);
layout_plot->addWidget(d_plot);
To copy to clipboard, switch view to plain text mode
So how to get the pointer to the mainFrame class?
My idea was to include mainframe.h into plot.h and declare there
mainFrame *_mf;
mainFrame *_mf;
To copy to clipboard, switch view to plain text mode
and then store the passed pointer to it, but I have already includede plot.h into mainframe.h, so there will be conflict!
Help me please.
Bookmarks