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. what is the best way to use QAction? i want to add the same QAction in many different places...make it globally?
Qt 6.11 is out! See what's new in the release blog

what is the best way to use QAction? i want to add the same QAction in many different places...make it globally?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 561 Views 2 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.
  • O Offline
    O Offline
    opengpu2
    wrote on last edited by
    #1

    what is the best way to use QAction? i want to add the same QAction in many different places...make it globally?
    thank you

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Would you make a push button or a combobox global, because you are using push buttons and comboboxes all over your application?

      That statement might be a bit general. But would you create a global push button for quitting the application, because you might want to do this from anywhere in the app?

      IMHO it is not OOP style to have global objects. The only exclusion would be when the object is being really large or its creation requires always the same complex, time consuming procedure.

      Vote the answer(s) that helped you to solve your issue(s)

      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