Delete message after x seconds
-
I just tried the singleshot but i get an error:
Der Prozedureinsprungpunkt "?defaultTypeFor@QTimer@@CA?AQ4TimerType@Qt@@H@Z" wurde in der DLL "C:\Program Files\TeamSpeak 3 Client\plugins\qtTyOverlay_x64.dll" nicht gefunden.
any ideas what this is about??
-
@QT-static-prgm
well i think we need to see some code :)The error seems to be about qtTyOverlay_x64
so its clearly not a normal setup.QTimer lives in
QT += core
so its never missingso you need to provide more info if we shall guess at what is going on.
-
Yeah i didn't push it to the git server yet. But here you go:
https://git.rwth-aachen.de/carstenf/CuteOverlay/blob/master/plugin.cpp -
Hmm. very strange. Does other class from Qt work ?
-
yeah the labels work fine.
But i noticed that my "stay always on top" does not work ingame. So when i play my game it is over my overlay plugin
-
Which version of Qt are you using ?
What are you using to compile your plugin ? -
I have multiple versions of qt. To compile I use 5.8.0 compiled with VS x64.
In my environment variables I have an older version of qt x86 but I already changed that to the x64 version (I compiled with) and it didn't worked. Is there maybe a way to tell the code explicit what version should be used?? (already put all x64 dll in the directory of my plugin dll but didn't worked)
I know that ts3 uses qt as well but I don't know what version. But since I have the x64 version of ts it's something x64.
-
Then you should first check which version of Qt TeamSpeak is using and its architecture.
-
@SGaist it says nothing about the architecture. But the Software is x64 (I'm sure because x86 plugins do not work and it's installed to Program Files instead of Program Files x86)
The version is 5.6.1==EDIT==
the project setup was garbage. So i made a new clean project structure and pushed to this repo: https://git.rwth-aachen.de/carstenf/qtTsOverlay/tree/master
nothing changed, it's just on my local harddrive and the project link
-
Then you should use the same version as they are to build your plugin.
-
did qt 5.6 already supported lampda instead of slots??
-
@QT-static-prgm
Hi
Its foremost a compiler thing. (c++11)
and then Qt
https://wiki.qt.io/New_Signal_Slot_Syntax -
I just added an own QTimer to my program and removed the static signelshot. Now it looks like this:
https://git.rwth-aachen.de/carstenf/qtTsOverlay/blob/master/overlaycontroller.cpp#L22But NOTHING happens. even after 30 sec there is still no output. Any ideas about that??
While i'm playing a bit around with the qtimer and an other problem i compile qt 5.6.1 for vs x64. Hopefully the singleshot works then.
-
@QT-static-prgm
Hi
This is wrong
connect(m_timer, SIGNAL(timeout()), this, SLOT(debugPrint("HUHU")));You CANNOT add parameters/values to the connect. HUHU is 100% wrong.
and please check the return value or use the new syntax.qDebug() <<" conn ok:" << connect(m_timer, SIGNAL(timeout()), this, SLOT(debugPrint()));
and debugPrint should not have any paramters
void OverlayController::debugPrint(
QString text)Please read the docs
http://doc.qt.io/qt-5/signalsandslots.html
its very important to understand how it works. -
connect(m_timer, SIGNAL(timeout()), this, SLOT(debugPrint("HUHU")));
I'm pretty sure you can't give a Slot a parameter like that. You don't get an error because the old syntax checks signal slots during run not compile time.
but in your console you should get an error warning when yiu start the programm concerning Signal/slot connection.
//have you tried it like this ? since its qt5+ that you're using QTimer::signleShot(100, this, [=]{qDebug() << " huhu";});
-
@J-Hilk please read the posts above. That causes a procedure error.
@mrjj You are right. without parameter works it just fine.
But i cannot use qDebug() since i don't have any console or something like that. My debugPrint(QString text) just writes to a new Label.
==UPDATE==
https://git.rwth-aachen.de/carstenf/qtTsOverlay/blob/master/overlaycontroller.cpp
That way it works just the way it should. After 5 sec the chat lines are hide and if you write something it is displayed again :D
qt is still compiling, so when it's done i'm gonna test the singleshot -
@QT-static-prgm
Ok so you do not run program from Creator ? -
@mrjj No i write the code in Visual Studio and compile to .dll that comes to the plugin folder from TeamSpeak3 and TS will load it.
-
Oh, that way. so the qt code is inside your custom TS plugin.
"yeah the labels work fine."
As i understand it, you are already using the Qlabel classes or some other
part of Qt and only the QTimer gives errors? -
@mrjj yes that's right (did you look in my code??)
I just finished compiling qt 5.6.1 for x64 VS and now the singleshot works fine. So it need to be a problem of the newer version.
So now i have multiple ways to implement my chat disable function:
- with single shot and lambda to delete every single line after 5 sec
- the way it is right now, display the latest 5 lines and just hide them after 5 sec. when something is written again, it's shown again.
But that's a kind of Luxus problem, now that it is working. Now i have just 2 other big problems (label transparency, and stay always infront does nto work for games in fullscreen). When those are fixed i can start with the cosmetic :D
First i need to solve the main functionality. Maybe you can help me with the transparency problem, too.