Skip to content

Instantly share code, notes, and snippets.

@raghunayak
Last active March 30, 2021 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raghunayak/be092775afebcba1e8830a2d1d215793 to your computer and use it in GitHub Desktop.
Save raghunayak/be092775afebcba1e8830a2d1d215793 to your computer and use it in GitHub Desktop.
Sample to show how space can be disabled/enabled in middle of qDebug logging
#include <QDebug>
// Output: Log with spaces Logwithoutspaces Again Logging with spaces
int main(int argc, char *argv[])
{
auto log = qDebug();
log << "Log" << "with" << "spaces";
log.nospace();
log << "Log" << "without" << "spaces";
log.space();
log << "Again Logging" << "with" << "spaces";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment