void LogStatusLabel::logUpdate(QString message)
{
//TODO: This subroutine can be optimized
if(!message.length())
return;
labelText += message.replace("\r\n", "\n");
QStringList lineList = labelText.split('\n');
labelText = lineList.last(); //if the last character is a newline this will be an empty string
for(int i = 0; i < lineList.length(); i++)
{
const QString & line = lineList[lineList.size() - i - 1];
if(line.length()) //set the last non-empty string from the split
{
finalLabel = line;
break;
}
}
setText(finalLabel);
//QClipboard* clipboard = QApplication::clipboard();
//clipboard->setText(finalLabel); 这样写没有问题,状态栏的内容也被复制到了剪贴板,但是Ctrl+X复制VA地址就被冲掉内容了!
//所以我们换成输出日志的方法来解决