We love seeing you type, because it gives us the ability to "think into" the code. If I see code and do not write it, I read it like a book. Thus, I usually read over things that might be important. When you write and I see you writing, I must be slow in my reading and catch and understand more of the code. But that is just me...
I recommend people in general to avoid the old signal slots syntax in Qt 5.0+. The new syntax can help you catch a few errors at compile time(like wrong signals and slots definitions). Thanks for keeping up the good work...
At 12:40 you use 'foreach' while it would be better to use c++11 'for'. The syntax is 'for(const QString &str : arg) { }' It is many times faster than Qt foreach and it does not copy the container (like foreach does) and thus allow modifying the elements if needed. Superb video none the less. :-)
I was thinking the same. In this particular case it's not very bad since QString copy operation by default uses implicit sharing so it's not very expensive but anyways, I've seen many people use foreach wrongly(In production code)... If you have a C++11 compatible compiler then I like to do "for(auto& elem : container)".
I didn't have that bug, because I gave it a name "newInstanceLaunched". I think "newConnection" is not a good name for a signal Thank you for awesome tutorial! It works! p.s.I like to watch you typing! This makes it a little more like tutorial
For this solution to work on Windows (tried on 10) you should set setSocketOptions() to QLocalServer::WorldAccessOption (or what you need) for your QLocalServer object.
On Gentoo 64bit Qt 5.4.0 SingleInstance::HasPrevious() { ..... .. socket.write(); } This did not produce any readyReady() in the first prorgam opened. I had to do a socket.flush(); after write for it to work :) Just like with tcp/ip sockets..
We love seeing you type, because it gives us the ability to "think into" the code. If I see code and do not write it, I read it like a book. Thus, I usually read over things that might be important. When you write and I see you writing, I must be slow in my reading and catch and understand more of the code. But that is just me...
I recommend people in general to avoid the old signal slots syntax in Qt 5.0+. The new syntax can help you catch a few errors at compile time(like wrong signals and slots definitions).
Thanks for keeping up the good work...
At 12:40 you use 'foreach' while it would be better to use c++11 'for'. The syntax is 'for(const QString &str : arg) { }' It is many times faster than Qt foreach and it does not copy the container (like foreach does) and thus allow modifying the elements if needed. Superb video none the less. :-)
good to know :)
I was thinking the same. In this particular case it's not very bad since QString copy operation by default uses implicit sharing so it's not very expensive but anyways, I've seen many people use foreach wrongly(In production code)... If you have a C++11 compatible compiler then I like to do "for(auto& elem : container)".
Hell yes you're back to Qt
I didn't have that bug, because I gave it a name "newInstanceLaunched". I think "newConnection" is not a good name for a signal
Thank you for awesome tutorial! It works!
p.s.I like to watch you typing! This makes it a little more like tutorial
Damn!! Exactly what I've been looking for for days. Thanks yoh
I believe it's called Berkeley's Sockets in UNIX. What you were referring to in the beginning of your video. However, I might be wrong!
If you need some ideas for topics:
SSL Server
JSON
QTs Multimedia stuff like recording and playing audio
For this solution to work on Windows (tried on 10) you should set setSocketOptions() to QLocalServer::WorldAccessOption (or what you need) for your QLocalServer object.
On Gentoo 64bit Qt 5.4.0
SingleInstance::HasPrevious()
{
.....
..
socket.write();
}
This did not produce any readyReady() in the first prorgam opened.
I had to do a socket.flush(); after write for it to work :) Just like with tcp/ip sockets..
i need to make a Custom Widget