Canorus 0.0
Public Member Functions | Private Attributes | List of all members
CAViewContainer Class Reference

Holds together resizable views. More...

#include <viewcontainer.h>

Inheritance diagram for CAViewContainer:
Inheritance graph
[legend]

Public Member Functions

 CAViewContainer (QWidget *p)
 
 ~CAViewContainer ()
 
void addView (CAView *v, QSplitter *s=0)
 
void removeView (CAView *v)
 
CAViewsplitHorizontally (CAView *v=0)
 
CAViewsplitVertically (CAView *v=0)
 
CAViewunsplit (CAView *v=0)
 
QList< CAView * > unsplitAll ()
 
bool contains (CAView *v)
 
const QList< CAView * > viewList ()
 
void setCurrentView (CAView *v)
 
CAViewcurrentView ()
 

Private Attributes

QHash< CAView *, QSplitter * > _viewMap
 
CAView_currentView
 
CASheet_sheet
 

Detailed Description

Holds together resizable views.

Copyright (c) 2006-2007, Matevž Jekovec, Itay Perl, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See COPYING for details.

This class behaves like dynamic QSplitter and can hold up a number of various views that can be customly resized. Usually this container serves as a layout class for containers in the tab widget.

View port container should always include at least 1 view port. Otherwise there is no point of having the container at all! That's why the initial view is required in constructor already.

See also
CAView

Constructor & Destructor Documentation

◆ CAViewContainer()

CAViewContainer::CAViewContainer ( QWidget *  parent)

Constructs the initial container having v as the initial view and a parent widget p.

References setCurrentView().

Here is the call graph for this function:

◆ ~CAViewContainer()

CAViewContainer::~CAViewContainer ( )

Removes all the views and finally destroys container.

Warning
This destructor also deletes the views!

Member Function Documentation

◆ addView()

void CAViewContainer::addView ( CAView v,
QSplitter s = 0 
)

Adds and registers the given view v to the splitter s or the top splitter if not specified.

References _viewMap, and setCurrentView().

Referenced by CAMainWin::addSheet(), CAMainWin::on_uiCanorusMLSource_triggered(), CAMainWin::on_uiLilyPondSource_triggered(), CAMainWin::on_uiScoreView_triggered(), splitHorizontally(), and splitVertically().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains()

bool CAViewContainer::contains ( CAView v)
inline

References _viewMap.

◆ currentView()

CAView * CAViewContainer::currentView ( )
inline

References _currentView.

Referenced by CAMainWin::removeSheet(), removeView(), splitHorizontally(), splitVertically(), and unsplit().

Here is the caller graph for this function:

◆ removeView()

void CAViewContainer::removeView ( CAView v)

Removes the given view from internal list and reselects the current view if the currentView() points to deleted view.

References _viewMap, currentView(), and setCurrentView().

Referenced by unsplit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCurrentView()

void CAViewContainer::setCurrentView ( CAView v)
inline

References _currentView.

Referenced by addView(), CAViewContainer(), removeView(), and CAMainWin::viewClicked().

Here is the caller graph for this function:

◆ splitHorizontally()

CAView * CAViewContainer::splitHorizontally ( CAView v = 0)

Splits the given view v horizontally or the last used view if none given. Horizontal split uses vertical splitter. Returns the newly created view.

References _viewMap, addView(), CAView::clone(), and currentView().

Referenced by CAMainWin::on_uiSplitHorizontally_triggered().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splitVertically()

CAView * CAViewContainer::splitVertically ( CAView v = 0)

Splits the given view v vertically or the last used view if none given. Vertical split uses horizontal splitter. Returns the newly created view.

References _viewMap, addView(), CAView::clone(), and currentView().

Referenced by CAMainWin::on_uiSplitVertically_triggered().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unsplit()

CAView * CAViewContainer::unsplit ( CAView v = 0)

Unsplits the views so the given view v is removed. If no view is given, removes the last active one.

Returns
The pointer to the view which was removed. If none was removed (ie. the given view was not found or there are no views left) returns 0.

References _viewMap, currentView(), and removeView().

Referenced by CAMainWin::on_uiCloseCurrentView_triggered(), and unsplitAll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unsplitAll()

QList< CAView * > CAViewContainer::unsplitAll ( )

Unsplits all the views except the last active one.

References unsplit().

Referenced by CAMainWin::on_uiUnsplitAll_triggered().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ viewList()

const QList< CAView * > CAViewContainer::viewList ( )
inline

References _viewMap.

Member Data Documentation

◆ _currentView

CAView* CAViewContainer::_currentView
private

Referenced by currentView(), and setCurrentView().

◆ _sheet

CASheet* CAViewContainer::_sheet
private

◆ _viewMap

CAViewContainer::_viewMap
private

Map of View : Splitter widgets. Every view has a splitter which it belongs to. If a views is the top-most widget, then it belongs to CAViewContainer itself.

Referenced by addView(), contains(), removeView(), splitHorizontally(), splitVertically(), unsplit(), and viewList().


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