Пример #1
0
void TextTools::setVCenterAlign()
      {
      Align align = (_textElement->align() & ~ALIGN_VMASK) | ALIGN_VCENTER;
      _textElement->setAlign(align);
      updateTools();
      layoutText();
      }
Пример #2
0
void TextTools::setBottomAlign()
      {
      Align align = (_textElement->align() & ~ALIGN_VMASK) | ALIGN_BOTTOM;
      _textElement->setAlign(align);
      updateTools();
      layoutText();
      }
Пример #3
0
void TextTools::setTopAlign()
      {
      Align align = (_textElement->align() & ~ALIGN_VMASK) | ALIGN_TOP;
      _textElement->setAlign(align);
      updateTools();
      layoutText();
      }
Пример #4
0
void TextTools::setRightAlign()
      {
      QTextBlockFormat bformat;
      bformat.setAlignment((bformat.alignment() & ~Qt::AlignHorizontal_Mask) | Qt::AlignRight);
      cursor()->mergeBlockFormat(bformat);
      updateTools();
      }
Пример #5
0
void View::setCamera(int camera)
{
    resetCamera();
    switch (camera)
    {
    case CAMERA_ORBIT:
        currentCamera = &orbitCamera;
        break;

    case CAMERA_FIRST_PERSON:
        currentCamera = &firstPersonCamera;
        break;
    }
    updateTools();
    update();
}
Пример #6
0
void TextTools::setHalign(QAction* a)
      {
      QTextBlockFormat bformat;

      Qt::Alignment qa = bformat.alignment() & ~Qt::AlignHorizontal_Mask;
      switch(a->data().toInt()) {
            case ALIGN_HCENTER:
                  qa  |= Qt::AlignHCenter;
                  break;
            case ALIGN_RIGHT:
                  qa |= Qt::AlignRight;
                  break;
            case ALIGN_LEFT:
                  qa |= Qt::AlignLeft;
                  break;
            }

      bformat.setAlignment(qa);
      cursor()->mergeBlockFormat(bformat);
      _textElement->setAlign((_textElement->align() & ~ ALIGN_HMASK) | Align(a->data().toInt()));
      updateTools();
      layoutText();
      }
Пример #7
0
void TextTools::setValign(QAction* a)
      {
      _textElement->setAlign((_textElement->align() & ~ALIGN_VMASK) | Align(a->data().toInt()));
      updateTools();
      layoutText();
      }
Пример #8
0
void TextTools::setHalign(QAction* a)
      {
      _textElement->setCurHalign(a->data().toInt());
      updateTools();
      layoutText();
      }
Пример #9
0
void View::setMode(int newMode)
{
    mode = newMode;
    updateTools();
    update();
}