Skip to content

C++ Gurus

The forum for all discussions in C++ land.
1.3k Topics 8.5k Posts
QtWS25 Last Chance
  • C++ named parameters?

    Solved
    4
    0 Votes
    4 Posts
    479 Views
    Pl45m4P
    @JonB I think it's some kind of hint for the reader to understand the source code better without browsing the whole class. Like: in some class.h where someFunction(int a, int b, float c) is declared void someFunction(int a, int b, float c); and (if I'm correct) everywhere the function is used, on every call, the code browser adds the names from the header, so you know right away what this // some code // ... someFunction(42, 42, 13.37); // ... means. With the hint it looks like: ( imagine meaningful names there :D ) someFunction( [ a ]: 42, [ b ]: 42, [ c ]: 13.37); Therefore I don't think it's C++ :) Btw: I also like woboq to check Qt source code :)
  • how to declare global (static?) function inside class?

    Solved
    4
    0 Votes
    4 Posts
    325 Views
    JoeCFDJ
    @mzimmers inline might be more convenient. No need to define it in cpp file. inline static bool m_use24hourTime{ false };
  • How to debug / verify running Qt code ?

    Unsolved
    2
    0 Votes
    2 Posts
    220 Views
    No one has replied
  • LDAP - Linux

    Unsolved
    2
    0 Votes
    2 Posts
    232 Views
    jsulmJ
    I think you will have to use something like https://www.openldap.org/software/man.cgi?query=ldap
  • Repost Parent / children / methods ? which way up ?

    4
    0 Votes
    4 Posts
    309 Views
    Pl45m4P
    @J-Hilk said in Repost Parent / children / methods ? which way up ?: (Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship) Oh boy... Had to read this for my studies :D Pretty helpful and well structured "guide" on how (not) to write code.
  • QObject iterator for QAction

    Unsolved
    7
    0 Votes
    7 Posts
    465 Views
    A
    @J-Hilk arrrrrrrrrrrrr
  • QObject or QAction?

    Unsolved
    2
    0 Votes
    2 Posts
    237 Views
    Axel SpoerlA
    QAction *action = qobject_cast<QAction *>(pItemObject); Has been explained to you before.
  • Explain Qt build class details or ponit and correct my errors .

    Unsolved
    6
    0 Votes
    6 Posts
    415 Views
    Christian EhrlicherC
    I'm sorry that you have to read documentation if you want to learn something. Especially something such basic c++ stuff.
  • How to iterate "parent" objects?

    Unsolved
    4
    0 Votes
    4 Posts
    410 Views
    Christian EhrlicherC
    To access the grandparent use parent()->parent()
  • How to execute QList "action" ?

    Unsolved
    3
    0 Votes
    3 Posts
    277 Views
    Axel SpoerlA
    Dear @AnneRanch, you are not supposed to simply delete posts, if they have become irrelevant and/or solved. The rules in this forum are to mark them solved, when they are. This is because they are likely to be a reference for others with similar issues.
  • How to unit test with functions loaded from win32 api?

    Unsolved
    5
    0 Votes
    5 Posts
    890 Views
    SGaistS
    @Paul-Colby is hinting at something good. If you want to be able to cleanly test things, you should consider making a library with all your widgets and business logic and your application will be mainly a main.cpp file using that library. This will allow you to build a test suite for your library in a simpler fashion.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    40 Views
    No one has replied
  • Code won;t update "appendPlainText"

    Solved
    7
    0 Votes
    7 Posts
    381 Views
    Axel SpoerlA
    We can only guess, @AnneRanch, under more because you don’t tell us which type text is. We also don’t know what „doesn’t work“ means. Is the field empty, partly filled? addPlainText always adds a new paragraph. Maybe that’s related.
  • How to iterate QList ?

    Solved
    6
    0 Votes
    6 Posts
    848 Views
    J.HilkJ
    I would recommend to no longer use Q_FOREACH it is deprecated for a reason! Use the ranged based for loop the c++ standard offers for (auto &item : container) less error prone, less conflict with other libraries, faster compile times.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    18 Views
    No one has replied
  • 0 Votes
    4 Posts
    494 Views
    Pl45m4P
    @kshegunov Thanks a lot :)
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • what is best architecture to share data between front end and backend using thread ?

    Solved
    15
    0 Votes
    15 Posts
    1k Views
    Q
    @SamiV123 , @JoeCFD @JonB @jsulm Thank you
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    50 Views
    No one has replied
  • header file not found

    Solved
    8
    0 Votes
    8 Posts
    814 Views
    slackujS
    i compiled it successfully using qmake.