Logo Search packages:      
Sourcecode: canorus version File versions  Download package

void CAMainWin::rebuildUI ( bool  repaint = true  ) 

Rebuilds the GUI from data.

This method is called eg. when multiple viewports share the same data and a change has been made (eg. a note pitch has changed or a new element added). ViewPorts content is repositioned and redrawn (CAEngraver creates CADrawable elements for every score viewport, sources are updated in source viewports etc.).

This method in comparison to CAMainWin::rebuildUI(CASheet *s, bool repaint) rebuilds the whole GUI from scratch and creates new viewports for the sheets. This method is called for example when a new document is created or opened.

If repaint is True (default) the rebuilt viewports are also repainted. If False, viewports content is only created but not yet drawn. This is useful when multiple operations which could potentially change the content are to happen and we want to actually draw it only at the end.

Definition at line 1443 of file mainwin.cpp.

References _viewPortList, addSheet(), clearUI(), CAResourceView::rebuildUi(), CADocument::sheetCount(), and updateToolBars().

      if (rebuildUILock()) return;

      setRebuildUILock( true );
      if (document()) {
            int curIndex = uiTabWidget->currentIndex();

            // save the current state of viewports
            QList<QRect> worldCoordsList;
            for (int i=0; i<_viewPortList.size(); i++)
                  if (_viewPortList[i]->viewPortType() == CAViewPort::ScoreViewPort)
                        worldCoordsList << static_cast<CAScoreViewPort*>(_viewPortList[i])->worldCoords();

            for (int i=0; i<document()->sheetCount(); i++) {

                  // restore the current state of viewports
                  if ( _viewPortList[i]->viewPortType() == CAViewPort::ScoreViewPort &&
                       i < worldCoordsList.size() )

            for (int i=0; i<_viewPortList.size(); i++) {

                  if (_viewPortList[i]->viewPortType() == CAViewPort::ScoreViewPort)

                  if (repaint)

            if ( curIndex<uiTabWidget->count() )
      } else {

      if (_resourceView) {

      setRebuildUILock( false );

Generated by  Doxygen 1.6.0   Back to index