WebQString::arg() ,引用自: fieldWidth指定填充字符fillChar的最小空间量。正值生成右对齐的文本;负值会产生左对齐的文本 \t不好。 不是问题描述。虽然你的意思可能相当明显,但你仍然应该清楚什么是错的,而不是你想看到的。这如何帮助OP产生他想要的输出 ... WebJul 1, 2013 · QString QString::arg ( int a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char ( ' ' ) ) const example: uint decimal = 203888026 ; QString hexvalue = QString ( "%1" ).arg ( decimal, 8, 16, QLatin1Char ( '0' )); you can even add a preceding "0x" if you desire, like this:
qstring.h « tools « corelib « src - qt/qtbase.git - Qt Base (Core, Gui ...
WebA QString can embed '\0' characters ( QChar::Null ). The size () function always returns the size of the whole string, including embedded '\0' characters. After a call to the resize () function, newly allocated characters have undefined values. To set all the characters in the string to a particular value, use the fill () function. git list changed files in commit
/builds/wireshark/wireshark/ui/qt/capture_file_properties_dialog.cpp
WebFeb 3, 2010 · QString QString::arg ( char a, int fieldwidth=0 ) const. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. a is assumed to be in the Latin1 character set. QString QString::arg ( double a, int fieldwidth=0, char fmt='g', int prec=-1 ) const WebAug 12, 2024 · QString QString::arg ( const QString & a, int fieldWidth = 0, const QChar & fillChar = QLatin1Char( ' ' ) ) const It contains only 3 parameters. I'm using Qt 4.6. Your code reads: QString("%1").arg(runningDate.date().month(), 2, '0') QDate::date().month()returns an intnot a QString. WebQt Base (Core, Gui, Widgets, Network, ...) summary refs log tree commit diff stats git list contents of stash