Fixes the numerical streaming value for FLineEdit and FLabel

This commit is contained in:
Markus Gans 2019-11-16 19:57:45 +01:00
parent b3c367a168
commit 4540a6f455
6 changed files with 67 additions and 27 deletions

View File

@ -89,7 +89,7 @@ FLabel& FLabel::operator << (const wchar_t c)
}
//----------------------------------------------------------------------
FLabel& FLabel::operator << (const uInt num)
FLabel& FLabel::operator << (const uInt16 num)
{
FString num_str;
num_str << num;
@ -98,7 +98,25 @@ FLabel& FLabel::operator << (const uInt num)
}
//----------------------------------------------------------------------
FLabel& FLabel::operator << (const int num)
FLabel& FLabel::operator << (const sInt16 num)
{
FString num_str;
num_str << num;
setText(text + num_str);
return *this;
}
//----------------------------------------------------------------------
FLabel& FLabel::operator << (const uInt32 num)
{
FString num_str;
num_str << num;
setText(text + num_str);
return *this;
}
//----------------------------------------------------------------------
FLabel& FLabel::operator << (const sInt32 num)
{
FString num_str;
num_str << num;

View File

@ -94,7 +94,7 @@ FLineEdit& FLineEdit::operator << (const wchar_t c)
}
//----------------------------------------------------------------------
FLineEdit& FLineEdit::operator << (const uInt num)
FLineEdit& FLineEdit::operator << (const uInt16 num)
{
FString num_str;
num_str << num;
@ -103,7 +103,25 @@ FLineEdit& FLineEdit::operator << (const uInt num)
}
//----------------------------------------------------------------------
FLineEdit& FLineEdit::operator << (const int num)
FLineEdit& FLineEdit::operator << (const sInt16 num)
{
FString num_str;
num_str << num;
setText(text + num_str);
return *this;
}
//----------------------------------------------------------------------
FLineEdit& FLineEdit::operator << (const uInt32 num)
{
FString num_str;
num_str << num;
setText(text + num_str);
return *this;
}
//----------------------------------------------------------------------
FLineEdit& FLineEdit::operator << (const sInt32 num)
{
FString num_str;
num_str << num;

View File

@ -261,15 +261,7 @@ FString& FString::operator << (const uInt16 num)
}
//----------------------------------------------------------------------
FString& FString::operator << (const int num)
{
FString numstr(FString().setNumber(num));
_insert (length, numstr.length, numstr.string);
return *this;
}
//----------------------------------------------------------------------
FString& FString::operator << (const uInt num)
FString& FString::operator << (const sInt32 num)
{
FString numstr(FString().setNumber(num));
_insert (length, numstr.length, numstr.string);
@ -284,6 +276,14 @@ FString& FString::operator << (const sInt64 num)
return *this;
}
//----------------------------------------------------------------------
FString& FString::operator << (const uInt32 num)
{
FString numstr(FString().setNumber(num));
_insert (length, numstr.length, numstr.string);
return *this;
}
//----------------------------------------------------------------------
FString& FString::operator << (const uInt64 num)
{
@ -367,28 +367,28 @@ const FString& FString::operator >> (uInt16& num)
}
//----------------------------------------------------------------------
const FString& FString::operator >> (int& num)
const FString& FString::operator >> (sInt32& num)
{
num = toInt();
return *this;
}
//----------------------------------------------------------------------
const FString& FString::operator >> (uInt& num)
const FString& FString::operator >> (uInt32& num)
{
num = toUInt();
return *this;
}
//----------------------------------------------------------------------
const FString& FString::operator >> (long& num)
const FString& FString::operator >> (sInt64& num)
{
num = toLong();
return *this;
}
//----------------------------------------------------------------------
const FString& FString::operator >> (uLong& num)
const FString& FString::operator >> (uInt64& num)
{
num = toULong();
return *this;

View File

@ -88,8 +88,10 @@ class FLabel : public FWidget
FLabel& operator << (const FString&);
FLabel& operator << (fc::SpecialCharacter);
FLabel& operator << (const wchar_t);
FLabel& operator << (const uInt);
FLabel& operator << (const int);
FLabel& operator << (const uInt16);
FLabel& operator << (const sInt16);
FLabel& operator << (const uInt32);
FLabel& operator << (const sInt32);
FLabel& operator << (const uInt64);
FLabel& operator << (const sInt64);
FLabel& operator << (const float);

View File

@ -104,8 +104,10 @@ class FLineEdit : public FWidget
FLineEdit& operator << (const FString&);
FLineEdit& operator << (fc::SpecialCharacter);
FLineEdit& operator << (const wchar_t);
FLineEdit& operator << (const uInt);
FLineEdit& operator << (const int);
FLineEdit& operator << (const uInt16);
FLineEdit& operator << (const sInt16);
FLineEdit& operator << (const uInt32);
FLineEdit& operator << (const sInt32);
FLineEdit& operator << (const uInt64);
FLineEdit& operator << (const sInt64);
FLineEdit& operator << (const float);

View File

@ -116,8 +116,8 @@ class FString
FString& operator << (const char);
FString& operator << (const sInt16);
FString& operator << (const uInt16);
FString& operator << (const int);
FString& operator << (const uInt);
FString& operator << (const sInt32);
FString& operator << (const uInt32);
FString& operator << (const sInt64);
FString& operator << (const uInt64);
FString& operator << (const float);
@ -131,10 +131,10 @@ class FString
const FString& operator >> (char&);
const FString& operator >> (sInt16&);
const FString& operator >> (uInt16&);
const FString& operator >> (int&);
const FString& operator >> (uInt&);
const FString& operator >> (long&);
const FString& operator >> (uLong&);
const FString& operator >> (sInt32&);
const FString& operator >> (uInt32&);
const FString& operator >> (sInt64&);
const FString& operator >> (uInt64&);
const FString& operator >> (double&);
const FString& operator >> (float&);