Skip to content
  • 0 Votes
    11 Posts
    589 Views
    jsulmJ

    @Kirill-Gusarev See @SimonSchroeder explanation and also read https://doc.qt.io/qt-6/threads-qobject.html

  • 0 Votes
    3 Posts
    423 Views
    HowardHarknessH

    @timob256 First of all, I recommend against using protected mode. It is a subtle violation of the Liskov Substitution Principle that will bite you (or whomever gets stuck with the maintenance of this code).

    The immediate cure is to add an accessor in the public section of class wgt_screen:

    public: ... texnStructur getMyTexpr() {return _myTexpr;} ...

    Then, wherever you use_myTexpr.[fieldname] in the main window, use getMyTexpr().[fieldname] instead.

    Example:
    if(wgt->_myTexpr.outline)
    would become
    if(wgt->getMyTexpr().outline)

  • 0 Votes
    2 Posts
    2k Views
    Pl45m4P

    @mingvv

    First, you should understand the basics of C++ and object-oriented programming in general. Without it's really hard to get a satisfying result and you will spend most of your time looking for things or trying to figure out how things work (or why they don't).

    Qt also has Model-View based classes.

    https://doc.qt.io/qt-5/model-view-programming.html

    You can communicate with your GUI or other QObject classes using the Qt signal&slot system or using events.
    For example if you press a button, you will emit the clicked signal. Then, if you connect a slot (= function) to this signal, the function will be called to perform some actions.

    https://doc.qt.io/qt-5/signalsandslots.html

    A (simple) snake game in Qt might be a practice to start with. Think about what classes / structure you will need, design your GUI and start writing your code :)

    Might be helpful:

    https://doc.qt.io/qt-5/graphicsview.html

    According the "GUI Code vs Designer" thing:
    It's mostly a mix of both. Some things just can't be done using the QtDesigner, but it helps a lot creating your basic widgets and your basic design.

  • 0 Votes
    6 Posts
    492 Views
    J.HilkJ

    @learnist
    either

    Completer(QObject *parent = nullptr);

    or

    Completer *completer = new Completer(nullptr);
  • Good way to use Qt

    Unsolved General and Desktop
    2
    0 Votes
    2 Posts
    808 Views
    SGaistS

    Hi and welcome to devnet,

    What kind of transformation do you have ing mind ?