summaryrefslogtreecommitdiffstats
path: root/libk3b/tools/k3bintvalidator.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 19:21:21 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 19:21:21 +0000
commitd8cc8bdfa7fa624a526d5aa1626974e1444cb799 (patch)
treef295f1c545b319963d5357af79fe08991d8141d9 /libk3b/tools/k3bintvalidator.cpp
parent2a39a080579fb52a2599c02b2939795385b89093 (diff)
downloadk3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.tar.gz
k3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.zip
TQt4 port k3b
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1233803 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libk3b/tools/k3bintvalidator.cpp')
-rw-r--r--libk3b/tools/k3bintvalidator.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/libk3b/tools/k3bintvalidator.cpp b/libk3b/tools/k3bintvalidator.cpp
index dabf719..ed38088 100644
--- a/libk3b/tools/k3bintvalidator.cpp
+++ b/libk3b/tools/k3bintvalidator.cpp
@@ -14,8 +14,8 @@
*/
-#include <qwidget.h>
-#include <qstring.h>
+#include <tqwidget.h>
+#include <tqstring.h>
#include "k3bintvalidator.h"
@@ -24,15 +24,15 @@
#include <kdebug.h>
-K3bIntValidator::K3bIntValidator ( QWidget * parent, const char * name )
- : QValidator(parent, name)
+K3bIntValidator::K3bIntValidator ( TQWidget * tqparent, const char * name )
+ : TQValidator(TQT_TQOBJECT(tqparent), name)
{
m_min = m_max = 0;
}
-K3bIntValidator::K3bIntValidator ( int bottom, int top, QWidget * parent, const char * name )
- : QValidator(parent, name)
+K3bIntValidator::K3bIntValidator ( int bottom, int top, TQWidget * tqparent, const char * name )
+ : TQValidator(TQT_TQOBJECT(tqparent), name)
{
m_min = bottom;
m_max = top;
@@ -44,11 +44,11 @@ K3bIntValidator::~K3bIntValidator ()
}
-QValidator::State K3bIntValidator::validate ( QString &str, int & ) const
+TQValidator::State K3bIntValidator::validate ( TQString &str, int & ) const
{
bool ok;
int val = 0;
- QString newStr;
+ TQString newStr;
newStr = str.stripWhiteSpace();
newStr = newStr.upper();
@@ -70,7 +70,7 @@ QValidator::State K3bIntValidator::validate ( QString &str, int & ) const
if( minus && m_min && m_min >= 0)
ok = false;
else
- return QValidator::Acceptable;
+ return TQValidator::Acceptable;
}
val = newStr.toInt( &ok, hex ? 16 : 10 );
@@ -83,22 +83,22 @@ QValidator::State K3bIntValidator::validate ( QString &str, int & ) const
}
if( !ok )
- return QValidator::Invalid;
+ return TQValidator::Invalid;
if( m_min && val > 0 && val < m_min )
- return QValidator::Acceptable;
+ return TQValidator::Acceptable;
if( m_max && val < 0 && val > m_max )
- return QValidator::Acceptable;
+ return TQValidator::Acceptable;
if( (m_max && val > m_max) || (m_min && val < m_min) )
- return QValidator::Invalid;
+ return TQValidator::Invalid;
- return QValidator::Valid;
+ return TQValidator::Valid;
}
-void K3bIntValidator::fixup ( QString& ) const
+void K3bIntValidator::fixup ( TQString& ) const
{
// TODO: remove preceding zeros
}
@@ -126,7 +126,7 @@ int K3bIntValidator::top () const
}
-int K3bIntValidator::toInt( const QString& s, bool* ok )
+int K3bIntValidator::toInt( const TQString& s, bool* ok )
{
if( s.lower().startsWith( "0x" ) )
return s.right( s.length()-2 ).toInt( ok, 16 );