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

void CAMainWin::initViewPort ( CAViewPort v  )  [private]

Links the newly created viewport with the main window:

  • Adds the viewport to the viewport list
  • Connects its signals to main windows' slots.
  • Sets the icon, focus policy and sets the focus.
  • Sets the currentViewPort but not currentViewPortContainer

Definition at line 1069 of file mainwin.cpp.

References _viewPortList, onScoreViewPortSelectionChanged(), onTextEditKeyPressEvent(), scoreViewPortDoubleClick(), scoreViewPortKeyPress(), scoreViewPortMouseMove(), scoreViewPortMousePress(), scoreViewPortMouseRelease(), scoreViewPortTripleClick(), scoreViewPortWheel(), setMode(), sourceViewPortCommit(), and viewPortClicked().

Referenced by addSheet(), on_uiCanorusMLSource_triggered(), and on_uiScoreView_triggered().

                                          {
      _viewPortList << v;

      v->setWindowIcon(QIcon("images:clogosm.png"));

      connect( v, SIGNAL(clicked()), this, SLOT(viewPortClicked()) );
      switch (v->viewPortType()) {
            case CAViewPort::ScoreViewPort: {
                  connect( v, SIGNAL(CAMousePressEvent(QMouseEvent *, QPoint)),
                           this, SLOT(scoreViewPortMousePress(QMouseEvent *, QPoint)) );
                  connect( v, SIGNAL(CAMouseMoveEvent(QMouseEvent *, QPoint)),
                           this, SLOT(scoreViewPortMouseMove(QMouseEvent *, QPoint)) );
                  connect( v, SIGNAL(CAMouseReleaseEvent(QMouseEvent *, QPoint)),
                           this, SLOT(scoreViewPortMouseRelease(QMouseEvent *, QPoint)) );
                  connect( v, SIGNAL(CADoubleClickEvent(QMouseEvent *, QPoint)),
                           this, SLOT(scoreViewPortDoubleClick(QMouseEvent *, QPoint)) );
                  connect( v, SIGNAL(CATripleClickEvent(QMouseEvent *, QPoint)),
                           this, SLOT(scoreViewPortTripleClick(QMouseEvent *, QPoint)) );
                  connect( v, SIGNAL(CAWheelEvent(QWheelEvent *, QPoint)),
                           this, SLOT(scoreViewPortWheel(QWheelEvent *, QPoint)) );
                  connect( v, SIGNAL(CAKeyPressEvent(QKeyEvent *)),
                           this, SLOT(scoreViewPortKeyPress(QKeyEvent *)) );
                  connect( static_cast<CAScoreViewPort*>(v)->textEdit(), SIGNAL(CAKeyPressEvent(QKeyEvent*)),
                           this, SLOT(onTextEditKeyPressEvent(QKeyEvent*)) );
                  connect( v, SIGNAL(selectionChanged()),
                           this, SLOT(onScoreViewPortSelectionChanged()) );
                  break;
            }
            case CAViewPort::SourceViewPort: {
                  connect(v, SIGNAL(CACommit(QString)), this, SLOT(sourceViewPortCommit(QString)));
                  break;
            }
      }

      v->setFocusPolicy(Qt::ClickFocus);
      v->setFocus();
      setCurrentViewPort(v);
      setMode(mode());  // updates the new viewport border settings
}


Generated by  Doxygen 1.6.0   Back to index