Important: Please read the Qt Code of Conduct -

Need help: 3 questions

    1. I tried to create signals for a default c++ class and it didn't work. Must the class be inherited from QObject in order to have signals?

    2. Suppose you are writing a GUI program with a menu on first page that contains buttons to go to different pages, what tools would you use for that? I tried stacked widget but I think there should be better ways.(Having the stacked widget filled the window makes me unable to get another widget, such as a QGraphicsView, fill the window...)

    3. I am writing a board game and I want to create default ui objects to represent cards. Should I create a QObject class inheriting QPushButton? If yes, please give me details or links that could guide me doing this. Or should I make a QGraphicsView and make the cards in it?

    Thank you very, very much!!!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    1. Yes

    2. Depends really on what should appear and how, you also have QStackedLayout, QTabWidget or even QWizard.

    3. Either QGraphicsView or QML. Have a look at the examples from Qt's documentation, they should give you a good starting point.

  • Thanks for your help! SGaist.
    I will take a look at the tools you suggested.

  • For the second question, I am expecting the appearance of the window would looks something like the "Qt Quick Demo - Same Game", which I couldn't recreate with Stacked Widget.

    Should I be looking at QML or JavaScript? Because I saw these two kinds of file in the demo.

    Thanks again!

  • Lifetime Qt Champion

    If you want to have special effect like the Same Game demo, then yes, have a look at QML

Log in to reply