Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Compilation errors, createWindowContainer
Forum Updated to NodeBB v4.3 + New Features

Compilation errors, createWindowContainer

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wierzbka
    wrote on last edited by
    #1

    Hey, I have a problem, when I buid my program, I receive error: 'createWindowContainer' is not a member of 'QWidget'. I use Qt 5.3.0,I thought I had all the Qt5.3 header files installed, but am I missing something? I don't know what I am doin wrong. Can you help me solve it?
    This is my code:
    @#include<QTimer>
    #include<QWidget>
    #include<QDockWidget>
    #include "platforma.h"
    #include "ui_platforma.h"
    #include "qwt_plot.h"
    #include "qwt_plot_curve.h"

    Platforma::Platforma(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Platforma)
    {
    ui->setupUi(this);
    cuboid = new Cuboid();
    QWidget *c = QWidget::createWindowContainer(cuboid);
    ui->cuboid_frame->layout()->addWidget(c);
    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(refreshPlots()));
    timer->start(100);
    initPlots();
    cuboid->update();
    }
    void Platforma::refreshPlots()
    {
    receiver.receiveData();
    cuboid->angleX = receiver.angleX->points.back().y();
    cuboid->angleY = receiver.angleY->points.back().y();

    cuboid->update();
    

    }

    void Platforma::initPlots()
    {
    receiver.accelerometerX->curve->attach(ui->accelerometerX);
    receiver.accelerometerY->curve->attach(ui->accelerometerY);
    }

    Platforma::~Platforma()
    {
    delete ui;
    }

    void Platforma::on_pause_button_clicked()
    {
    if(timer->isActive())
    {
    timer->stop();
    }
    else
    {
    timer->start();
    }
    }
    @

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you sure you are using a kit that uses Qt 5 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wierzbka
        wrote on last edited by
        #3

        Yes, I am sure. Here is my screen
        !http://imageshack.com/a/img845/7277/s6hk.png(a)!

        1 Reply Last reply
        0
        • mranger90M Offline
          mranger90M Offline
          mranger90
          wrote on last edited by
          #4

          What does your .pro file look like, and what is the definition of a cuboid - does it inherit from QWindow ?

          1 Reply Last reply
          0
          • W Offline
            W Offline
            wierzbka
            wrote on last edited by
            #5

            Thanks for answer. :)Here is my .pro file:
            @QT += core gui 3dquick

            QT += widgets

            TARGET = Platforma
            TEMPLATE = app

            SOURCES += main.cpp
            platforma.cpp
            datastorage.cpp
            datareceiver.cpp
            cuboid.cpp

            HEADERS +=
            datastorage.h
            datareceiver.h
            platforma.h
            cuboid.h

            FORMS += platforma.ui

            unix:!macx: LIBS += -L$$PWD/../../../../../../../../../lib/ -lqwt

            INCLUDEPATH += $$PWD/../../../../../../../../../usr/include/qwt
            DEPENDPATH += $$PWD/../../../../../../../../../usr/include/qwt@

            and I used library Qt3D to create my cuboid, so it looks like:

            @#include "cuboid.h"
            #include "QGLBuilder"
            #include "QGLCube"

            Cuboid::Cuboid(QWidget *parent)
            {
            QGLBuilder builder;
            builder << QGL::Faceted;
            builder << QGLCube();
            cuboid = builder.finalizedSceneNode();
            angleX = 0;
            angleY = 0;
            }
            void Cuboid::paintGL(QGLPainter *painter)
            {
            //cuboid->draw(painter);
            painter->setStandardEffect(QGL::LitMaterial);

                painter->projectionMatrix().push();
                painter->modelViewMatrix().push();
                painter->modelViewMatrix().rotate(angleX, 1.0f, 0.0f, 0.0f);
                painter->modelViewMatrix().rotate(angleY, 0.0f, 0.0f, 1.0f);
                painter->modelViewMatrix().rotate(45.0f, 0.0f, 1.0f, 0.0f);
                cuboid->draw(painter);
                painter->projectionMatrix().pop();
                painter->modelViewMatrix().pop();
                painter->popSurface();
            

            }
            @

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved