Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
4.7.0, 4.7.4, 4.8.0, 5.5.0
-
None
-
Windows Vista x64
Description
Let's have a simple example:
#include <QtCore> #include <QtGui> int main(int argc, char *argv[]) { QApplication app(argc, argv); const QString html = "%1"; QLabel l; l.show(); QToolTip::showText(QPoint(120,200), html.arg("C:\\path\\to\\some\\c-file.cpp")); app.exec(); }
This shows a QLabel and a QToolTip with the path to a file. Looks nice! (plain.png)
But wait, what if the path is longer? Line breaks in a file path would look really ugly. To be sure, let's insert HTML's <nobr> attribute:
#include <QtCore> #include <QtGui> int main(int argc, char *argv[]) { QApplication app(argc, argv); const QString html = "<nobr>%1</nobr>"; QLabel l; l.show(); QToolTip::showText(QPoint(120,200), html.arg("C:\\path\\to\\some\\c-file.cpp")); app.exec(); }
But what's this? Now there ARE two line breaks even though the path didn't change at all! (nobr.png)
Inserting <nobr> leads to line breaks which is the exact opposite of what it should do.
This obviously has something to do with the colon ( : ) and the dash ( - ). If we replace them, line breaks are gone. Even if they are replaced with white characters!
Attachments
Issue Links
- duplicates
-
QTBUG-1135 Text inside the <nobr> tag still breaks
-
- Open
-
- resulted in
-
QTBUG-47821 [REG Qt 4.8.7 -> Qt 5.3.1] Trivial correct code produces error message from QWindowsWindow::setGeometryDp
-
- Closed
-