Skip to content

C++ Gurus

The forum for all discussions in C++ land.
1.3k Topics 8.6k Posts
  • How to unit test with functions loaded from win32 api?

    Unsolved
    5
    0 Votes
    5 Posts
    1k 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
    827 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
    1k 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
    782 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
    2k 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
    1k Views
    slackujS
    i compiled it successfully using qmake.
  • Another "reuse" question

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    JKSHJ
    @AnneRanch said in Another "reuse" question: **this message does not show anywhere** auto pC = new Console; // Original class auto pSB = new QStatusBar; // Additional status bar auto layout = new QVBoxLayout; layout->addWidget(pC); layout->addWidget(pSB); auto consoleWithStatusBar = new QWidget; consoleWithStatusBar->setLayout(layout); consoleWithStatusBar->show(); pSB->showMessage(" TEST status bar message ");
  • configuration pre-condition failure system-doubleconversion

    Unsolved
    2
    0 Votes
    2 Posts
    495 Views
    I
    @inglis-dl adding: also tried variations on -I and -L path names such as / or \ separators as well as adding paths to windows system PATH envar
  • multiple inheritance ?

    Locked Unsolved
    3
    0 Votes
    3 Posts
    622 Views
    Christian EhrlicherC
    @AnneRanch Are we now in the "Remove the threads I don't like" phase again?
  • TEMPLATE = lib ?

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    A
    @JonB said in TEMPLATE = lib ?: that is not to do with you including or not including .h files in .cpp files. That has been discussed and concluded TRUE. Let's move on... It is to do with your code actually calling a function in another .o file and that not being passed to the linker to resolve. That is NOT the case - I have described how I use "add library" to add it to subproject .pro file - who is using it. Let's move on... I suspect the link to .so IS THE issue...
  • Buffer overflow not caught after executing a QDialog!

    Unsolved debug error
    10
    0 Votes
    10 Posts
    1k Views
    JonBJ
    @jdent As @Christian-Ehrlicher says, who knows, behaviour may be compiler-specific and it does not claim to check everything, I think. My own guess is that the call to showing the dialog avoiding the detection may well be "coincidence", nothing to do with the specific call, many other things might cause it to skip. Under Ubuntu, Qt 5, gcc and .pro file having CONFIG+=sanitizer CONFIG+=sanitize_address it does report a SIGABRT on code like yours, whether I put in a QDialog and/or exec() or not. I do not know whether you can use those CONFIG lines from Qt with MSVC or not. One tiny thing: just in case MSVC is "optimizing out" your x code completely because it has no effect (e.g. gcc warns "unused variable"), add something which uses x after your code.
  • error: allocation of incomplete type ....

    Unsolved
    12
    0 Votes
    12 Posts
    3k Views
    A
    @AnneRanch UPDATE / GOTCHA When reusing (C++ "feature") project in subproject one better change / rename "MainWindow" class name. . I start with renaming the existing class header file. QtCreator gives an option to rename both .cpp and .ui BUT you must start with renaming the header file FIRST. Then you can rename the MainWindow class and that will change the "object" name in .ui file! l Another "GOTCHA" - the #include ui_ file , generated from .ui file MUST be changed manually ! Good luck...
  • QML extension plugin problem

    Unsolved
    1
    0 Votes
    1 Posts
    276 Views
    No one has replied
  • please clarify std::ratio using

    Unsolved
    1
    0 Votes
    1 Posts
    284 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • Weird array properties

    Unsolved
    3
    0 Votes
    3 Posts
    535 Views
    JonBJ
    @ItsRhysNotRhys In order to get from Printing Queue: 4 5 0 to 2 left in queue inside moveElevator1 Printing Queue: 3 5 0 something outside the code you are showing us (maybe in whatever issues two of those message lines) is writing 3 to queue[0]. Either directly, or just possibly through buffer over/underflow writing to another member variable adjacent to int queue[20] .