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. Displaying same widget on all windows.
QtWS25 Last Chance

Displaying same widget on all windows.

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt 5.7c++windowswidgets
2 Posts 2 Posters 1.1k Views
  • 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.
  • R Offline
    R Offline
    ronyNS
    wrote on 17 Aug 2016, 18:05 last edited by
    #1

    Hello
    How do i keep my menu bar and label fixed in all windows i.e i want to display the same menu bar and label in all windows of my program.
    Do i have to copy the same code for all windows or is there an easy way?
    eg.
    I have label with a heading of my program and i want to show that heading in all windows of my program.

    Thank you.

    J 1 Reply Last reply 17 Aug 2016, 18:30
    0
    • R ronyNS
      17 Aug 2016, 18:05

      Hello
      How do i keep my menu bar and label fixed in all windows i.e i want to display the same menu bar and label in all windows of my program.
      Do i have to copy the same code for all windows or is there an easy way?
      eg.
      I have label with a heading of my program and i want to show that heading in all windows of my program.

      Thank you.

      J Offline
      J Offline
      Joel Bodenmann
      wrote on 17 Aug 2016, 18:30 last edited by
      #2

      Given that this question is C++ tagged: Usually you would create a class that does what you want and then you create multiple instances of that (or subclasses).
      For example, you crate the class MyWindow where you configure everything so it looks like you want (the menu bar, labels and so on) and then you just subclass that class to create your different windows - or, when you need the same window multiple times you just create instances directly.

      I'm not sure whether that helps you but your question is somewhat unspecific in my opinion.

      Industrial process automation software: https://simulton.com
      Embedded Graphics & GUI library: https://ugfx.io

      1 Reply Last reply
      1

      2/2

      17 Aug 2016, 18:30

      • Login

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