Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 2340:f576895641c2
Comments
author | Chris Cannam |
---|---|
date | Mon, 07 Oct 2019 09:32:32 +0100 |
parents | 1057ae621c87 |
children | a98de7e7e033 |
comparison
equal
deleted
inserted
replaced
2337:9caf5ca5e6cf | 2340:f576895641c2 |
---|---|
5073 | 5073 |
5074 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok); | 5074 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok); |
5075 layout->addWidget(bb, row++, 0, 1, 3); | 5075 layout->addWidget(bb, row++, 0, 1, 3); |
5076 connect(bb, SIGNAL(accepted()), d, SLOT(accept())); | 5076 connect(bb, SIGNAL(accepted()), d, SLOT(accept())); |
5077 | 5077 |
5078 // Remove spurious linefeeds from DOS line endings | |
5078 text.replace('\r', ""); | 5079 text.replace('\r', ""); |
5080 | |
5081 // Un-wrap indented paragraphs (assume they are always preceded by | |
5082 // an empty line, so don't get merged into prior para) | |
5079 text.replace(QRegExp("(.)\n +(.)"), "\\1 \\2"); | 5083 text.replace(QRegExp("(.)\n +(.)"), "\\1 \\2"); |
5084 | |
5085 // Rest of para following a " - " at start becomes bulleted entry | |
5080 text.replace(QRegExp("\n - ([^\n]+)"), "\n<li>\\1</li>"); | 5086 text.replace(QRegExp("\n - ([^\n]+)"), "\n<li>\\1</li>"); |
5087 | |
5088 // Line-ending ":" introduces the bulleted list | |
5081 text.replace(QRegExp(": *\n"), ":\n<ul>\n"); | 5089 text.replace(QRegExp(": *\n"), ":\n<ul>\n"); |
5090 | |
5091 // Blank line (after unwrapping) ends the bulleted list | |
5082 text.replace(QRegExp("</li>\n\\s*\n"), "</li>\n</ul>\n\n"); | 5092 text.replace(QRegExp("</li>\n\\s*\n"), "</li>\n</ul>\n\n"); |
5093 | |
5094 // Text leading up to that line-ending ":" becomes bold heading | |
5083 text.replace(QRegExp("\n(\\w[^:\n]+:)"), "\n<p><b>\\1</b></p>"); | 5095 text.replace(QRegExp("\n(\\w[^:\n]+:)"), "\n<p><b>\\1</b></p>"); |
5084 // text.replace(QRegExp("<li>([^,.\n]+)([,.] +\\w)"), "<li><b>\\1</b>\\2"); | |
5085 | 5096 |
5086 textEdit->setHtml(text); | 5097 textEdit->setHtml(text); |
5087 textEdit->setReadOnly(true); | 5098 textEdit->setReadOnly(true); |
5088 | 5099 |
5089 d->setMinimumSize(m_viewManager->scalePixelSize(520), | 5100 d->setMinimumSize(m_viewManager->scalePixelSize(520), |