Added the ability to have bold, underlined or font in italics.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@529 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
rwoodruff91 2008-04-29 19:19:07 +00:00
parent a282b9fa74
commit 2d40e6cef4
3 changed files with 308 additions and 207 deletions

View file

@ -29,7 +29,12 @@ BlogDialog::BlogDialog(QWidget *parent)
/* Invoke the Qt Designer generated object setup routine */
setupUi(this);
connect(Sendbtn, SIGNAL(clicked()), this, SLOT(sendMsg()));
connect(sendBtn, SIGNAL(clicked()), this, SLOT(sendMsg()));
connect(boldBtn, SIGNAL(clicked()), this, SLOT(setFont()));
connect(underlineBtn, SIGNAL(clicked()), this, SLOT(setFont()));
connect(italicBtn, SIGNAL(clicked()), this, SLOT(setFont()));
mCurrentFont = QFont("Comic Sans MS", 8);
}
@ -37,9 +42,25 @@ void BlogDialog::sendMsg()
{
QString msg = lineEdit->toPlainText();
msgText->setCurrentFont(mCurrentFont);
/* Write text into windows */
msgText->append(msg);
/* Clear lineEdit */
lineEdit->clear();
}
void BlogDialog::setFont()
{
mCurrentFont.setUnderline(underlineBtn->isChecked());
mCurrentFont.setItalic(italicBtn->isChecked());
mCurrentFont.setBold(boldBtn->isChecked());
lineEdit->setFont(mCurrentFont);
lineEdit->setFocus();
}