Exemplo n.º 1
0
static QString charFormat2QString(const CharFormat& f)
      {
      return QString("b %1 i %2 u %3 va %4 fs %5 fam %6")
            .arg(f.bold())
            .arg(f.italic())
            .arg(f.underline())
            .arg(static_cast<int>(f.valign()))
            .arg(f.fontSize())
            .arg(f.fontFamily())
                 ;
      }
Exemplo n.º 2
0
void TextTools::updateTools(EditData& ed)
      {
      text   = toText(ed.element);
      cursor = text->cursor(ed);
      blockAllSignals(true);
      CharFormat* format = cursor->format();

      QFont f(format->fontFamily());
      typefaceFamily->setCurrentFont(f);
      typefaceFamily->setEnabled(true);
      typefaceSize->setValue(format->fontSize());

      typefaceItalic->setChecked(format->italic());
      typefaceBold->setChecked(format->bold());
      typefaceUnderline->setChecked(format->underline());
      typefaceSubscript->setChecked(format->valign() == VerticalAlignment::AlignSubScript);
      typefaceSuperscript->setChecked(format->valign() == VerticalAlignment::AlignSuperScript);

      blockAllSignals(false);
      }
Exemplo n.º 3
0
void TextTools::updateTools()
      {
      if (!_textElement->editMode())
            qFatal("TextTools::updateTools(): not in edit mode");
      blockAllSignals(true);
      TextCursor* cursor = _textElement->cursor();
      CharFormat* format = cursor->format();

      QFont f(format->fontFamily());
      typefaceFamily->setCurrentFont(f);
      typefaceFamily->setEnabled(cursor->format()->type() == CharFormatType::TEXT);
      typefaceSize->setValue(format->fontSize());

      typefaceItalic->setChecked(format->italic());
      typefaceBold->setChecked(format->bold());
      typefaceUnderline->setChecked(format->underline());
      typefaceSubscript->setChecked(format->valign() == VerticalAlignment::AlignSubScript);
      typefaceSuperscript->setChecked(format->valign() == VerticalAlignment::AlignSuperScript);

      blockAllSignals(false);
      }