cplusplusqt | Unsorted

Telegram-канал cplusplusqt - C++ & Qt

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

Subscribe to a channel

C++ & Qt

But sounds reasonable! 😊

Читать полностью…

C++ & Qt

I wrote a suggestion for Qt: https://bugreports.qt.io/browse/QTBUG-141989

Читать полностью…

C++ & Qt

I'd probably implement it with grabbing the frame whenever it changes and then drawing it after rotation in the paint event.

Читать полностью…

C++ & Qt

Funny coincidence! 😉

Читать полностью…

C++ & Qt

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.

Читать полностью…

C++ & Qt

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.

Читать полностью…

C++ & Qt

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*

Читать полностью…

C++ & Qt

but this is preference, not reliable. use constexpr or templates hell (but it's crazy)

Читать полностью…

C++ & Qt

and x3 mem, but for small arrs copy approach is the best

Читать полностью…

C++ & Qt

never overuse constexpr or templates

calc, save to file, read. — anything that's faster can be cached, etc

Читать полностью…

C++ & Qt

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");

Читать полностью…

C++ & Qt

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.

Читать полностью…

C++ & Qt

#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);
}

Читать полностью…

C++ & Qt

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.

Читать полностью…

C++ & Qt

But I can't find the source of this fact, so maybe it's just a lie

Читать полностью…

C++ & Qt

I suppose a QOpenGLWidget subclass could be more efficient

Читать полностью…

C++ & Qt

But then, the playback isn't really optimized. It's then all software.

Читать полностью…

C++ & Qt

But thanks - that would be great.

Читать полностью…

C++ & Qt

I'll shoot a link to the repo I used for my testing... I haven't implemented the QGraphicsScene approach.

Читать полностью…

C++ & Qt

If it doesn't exist, I'll just create a derived class that does. 😉

Читать полностью…

C++ & Qt

some simple deobfuscation theory of handlers graph from simple stack base vm's that ommit scratch)

Читать полностью…

C++ & Qt

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

Читать полностью…

C++ & Qt

lambda'll break optimization chain to flatten it — inline pass, then check deps graph and precalc it

Читать полностью…

C++ & Qt

and check disasm, it'll generate code

Читать полностью…

C++ & Qt

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. :)

Читать полностью…

C++ & Qt

Other people of course may have different opinions about what can be "immediately understood"! 😊

Читать полностью…

C++ & Qt

check ocaml, you'll LIKE it !

Читать полностью…

C++ & Qt

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.

Читать полностью…

C++ & Qt

I use probably 20% only or so. But it's only a hobby, so efficiency is not a primary goal.

Читать полностью…

C++ & Qt

He said, that he knows 80% of it at best

Читать полностью…
Subscribe to a channel