added QTextCursor for color, fixed color cursor problem when color is selected and cursor is not aktive

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@457 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2008-04-01 06:15:02 +00:00
parent 4c210a5605
commit d51af63d51
2 changed files with 1 additions and 10 deletions

View File

@ -293,6 +293,7 @@ void PopupChatDialog::setColor()
colorChanged(currentColor); colorChanged(currentColor);
} }
ui.chattextEdit->setFocus(); ui.chattextEdit->setFocus();
QTextCursor cursor = ui.chattextEdit->textCursor();
} }
void PopupChatDialog::colorChanged(const QColor &c) void PopupChatDialog::colorChanged(const QColor &c)
@ -302,15 +303,6 @@ void PopupChatDialog::colorChanged(const QColor &c)
ui.colorButton->setIcon(pix); ui.colorButton->setIcon(pix);
} }
void PopupChatDialog::mergeFormatOnWordOrSelection(const QTextCharFormat &format)
{
//QTextCursor cursor = ui.chattextEdit->textCursor();
/*if (!cursor.hasSelection())
cursor.select(QTextCursor::WordUnderCursor);
cursor.mergeCharFormat(format);*/
//ui.chattextEdit->mergeCurrentCharFormat(format);
}
void PopupChatDialog::getFont() void PopupChatDialog::getFont()
{ {
bool ok; bool ok;

View File

@ -80,7 +80,6 @@ private slots:
private: private:
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
void colorChanged(const QColor &c); void colorChanged(const QColor &c);
QAction *actionTextBold; QAction *actionTextBold;