コード例 #1
0
	void MsgFormatterWidget::handleTextColor ()
	{
		QBrush brush = GetActualCharFormat ().foreground ();
		const QColor& color = QColorDialog::getColor (brush.color (), Edit_);
		if (!color.isValid ())
			return;

		CharFormatActor ([color] (QTextFormat *fmt)
				{ fmt->setForeground (QBrush (color)); });
	}
コード例 #2
0
	void MsgFormatterWidget::handleFont ()
	{
		QFont font = GetActualCharFormat ().font ();
		bool ok = false;
		font = QFontDialog::getFont (&ok, font, Edit_);
		if (!ok)
			return;

		CharFormatActor ([font] (QTextCharFormat *fmt)
				{ fmt->setFont (font); });
	}
コード例 #3
0
	void MsgFormatterWidget::handleTextColor ()
	{
		QBrush brush = GetActualCharFormat ().foreground ();
		const QColor& color = QColorDialog::getColor (brush.color (), Edit_);
		if (!color.isValid ())
			return;

		CharFormatActor (boost::bind (&QTextFormat::setForeground,
						_1,
						QBrush (color)));
	}
コード例 #4
0
	void MsgFormatterWidget::handleFont ()
	{
		QFont font = GetActualCharFormat ().font ();
		bool ok = false;
		font = QFontDialog::getFont (&ok, font, Edit_);
		if (!ok)
			return;
		
		CharFormatActor (boost::bind (&QTextCharFormat::setFont,
						_1,
						font));
	}