Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

to show a qwt3d object at somewhere specified



  • Hello,
    I want to use GridPlot to show points given by serial port data. I tried duplicating a demo and re-configure its project as a single project. That works well but don't know how I can show it in another UI.
    For example, the object is declared as a member of TestGUI inheritted from QMainWindow
    #include <QMainWindow>
    #include "difplot.h" // given simply qwt3d plot things

    namespace Ui {
    class TestGui;
    }

    class TestGui : public QMainWindow
    {
    Q_OBJECT

    public:
    explicit TestGui(QWidget *parent = 0);
    ~TestGui();

    private:
    Ui::TestGui *ui;

    Qwt3D::GridPlot * oPlot;
    

    };
    #endif // TESTGUI_H

    What I can do to show it in TestGui.cpp if the main.cpp given as
    #include "testgui.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    TestGui w;
    w.show();

    return a.exec();
    

    }


  • Lifetime Qt Champion

    Hi,

    Does TestGui contain a layout ? If so just add your plot widget to that layout.


Log in to reply