Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [resolved] Extending classes and UI considerations
Forum Updated to NodeBB v4.3 + New Features

[resolved] Extending classes and UI considerations

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 745 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dsampaolo
    wrote on last edited by
    #1

    Hello,

    I'm new to C++ and to the fabulous universe of Qt.
    For my first project, I'd like to write a class that extends QDialog. I'll then like to extend my own class.
    (Let's say, the main class is "Game", and each minigame extends it.)

    I don't know how to handle UIs. Actually, I'd like both classes ("Game" and "MiniGame1") to be able to access the same UI.

    IE : evey game will have a Timer and a ProgressBar attached (countdown), my Game class should update the bar, but I'd like each game to have a different starting value)

    (in PHP, the syntax would be something like parent::UI)

    Any hints will be appreciated. Thank you for your time !

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dsampaolo
      wrote on last edited by
      #2

      I found a solution :

      • I create the layout in the "parent" class as protected,
      • I don't create anything in the "child", and I can access it :)

      Thank you ! :)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved