1220
Link: @CplusplusQt Embedded: @EMBCpp • Allowed Topics: C++ and everything related to Qt • Use only English • No Private Message without asking user's permission • No NSFW • No Spam • No unauthorized Bots • No Offtopic • No Self Promotions
I wrote a suggestion for Qt: https://bugreports.qt.io/browse/QTBUG-141989
Читать полностью…
I'd probably implement it with grabbing the frame whenever it changes and then drawing it after rotation in the paint event.
Читать полностью…
I investigated this a bit last night and this morning, and I haven't figured out a good way to do this.
The way to do this that is most optimized would be to do the video playback in Qt Quick, and embed it in your Widgets app using a QQuickWidget — this way you get optimized rendering.
I don't know of a "pure widgets" way to do it, but another way that occurred to me is to do it in a QGraphicsScene - as that provides a way to transform Qt Widgets.
Hey - question about video playback. How do you change orientation of the video? I couldn't find anything to that end in QMediaPlayer or QVideoSink.
Читать полностью…
and interesting thing: if you make the same set and pass func as simple i64* ptr — it may be optimized and may be optimized completely if you use instead of vector<> MyStruct*
Читать полностью…
but this is preference, not reliable. use constexpr or templates hell (but it's crazy)
Читать полностью…
and x3 mem, but for small arrs copy approach is the best
Читать полностью…
never overuse constexpr or templates
calc, save to file, read. — anything that's faster can be cached, etc
I think this does it all at compile time:
#include <ranges>Читать полностью…
#include <array>
#include <iostream>
auto evenArray = std::views::iota(0, 10) | std::views::filter([](const auto& even) { return even % 2 == 0; })
| std::ranges::to<std::array>();
static_assert(even_numbers.size() == 5, "Incorrect size");
I wouldn't implement it this way because (to me) it's not immediately clear what the code does, i.e. (to me) it's not readable. I don't like code that I cannot immediately understand.
Читать полностью…
#include <ranges>
#include <vector>
#include <print>
int main() {
auto const evenNumbers= std::views::iota(0, 10)
| std::views::filter([](const auto& even) { return even % 2 == 0; })
| std::ranges::to<std::vector>();
std::println("Numbers: {}", evenNumbers);
}
I think you shouldn't learn the entire language, but rather the parts that are most commonly used. It depends on what you're going to do, so you choose the features of the language that you need.
Читать полностью…
But I can't find the source of this fact, so maybe it's just a lie
Читать полностью…
I suppose a QOpenGLWidget subclass could be more efficient
Читать полностью…
But then, the playback isn't really optimized. It's then all software.
Читать полностью…
I'll shoot a link to the repo I used for my testing... I haven't implemented the QGraphicsScene approach.
Читать полностью…
If it doesn't exist, I'll just create a derived class that does. 😉
Читать полностью…
some simple deobfuscation theory of handlers graph from simple stack base vm's that ommit scratch)
Читать полностью…
btw, templates are a feature to copy-past functions with different type but where overload not enough
if you can't understand stl decl from a quick glance — you dont know them to use right. to say, few one can use them
lambda'll break optimization chain to flatten it — inline pass, then check deps graph and precalc it
Читать полностью…
Welcome to the group, @faddistyoungman! :-)
Wanna share your story of how you started with Qt, QML or C++? Maybe some nice feature that made you stick with it.
Rules are set on the description of the group. :)
Other people of course may have different opinions about what can be "immediately understood"! 😊
Читать полностью…
C++ has also expanded a lot over the years. Although it can be a disadvantage at times, it also helps in other ways — for example, you no longer need to use raw loops all the time. That's what the STL is for: it makes your code more functional and expressive. Here's an example I made while playing around with the language. It stores the even numbers in the range from 1 to 10 in a vector without using loops.
Читать полностью…
I use probably 20% only or so. But it's only a hobby, so efficiency is not a primary goal.
Читать полностью…