Loading...
Searching...
No Matches
score::CentralViewStack Class Referencefinal

The central area of a document. More...

Inheritance diagram for score::CentralViewStack:

Detailed Description

The central area of a document.

It is made of a navigation bar on top of a stack of views. The first view is the document itself (for scenarios, the timeline / nodal display of the current interval). Plug-ins can add further views that take the whole central area: a process's code editor, a process's custom UI, etc.

The navigation bar is shared by every view: on the left it hosts a widget provided by the document delegate (the interval address bar for scenarios), on the right a tab bar to switch between the views.

Views are not owned by the stack in the C++ sense: closing a tab calls QWidget::close() on the view; a view that wants to go away for good sets Qt::WA_DeleteOnClose. A view that gets deleted is removed automatically.

Public Member Functions

 CentralViewStack (QWidget *mainView, const QString &title, QWidget *parent=nullptr)
 
QWidget * mainView () const noexcept
 The document's own view, always the first tab.
 
void setNavigationWidget (QWidget *w)
 Widget shown on the left of the navigation bar. Owned by the stack.
 
QWidget * navigationWidget () const noexcept
 
void addView (QWidget *w, const QString &title, const QIcon &icon={})
 
void removeView (QWidget *w)
 
void showView (QWidget *w)
 
void setViewTitle (QWidget *w, const QString &title)
 
bool hasView (QWidget *w) const noexcept
 
QWidget * currentView () const noexcept
 
QWidget * viewContaining (QWidget *w) const noexcept
 The view that is, or contains, this widget; nullptr if none.
 
void releaseMainView ()
 
void currentViewChanged (QWidget *view)
 
void viewContextMenuRequested (QWidget *view, QPoint globalPos)
 Right-click on a view's tab. Not sent for the document's own view.
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *ev) override
 

Member Function Documentation

◆ releaseMainView()

void score::CentralViewStack::releaseMainView ( )

Detaches the main view from the stack without deleting it. Used by the document view when it is torn down, as the delegate view manages the lifetime of that widget.


The documentation for this class was generated from the following files: