Nominate our 2022 Qt Champions!

Alternating back and front widgets for flashcards: One widget or two?

  • Hi all, I am a new user of PyQt and I am designing a simple flashcard app.

    The flashcards have two faces, front and back, and in my simple app, front has
    a next button and back has self-evaluation (1 thru 5) buttons.

    The app just iterates through the flashcards showing front then back, and then repeat.

    I can think of two ways to do this.
    First, since front and back are two widgets, I could make two widgets and pass control back and forth between them, or second, make one widget in which I re-render the buttons in a special button area down at the bottom of the screen?

    The examples I see that I could use as a model use the former but it re-creates widgets over
    and over again, which does not seem good.

    Any suggestions on the standard approach to this problem and any example code out there.

    Thanks for any suggestions.

    Jon Fernquest

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    If you something without animation, you can use a QStackedWidget that will contain both your widgets.

Log in to reply