Example #1
0
CDiagramTextNode::CDiagramTextNode(CDiagram *parent)
	: CDiagramNode(parent),
	  m_editing(false)
{
	QRectF		r;
	
	setRotatable(false);
	setConnectable(false);
	setCategory( QString::fromUtf8("Core") );
	setName( QString::fromUtf8("Text") );

	m_label->setAutoWidth(false);

	m_brush = QBrush(QColor(0, 0, 0, 0));
	m_pen.setColor( QColor(0, 0, 0, 0) );

	connect(this, SIGNAL(addedToDiagram()), this, SLOT(onAddedToDiagram()));
	connect(m_label, SIGNAL(sizeAutoChanged()), this, SLOT(onTextSizeChanged()));
}
Example #2
0
void MailEditorMainWindow::setupEditorCommands()
  {
  QPixmap pix(ui->editToolBar->iconSize());
  pix.fill(Qt::black);
  ui->actionTextColor->setIcon(pix);

  FontCombo = new QFontComboBox(ui->formatToolBar);
  ui->formatToolBar->addWidget(FontCombo);
  connect(FontCombo, SIGNAL(activated(QString)), this, SLOT(onTextFamilyChanged(QString)));

  FontSize = new QComboBox(ui->formatToolBar);
  FontSize->setObjectName("comboSize");
  ui->formatToolBar->addWidget(FontSize);
  FontSize->setEditable(true);

  QFontDatabase db;
  foreach(int size, db.standardSizes())
    FontSize->addItem(QString::number(size));

  connect(FontSize, SIGNAL(activated(QString)), this, SLOT(onTextSizeChanged(QString)));
  FontSize->setCurrentIndex(FontSize->findText(QString::number(QApplication::font().pointSize())));
  }