Compilation errors, createWindowContainer
-
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();
}
}
@ -
Hi and welcome to devnet,
Are you sure you are using a kit that uses Qt 5 ?
-
Yes, I am sure. Here is my screen
!http://imageshack.com/a/img845/7277/s6hk.png(a)! -
What does your .pro file look like, and what is the definition of a cuboid - does it inherit from QWindow ?
-
Thanks for answer. :)Here is my .pro file:
@QT += core gui 3dquickQT += widgets
TARGET = Platforma
TEMPLATE = appSOURCES += main.cpp
platforma.cpp
datastorage.cpp
datareceiver.cpp
cuboid.cppHEADERS +=
datastorage.h
datareceiver.h
platforma.h
cuboid.hFORMS += 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();
}
@