|
Canorus
0.0
|
Holds together resizable views. More...
#include <viewcontainer.h>

Public Member Functions | |
| CAViewContainer (QWidget *p) | |
| ~CAViewContainer () | |
| void | addView (CAView *v, QSplitter *s=0) |
| void | removeView (CAView *v) |
| CAView * | splitHorizontally (CAView *v=0) |
| CAView * | splitVertically (CAView *v=0) |
| CAView * | unsplit (CAView *v=0) |
| QList< CAView * > | unsplitAll () |
| bool | contains (CAView *v) |
| const QList< CAView * > | viewList () |
| void | setCurrentView (CAView *v) |
| CAView * | currentView () |
Private Attributes | |
| QHash< CAView *, QSplitter * > | _viewMap |
| CAView * | _currentView |
| CASheet * | _sheet |
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.
| CAViewContainer::CAViewContainer | ( | QWidget * | parent | ) |
Constructs the initial container having v as the initial view and a parent widget p.
References setCurrentView().

| CAViewContainer::~CAViewContainer | ( | ) |
Removes all the views and finally destroys container.
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().


|
inline |
References _currentView.
Referenced by CAMainWin::removeSheet(), removeView(), splitHorizontally(), splitVertically(), and unsplit().

| 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().


|
inline |
References _currentView.
Referenced by addView(), CAViewContainer(), removeView(), and CAMainWin::viewClicked().

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().


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().


Unsplits the views so the given view v is removed. If no view is given, removes the last active one.
References _viewMap, currentView(), and removeView().
Referenced by CAMainWin::on_uiCloseCurrentView_triggered(), and unsplitAll().


| QList< CAView * > CAViewContainer::unsplitAll | ( | ) |
Unsplits all the views except the last active one.
References unsplit().
Referenced by CAMainWin::on_uiUnsplitAll_triggered().


|
private |
Referenced by currentView(), and setCurrentView().
|
private |
|
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().