QPointerEvent throws error
-
@curiosity said in QPointerEvent throws error:
Now it is working as expected
Great, then mark the topic as solved.
Beside the discussion about syntax and other stuff and I believe it was mentioned here before....
your lambda is not needed and the content does not make too much sense.Window::onCurrentTextChanged(text);
In what scope this is called? If you are in
Window
and you passthis
to your labda, you don't need the fully qualified function name.echoLineEdit->show();
Calling
show()
after the text has changed is not needed unless you never insert text manully but always set text programmatically withsetText(...)
.
But even then, connecting to slotonCurrentTextChanged(text)
inWindow
would be way easier. -
Hi,
QPointerEvent is not identified in the program. i am using Qt 5.12.12. Any suggestions?@curiosity Please read https://doc.qt.io/qt-6/qeventpoint.html
Especially the "Since:" part. -
@curiosity Please read https://doc.qt.io/qt-6/qeventpoint.html
Especially the "Since:" part. -
@curiosity What do you actually want to do?
-
@curiosity What do you actually want to do?
if (touchEvent->touchPoints().count() == 2) { const QEventPoint &touchPoint1 = touchEvent->touchPoints().first(); const QEventPoint &touchPoint2 = touchEvent->touchPoints().last(); QLineF line1(touchPoint1.sceneLastPosition(), touchPoint2.sceneLastPosition()); QLineF line2(touchPoint1.scenePosition(), touchPoint2.scenePosition()); setTransform(QTransform().rotate(line2.angleTo(line1)), true); }
this is the code .. i need 2 point on the screen
-
if (touchEvent->touchPoints().count() == 2) { const QEventPoint &touchPoint1 = touchEvent->touchPoints().first(); const QEventPoint &touchPoint2 = touchEvent->touchPoints().last(); QLineF line1(touchPoint1.sceneLastPosition(), touchPoint2.sceneLastPosition()); QLineF line2(touchPoint1.scenePosition(), touchPoint2.scenePosition()); setTransform(QTransform().rotate(line2.angleTo(line1)), true); }
this is the code .. i need 2 point on the screen
When you use Qt5 then you should look at the Qt5 documentation of QTouchEvent and use the correct return type: https://doc.qt.io/qt-5/qtouchevent.html#touchPoints
-
When you use Qt5 then you should look at the Qt5 documentation of QTouchEvent and use the correct return type: https://doc.qt.io/qt-5/qtouchevent.html#touchPoints
I am getting a lot of linker errors. probably QApplication is not resolved while compiling. or what is the possible reason
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "protected: virtual void __cdecl QGraphicsItem::keyReleaseEvent(class QKeyEvent *)" (?keyReleaseEvent@QGraphicsItem@@MEAAXPEAVQKeyEvent@@@Z) TouchPadProj C:\Users\source\repos\TouchProj\TouchProj\Touchpad.obj 1 -
I am getting a lot of linker errors. probably QApplication is not resolved while compiling. or what is the possible reason
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "protected: virtual void __cdecl QGraphicsItem::keyReleaseEvent(class QKeyEvent *)" (?keyReleaseEvent@QGraphicsItem@@MEAAXPEAVQKeyEvent@@@Z) TouchPadProj C:\Users\source\repos\TouchProj\TouchProj\Touchpad.obj 1@curiosity Then you should link against QtGui as shown in the documentation.
-
I am getting a lot of linker errors. probably QApplication is not resolved while compiling. or what is the possible reason
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "protected: virtual void __cdecl QGraphicsItem::keyReleaseEvent(class QKeyEvent *)" (?keyReleaseEvent@QGraphicsItem@@MEAAXPEAVQKeyEvent@@@Z) TouchPadProj C:\Users\source\repos\TouchProj\TouchProj\Touchpad.obj 1 -
@curiosity And why don't you do what I told you then? When you want to use a library then you have to link against this library...
-
@curiosity And why don't you do what I told you then? When you want to use a library then you have to link against this library...
this is my .pro file
QT += gui // I guess this is how you suggested
QT += widgets-lQtGui
HEADERS = knob.h
SOURCES = main.cpp knob.cppinstall
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/touch/knobs
INSTALLS += targetthis didnt work
-
this is my .pro file
QT += gui // I guess this is how you suggested
QT += widgets-lQtGui
HEADERS = knob.h
SOURCES = main.cpp knob.cppinstall
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/touch/knobs
INSTALLS += targetthis didnt work
-
-
@curiosity But what is it doing as you show in the middle of your
.pro
file? It will likely make it incorrect. -
@curiosity First: this linker flag is not needed. Second: the way you added it is wrong and makes no sense.
-
@curiosity But what is it doing as you show in the middle of your
.pro
file? It will likely make it incorrect.I removed it. also #include <QApplication> is not resolved by the compiler. i have to include the entire path/absolute path something like this
#include <C:\Qt\Qt5.12.12\5.12.12\winrt_x64_msvc2017\include\QtWidgets\QApplication> which is not the right way
-
I removed it. also #include <QApplication> is not resolved by the compiler. i have to include the entire path/absolute path something like this
#include <C:\Qt\Qt5.12.12\5.12.12\winrt_x64_msvc2017\include\QtWidgets\QApplication> which is not the right way
@curiosity said in QPointerEvent throws error:
also #include <QApplication> is not resolved by the compiler
Then something is wrong with your project configuration.
Did you rerun qmake after editing the pro file?
It also looks like you're using Visual Studio - I never used it with Qt, but maybe you need to recreate project files after changing pro file? -
@curiosity said in QPointerEvent throws error:
also #include <QApplication> is not resolved by the compiler
Then something is wrong with your project configuration.
Did you rerun qmake after editing the pro file?
It also looks like you're using Visual Studio - I never used it with Qt, but maybe you need to recreate project files after changing pro file? -
@curiosity First: this linker flag is not needed. Second: the way you added it is wrong and makes no sense.
-
@curiosity
Start by showing definition of the two slot functions you use.
Is this an error only in the code completion inside Qt Creator, or do you get these errors when you actually compile?