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 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 am currently learning C++ and more stuffs about computers (their architecture, chips, memory,..... Etc). I am already a PHP developer so that learning C++ syntax for me was an easy job!
-What am I doing right now?
I am still learning the language and I want to master it till I achieve my goals. 😁
Welcome to the group, @zethcxx! :-)
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. :)
and hey that works just fine. thanks for the help! :)
Читать полностью…
The easiest solution is perhaps to close everything in a controlled manner. Disconnect everything yourself at exit.
Читать полностью…
Parents to windows can be a bit tricky I think, but perhaps the model and the proxy can have the same parent?
Читать полностью…
oh, the window that owns the QSortFilterProxyModel doesn't have a parent
not at my computer right now, but maybe setModel changes the parentage?
i have subclassed QApplication, and that subclass has a *QStandardItemModel field which is initialized in the constructor, updated in one window, and accessed by a QSortFilterProxyModel in another window. both of the windows use instance() on the QApplication to access the field. this gives me 2 "QBasicTimer::start: QBasicTimer can only be used with threads started with QThread" warnings when closing the program. if i just remove the call to setModel on the QSortFilterProxyModel, then i get no warnings. what's going on?
Hi everyone! I made an app that creates Qt Creator shortcuts on macOS. Which allows you to run multiple separated data instances of Qt Creator. That makes it easy to work on separate environments and plugins at the same time. It is available in the Mac App Store, and if anyone needs a promo code, let me know
Читать полностью…
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.
Читать полностью…
No, it’s a very complex language. I don’t think there are many (if any) that knows every detail.
Читать полностью…
I guess define your own pet project and implement it in C++.
Читать полностью…
Please thumb up this reddit post https://www.reddit.com/r/QtFramework/comments/1ost284
Читать полностью…
well i don't know why exactly, but removing the QStandardItemModel's parentage to the QApplication did the trick. i guess i'll set its parent to the window that modifies it
maybe i could make the proxy's parent the original model 🤔
Читать полностью…
but i can't set a parent for it cause i initialize it in the constructor of the QApplication and it's the first window that opens
I don’t think so, but the if you connect them you should make sure the source model isn’t destroyed before the proxy. Or set the source to nullptr when exiting.
Читать полностью…
I think this can happen if things are destructed in the wrong order. Do you have parents to all objects? Perhaps you can disconnect things yourself before they are destructed?
Читать полностью…
I'm working on customising Scribus for a particular workflow for a newspaper. Work is mainly in QT. My background is python. Trying to find someone who has done similar work before
Читать полностью…
in general, I can give you a personal advice, (I'm maybe junior-middle in c++, i'm reverser in my field)
- try to not exceed 1000-2000 lines of code per function
- dont overthink it. you have task to do. just do it and verify — then NAME it right
so you have a subroutine with some functional that you can call and know what it does, implementation does not matter, be crazy)
and once you follow this and apply general app-architecture knowledge(or follow examples or just do whatever you feel is right) — you will notice that your code structure is not that bad... and objects with functions and files are not that bad... and your code flow graph from top to bottom(or whatever input point) is not that bad...