summaryrefslogtreecommitdiffstats
path: root/src/devices/base/register.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
commit0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch)
treeb95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/devices/base/register.cpp
parentb79a2c28534cf09987eeeba3077fff9236df182a (diff)
downloadpiklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz
piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip
TQt4 port piklab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/devices/base/register.cpp')
-rw-r--r--src/devices/base/register.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/devices/base/register.cpp b/src/devices/base/register.cpp
index 85fc013..dcd4c18 100644
--- a/src/devices/base/register.cpp
+++ b/src/devices/base/register.cpp
@@ -25,12 +25,12 @@ Register::TypeData::TypeData(Address address, uint nbChars)
{
Q_ASSERT( address.isValid() && nbChars!=0 );
}
-Register::TypeData::TypeData(const QString &name, uint nbChars)
+Register::TypeData::TypeData(const TQString &name, uint nbChars)
: _nbChars(nbChars), _name(name)
{
Q_ASSERT( !name.isEmpty() && nbChars!=0 );
}
-Register::TypeData::TypeData(const QString &name, Address address, uint nbChars)
+Register::TypeData::TypeData(const TQString &name, Address address, uint nbChars)
: _nbChars(nbChars), _address(address), _name(name)
{
Q_ASSERT( address.isValid() && nbChars!=0 && !name.isEmpty() );
@@ -46,21 +46,21 @@ Register::Type Register::TypeData::type() const
return Combined;
}
-QString Register::TypeData::toString() const
+TQString Register::TypeData::toString() const
{
- return QString("%1 %2 %3").arg(toLabel(_address)).arg(_nbChars).arg(_name);
+ return TQString("%1 %2 %3").tqarg(toLabel(_address)).tqarg(_nbChars).tqarg(_name);
}
-Register::TypeData Register::TypeData::fromString(const QString &s)
+Register::TypeData Register::TypeData::fromString(const TQString &s)
{
- QStringList list = QStringList::split(" ", s);
+ TQStringList list = TQStringList::split(" ", s);
if ( list.count()<2 || list.count()>3 ) return TypeData();
bool ok;
Address address = list[0].toUInt(&ok);
if ( !ok ) return TypeData();
uint nbChars = list[1].toUInt(&ok);
if ( !ok || nbChars==0 || (nbChars%2)!=0 ) return TypeData();
- QString name;
+ TQString name;
if ( list.count()==3 ) name = list[2];
if ( !address.isValid() ) {
if ( name.isEmpty() ) return TypeData();
@@ -83,7 +83,7 @@ void Register::List::init()
void Register::List::setWatched(const TypeData &data, bool watched)
{
if (watched) {
- if ( _watched.contains(data) ) return;
+ if ( _watched.tqcontains(data) ) return;
_watched.append(data);
} else _watched.remove(data);
delayedChanged();
@@ -112,7 +112,7 @@ void Register::List::setValue(const TypeData &data, BitValue value)
delayedChanged();
}
-void Register::List::setPortData(uint index, const QMap<uint, Device::PortBitData> &data)
+void Register::List::setPortData(uint index, const TQMap<uint, Device::PortBitData> &data)
{
_portDatas[index].old = _portDatas[index].current;
_portDatas[index].current = data;
@@ -122,7 +122,7 @@ void Register::List::setPortData(uint index, const QMap<uint, Device::PortBitDat
BitValue Register::List::value(const TypeData &data) const
{
if ( !data.address().isValid() ) {
- if ( !_specials.contains(data.name()) ) return BitValue();
+ if ( !_specials.tqcontains(data.name()) ) return BitValue();
return _specials[data.name()].current;
}
Q_ASSERT( (data.nbChars()%2)==0 );
@@ -140,7 +140,7 @@ BitValue Register::List::value(const TypeData &data) const
BitValue Register::List::oldValue(const TypeData &data) const
{
if ( !data.address().isValid() ) {
- if ( !_specials.contains(data.name()) ) return BitValue();
+ if ( !_specials.tqcontains(data.name()) ) return BitValue();
return _specials[data.name()].old;
}
Q_ASSERT( (data.nbChars()%2)==0 );