News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

QMouseEvent

Started by der_burner, January 22, 2010, 09:03:27 AM

Previous topic - Next topic

der_burner

Hello together,

i had an Problem with Code::Blocks, qt4 and qtOpenGl.

An easy example from http://mih.voxindeserto.de/threadedcube.html I downloaded and want to build in Code::Blocks. After some Problems to Found the QT Libaries I have only one error. And I don't know how I can solve it.

I get every time the Error Message:


||=== qt4test, Debug ===|
exampleglwidget.cpp|2|error: QMouseEvent: No such file or directory|
exampleglwidget.cpp||In member function 'virtual void ExampleGLWidget::mouseMoveEvent(QMouseEvent*)':|
exampleglwidget.cpp|34|error: 'class QMouseEvent' has no member named 'buttons'|
exampleglwidget.cpp|39|error: 'class QMouseEvent' has no member named 'buttons'|
||=== Build finished: 3 errors, 0 warnings ===|


Why Code:Blocks couldn't find QMouseEvent?
The Inclue
#include <QApplication>
he found, also if I insert the #include <qevent.h> but then the class QMouseEvent has no member named buttons always displayed.

In KDevelop the same code is build without Errors. But I don't like KDevelop, I want to use Code:Blocks.

Can somebody help me?

MortenMacFly

Quote from: der_burner on January 22, 2010, 09:03:27 AM
i had an Problem with Code::Blocks, qt4 and qtOpenGl.
Seeing your error message you don't have a problem with code::blocks, but with the compiler - it is complaining.

Quote from: der_burner on January 22, 2010, 09:03:27 AM
Can somebody help me?
You most likely missing to set the include path's so the compiler can find all required header files (or it picks the wrong ones  in case you setup a wrong include path). To "debug", enable the full compiler log (see my signature) and post again. Please post the full log.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

der_burner

I found the error! The Function buttons() in QMouseEvent don't exists button() is the right one ;)

But now I have an other Problem:


examplerenderthread.o||In function `ExampleRenderThread::draw()':|
/qt4test/examplerenderthread.cpp|137|undefined reference to `glMatrixMode'|
/qt4test/examplerenderthread.cpp|138|undefined reference to `glLoadIdentity'|
/qt4test/examplerenderthread.cpp|139|undefined reference to `glTranslatef'|
/qt4test/examplerenderthread.cpp|140|undefined reference to `glRotatef'|
/qt4test/examplerenderthread.cpp|141|undefined reference to `glRotatef'|
/qt4test/examplerenderthread.cpp|142|undefined reference to `glRotatef'|
...
...
...


He's don't finde the OpenGL commands, I found in the Internet I must instert "QT += opengl" in the .pov file, I do! And I must set the additional linker options "-lglui -lglut -lGLU -lGL" but where I do that? When I insert it under Project->Build Options->Linker settings->other Linker options it will don't use!

Build Log:


g++  -o qt4test exampleglwidget.o examplerenderthread.o main.o    -L/usr/share/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm -lpthread




der_burner

I see g++ takes "-L/usr/share/qt3/lib" why? He should take QT4 where I can change it?

der_burner

ok, the solution of all Problems is easy I used qmake instead of qmake-qt4 ;)

Now all is right, Thank you for help