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. Good design for workspace and signals connected to sub windows
Forum Updated to NodeBB v4.3 + New Features

Good design for workspace and signals connected to sub windows

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 517 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.
  • B Offline
    B Offline
    Bihlerben
    wrote on last edited by
    #1

    Hi,

    I would like to ask for design rules regarding a workspace with sub windows. I have an example application using Qt 4 with a kind of multiple document interface (with QWorkspace handling the sub windows) . In the main window there are actions added to the menu bar, for example an action to save the current document as soon as the user activates this action. There is a document class which has to be told to save the document. Unfortunately the current document may change, if the user selects another sub window. Therefore it is not easy to use the signal-slot-mechanism. I don't know to which document instance I should connect the signal to.

    The example application here connects the signal to a dummy slot in the main window and this slot redirects the request to the respective method in the document class, by querying the current document and calling the corresponding method of that instance. This causes a lot of boilerplate code.

    As an alternative I could listen to the windowActivated(QWidget*) signal of QWorkspace and there reconnect the menu bar actions the the new document window. Is this a good solution? Or are there better ones? How do the experts handle this issue?

    Thank you very much for any help!

    Benjamin

    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