Details
-
Technical task
-
Resolution: Done
-
P2: Important
-
ee9f6ec9b9e8f0d18ad7e8fededb5292abb91912
Description
Using the new raw string literal syntax in C++11 leads to multiple warnings. The warnings were in the format:
..file.cpp:564: Unterminated C++ string
..file.cpp:566: Unterminated C++ string
..file.cpp:600: Unterminated C++ string
..file.cpp:606: Unterminated C++ string
..file.cpp:607: Excess closing parenthesis in C++ code (or abuse of the C++ preprocessor)
The beginning line was:
widget1->setStyleSheet( R"qss(
#chkLighting { padding: 5px; }
)qss" );
The syntax used in this case is R"delimiter()delimiter" and lines do not need to be escaped.
The warning seems to span multiple raw string literals because the end line, 607, is the closing semicolon in this later block:
widget2->setStyleSheet( "background: transparent url(" + img + ");" + R"qss(
background-repeat: no-repeat;
background-position: left;
background-origin: margin;
background-clip: margin;
margin-left: 20px;
)qss"
);
If I were to guess, I would say it's possible any tr() calls between the two raw string literals (lines 566 through 600) may not be picked up by lupdate, but I haven't tried testing this.
I have only used the syntax in the format R"delimiter()delimiter" but there are several other new string literals which can be seen:
http://en.wikipedia.org/wiki/C%2B%2B11#New_string_literals
http://en.cppreference.com/w/cpp/language/string_literal
http://msdn.microsoft.com/en-us/library/69ze775t.aspx
...though I believe R"delimiter()delimiter" is the only one to span multiple lines, so any issues with the other string literals may not be related and may need their own ticket.
Attachments
Issue Links
- is duplicated by
-
QTBUG-73273 [Translation] Qt lupdate does not work with R string
- Closed
- relates to
-
QTBUG-55962 Moc parser does not support C++11 raw string literals
- Reported