summaryrefslogtreecommitdiffstats
path: root/kpercentage
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
commita374efce3a207b39514be3c52264091400ce297e (patch)
tree77bdf654b55826d4f59b53a5621310206bcaead1 /kpercentage
parentf81a494f3957d5cf38c787973415597941934727 (diff)
downloadtdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz
tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpercentage')
-rw-r--r--kpercentage/kpercentage/kanimation.cpp10
-rw-r--r--kpercentage/kpercentage/kanimation.h2
-rw-r--r--kpercentage/kpercentage/kanswer.cpp16
-rw-r--r--kpercentage/kpercentage/kanswer.h9
-rw-r--r--kpercentage/kpercentage/kpercentage.cpp8
-rw-r--r--kpercentage/kpercentage/kpercentage.docbook44
-rw-r--r--kpercentage/kpercentage/kpercentage.h3
-rw-r--r--kpercentage/kpercentage/kpercentmain.cpp36
-rw-r--r--kpercentage/kpercentage/kpercentmain.h5
-rw-r--r--kpercentage/kpercentage/ksplashscreen.cpp6
-rw-r--r--kpercentage/kpercentage/ksplashscreen.h1
11 files changed, 72 insertions, 68 deletions
diff --git a/kpercentage/kpercentage/kanimation.cpp b/kpercentage/kpercentage/kanimation.cpp
index 93974af3..6fd581a2 100644
--- a/kpercentage/kpercentage/kanimation.cpp
+++ b/kpercentage/kpercentage/kanimation.cpp
@@ -1,7 +1,7 @@
// C/C++ includes
#include <stdlib.h>
-// Qt includes
+// TQt includes
#include <tqfile.h>
// KDE includes
@@ -97,9 +97,9 @@ KStoryBoard::KStoryBoard( const TQString filename ) : TQDict<KScene>()
{
TQString s = t.readLine(); // line of text excluding '\n'
TQString dbgString = s;
- int pos = s.find ( "#");
+ int pos = s.tqfind ( "#");
if (pos==-1)
- pos = s.find ( ";");
+ pos = s.tqfind ( ";");
if ( pos > -1 )
{
dbgString = s.mid( pos +1 );
@@ -163,7 +163,7 @@ KStoryBoard::KStoryBoard( const TQString filename ) : TQDict<KScene>()
{
TQString scene_name;
current_scene->followingSceneName( scene_name );
- current_scene = find( scene_name );
+ current_scene = tqfind( scene_name );
if ( current_scene )
{
current_scene->setToStart();
@@ -181,7 +181,7 @@ KStoryBoard::KStoryBoard( const TQString filename ) : TQDict<KScene>()
void KStoryBoard::setToStart()
{
- current_scene = find( "init" );
+ current_scene = tqfind( "init" );
if ( current_scene )
current_scene->setToStart();
}
diff --git a/kpercentage/kpercentage/kanimation.h b/kpercentage/kpercentage/kanimation.h
index e4231f2a..6b16883b 100644
--- a/kpercentage/kpercentage/kanimation.h
+++ b/kpercentage/kpercentage/kanimation.h
@@ -88,7 +88,7 @@ class KStoryBoard: public TQDict<KScene>
KScene *current_scene;
};
-class KAnimation: public QCanvasSprite
+class KAnimation: public TQCanvasSprite
{
public:
KAnimation( const TQString stroy_filename, TQCanvasPixmapArray *a, TQCanvas *canvas );
diff --git a/kpercentage/kpercentage/kanswer.cpp b/kpercentage/kpercentage/kanswer.cpp
index d723629b..7e12bafc 100644
--- a/kpercentage/kpercentage/kanswer.cpp
+++ b/kpercentage/kpercentage/kanswer.cpp
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <assert.h>
-// Qt includes
+// TQt includes
#include <tqfile.h>
#include <tqlabel.h>
#include <tqlayout.h>
@@ -40,9 +40,9 @@
#include "kanimation.h"
#include "kanswer.h"
-KAnswer::KAnswer( TQWidget *parent ): KDialog( parent, "answer", TRUE )
+KAnswer::KAnswer( TQWidget *tqparent ): KDialog( tqparent, "answer", TRUE )
{
- setFont( parent->font() );
+ setFont( tqparent->font() );
// fix size for the background pixmap
setFixedSize( TQSize( 430, 190 ) );
@@ -63,12 +63,12 @@ KAnswer::KAnswer( TQWidget *parent ): KDialog( parent, "answer", TRUE )
TextLabelAnswer->setBackgroundOrigin( TQLabel::ParentOrigin );
TextLabelAnswer->setBackgroundPixmap( bgp );
- canvas->setBackgroundPixmap( bgp );
+ canvas->tqsetBackgroundPixmap( bgp );
canvas_view->setBackgroundOrigin( TQCanvasView::ParentOrigin );
canvas_view->setBackgroundPixmap( bgp );
///////
- // begin layouting
+ // begin tqlayouting
///////
mainLayout = new TQHBoxLayout( this );
mainLayout->setDirection(TQBoxLayout::LeftToRight);
@@ -103,7 +103,7 @@ KAnswer::KAnswer( TQWidget *parent ): KDialog( parent, "answer", TRUE )
rightLayout->addSpacing( 20 );
///////
- // end layouting
+ // end tqlayouting
///////
connect( ButtonOK, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) );
@@ -217,7 +217,7 @@ void KAnswer::setupSprite()
advPer = 80;
- canvas = new TQCanvas( this );
+ canvas = new TQCanvas( TQT_TQOBJECT(this) );
canvas->resize( size().width(), size().height() );
pixs = new TQCanvasPixmapArray( locate( "data", "kpercentage/pics/" )+"smily%1.png", 7 );
@@ -241,7 +241,7 @@ void KAnswer::timerEvent( TQTimerEvent *event )
int KAnswer::exec()
{
- killTimers();
+ TQT_TQOBJECT(this)->killTimers();
startTimer( 3000 ); // 5 seconds
return KDialog::exec();
}
diff --git a/kpercentage/kpercentage/kanswer.h b/kpercentage/kpercentage/kanswer.h
index 9548e990..81392869 100644
--- a/kpercentage/kpercentage/kanswer.h
+++ b/kpercentage/kpercentage/kanswer.h
@@ -22,7 +22,7 @@
#ifndef KANSWER_H
#define KANSWER_H
-// Qt includes
+// TQt includes
// KDE includes
#include <kdialog.h>
@@ -47,14 +47,15 @@ class KPushButton;
class KAnswer : public KDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
- * The constructor doesn't need any parameters but the parent,
+ * The constructor doesn't need any parameters but the tqparent,
* because it will not be used in any other context.
*
- * @param parent Parent widget for modal functionality
+ * @param tqparent Parent widget for modal functionality
*/
- KAnswer( TQWidget *parent );
+ KAnswer( TQWidget *tqparent );
// public functions
/** setting/changing feedback text and pic */
diff --git a/kpercentage/kpercentage/kpercentage.cpp b/kpercentage/kpercentage/kpercentage.cpp
index f51f8364..db4a8875 100644
--- a/kpercentage/kpercentage/kpercentage.cpp
+++ b/kpercentage/kpercentage/kpercentage.cpp
@@ -22,7 +22,7 @@
// C/C++ includes
#include <stdlib.h>
-// Qt includes
+// TQt includes
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqtooltip.h>
@@ -60,7 +60,7 @@ KPercentage::KPercentage( const char *name ) :
// prepare exercise window, that will use the fontsize above!
percent_main = new KPercentMain( this, "KPercentage" );
- // fixed geometry bacause of background pixmap
+ // fixed tqgeometry bacause of background pixmap
setFixedSize( TQSize( 548, 248 ) );
/** load and set background pixmap */
@@ -108,7 +108,7 @@ KPercentage::KPercentage( const char *name ) :
connect( button_close, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) );
////////
- // begin layouting
+ // begin tqlayouting
////////
TQVBoxLayout *main_layout = new TQVBoxLayout( this, 20, 20, "main_layout" );
main_layout->setResizeMode( TQLayout::FreeResize );
@@ -145,7 +145,7 @@ KPercentage::KPercentage( const char *name ) :
main_layout->addStretch();
////////
- // end layouting
+ // end tqlayouting
////////
////////
diff --git a/kpercentage/kpercentage/kpercentage.docbook b/kpercentage/kpercentage/kpercentage.docbook
index c356b9f8..318698a3 100644
--- a/kpercentage/kpercentage/kpercentage.docbook
+++ b/kpercentage/kpercentage/kpercentage.docbook
@@ -243,7 +243,7 @@ Programming &kpercentage; plugins is a joy to behold. Just read through the next
should consult the docbook reference for further details. The example below was
taken from that reference and shortened a bit for readability. -->
-<refentry id="re-1007-unmanagechildren-1">
+<refentry id="re-1007-unmanagetqchildren-1">
<refmeta>
<refentrytitle>XtUnmanageChildren</refentrytitle>
<refmiscinfo>Xt - Geometry Management</refmiscinfo>
@@ -251,26 +251,26 @@ taken from that reference and shortened a bit for readability. -->
<refnamediv>
<refname>XtUnmanageChildren
</refname>
-<refpurpose>remove a list of children from a parent widget's managed list.
+<refpurpose>remove a list of tqchildren from a tqparent widget's managed list.
</refpurpose>
-<indexterm id="ix-1007-unmanagechildren-1"><primary>widgets</primary><secondary>removing</secondary></indexterm>
-<indexterm id="ix-1007-unmanagechildren-2"><primary>XtUnmanageChildren</primary></indexterm>
+<indexterm id="ix-1007-unmanagetqchildren-1"><primary>widgets</primary><secondary>removing</secondary></indexterm>
+<indexterm id="ix-1007-unmanagetqchildren-2"><primary>XtUnmanageChildren</primary></indexterm>
</refnamediv>
<refsynopsisdiv>
<refsynopsisdivinfo>
<date>4 March 1996</date>
</refsynopsisdivinfo>
<synopsis>
-void XtUnmanageChildren(<replaceable class="parameter">children</replaceable>, <replaceable class="parameter">num_children</replaceable>)
- WidgetList <replaceable class="parameter">children</replaceable>;
- Cardinal <replaceable class="parameter">num_children</replaceable>;
+void XtUnmanageChildren(<replaceable class="parameter">tqchildren</replaceable>, <replaceable class="parameter">num_tqchildren</replaceable>)
+ WidgetList <replaceable class="parameter">tqchildren</replaceable>;
+ Cardinal <replaceable class="parameter">num_tqchildren</replaceable>;
</synopsis>
-<refsect2 id="r2-1007-unmanagechildren-1">
+<refsect2 id="r2-1007-unmanagetqchildren-1">
<title>Inputs</title>
<variablelist>
<varlistentry>
-<term><replaceable class="parameter">children</replaceable>
+<term><replaceable class="parameter">tqchildren</replaceable>
</term>
<listitem>
<para>Specifies an array of child widgets. Each child must be of
@@ -279,40 +279,40 @@ class RectObj or any subclass thereof.
</listitem>
</varlistentry>
<varlistentry>
-<term><replaceable class="parameter">num_children</replaceable>
+<term><replaceable class="parameter">num_tqchildren</replaceable>
</term>
<listitem>
-<para>Specifies the number of elements in <replaceable class="parameter">children</replaceable>.
+<para>Specifies the number of elements in <replaceable class="parameter">tqchildren</replaceable>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2></refsynopsisdiv>
-<refsect1 id="r1-1007-unmanagechildren-1">
+<refsect1 id="r1-1007-unmanagetqchildren-1">
<title>Description
</title>
<para><function>XtUnmanageChildren()</function> unmaps the specified widgets
-and removes them from their parent's geometry management.
+and removes them from their tqparent's tqgeometry management.
The widgets will disappear from the screen, and (depending
-on its parent) may no longer have screen space allocated for
+on its tqparent) may no longer have screen space allocated for
them.
</para>
-<para>Each of the widgets in the <replaceable class="parameter">children</replaceable> array must have
-the same parent.
+<para>Each of the widgets in the <replaceable class="parameter">tqchildren</replaceable> array must have
+the same tqparent.
</para>
<para>See the &ldquo;Algorithm&rdquo; section below for full details of the
widget unmanagement procedure.
</para>
</refsect1>
-<refsect1 id="r1-1007-unmanagechildren-2">
+<refsect1 id="r1-1007-unmanagetqchildren-2">
<title>Usage</title>
<para>Unmanaging widgets is the usual method for temporarily
making them invisible. They can be re-managed with
<function>XtManageChildren()</function>.
</para>
-<para>You can unmap a widget, but leave it under geometry
+<para>You can unmap a widget, but leave it under tqgeometry
management by calling <function>XtUnmapWidget()</function>. You can
destroy a widget's window without destroying the widget by
calling <function>XtUnrealizeWidget()</function>. You can destroy a
@@ -324,12 +324,12 @@ often more convenient to call <function>XtUnmanageChild()</function>
several times than it is to declare and initialize an array
of widgets to pass to <function>XtUnmanageChildren()</function>. Calling
<function>XtUnmanageChildren()</function> is more efficient, however,
-because it only calls the parent's <function>change_managed()</function>
+because it only calls the tqparent's <function>change_managed()</function>
method once.
</para>
</refsect1>
-<refsect1 id="r1-1007-unmanagechildren-3">
+<refsect1 id="r1-1007-unmanagetqchildren-3">
<title>Algorithm
</title>
<para><function>XtUnmanageChildren()</function> performs the following:
@@ -358,11 +358,11 @@ by unmapping it.
</para>
</refsect1>
-<refsect1 id="r1-1007-unmanagechildren-4">
+<refsect1 id="r1-1007-unmanagetqchildren-4">
<title>Structures</title>
<para>The <type>WidgetList</type> type is simply an array of widgets:
</para>
-<screen id="sc-1007-unmanagechildren-1">typedef Widget *WidgetList;
+<screen id="sc-1007-unmanagetqchildren-1">typedef Widget *WidgetList;
</screen>
</refsect1>
</refentry>
diff --git a/kpercentage/kpercentage/kpercentage.h b/kpercentage/kpercentage/kpercentage.h
index c4b9b42c..cf904ee6 100644
--- a/kpercentage/kpercentage/kpercentage.h
+++ b/kpercentage/kpercentage/kpercentage.h
@@ -26,7 +26,7 @@
#include <config.h>
#endif
-// Qt includes
+// TQt includes
#include <tqspinbox.h>
// KDE includes
@@ -49,6 +49,7 @@
class KPercentage : public KDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
/** construtor */
KPercentage( const char *name=0 );
diff --git a/kpercentage/kpercentage/kpercentmain.cpp b/kpercentage/kpercentage/kpercentmain.cpp
index 67f4a687..e1966ba3 100644
--- a/kpercentage/kpercentage/kpercentmain.cpp
+++ b/kpercentage/kpercentage/kpercentmain.cpp
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <time.h>
-// Qt includes
+// TQt includes
#include <tqlayout.h>
#include <tqlabel.h>
#include <tqprogressbar.h>
@@ -42,10 +42,10 @@
#include "kpercentage.h"
-KPercentMain::KPercentMain( TQWidget *parent, const char *name ) :
- KDialog( parent, name, TRUE ) // TRUE for modal dialog
+KPercentMain::KPercentMain( TQWidget *tqparent, const char *name ) :
+ KDialog( tqparent, name, TRUE ) // TRUE for modal dialog
{
- setFont( parent->font() );
+ setFont( tqparent->font() );
/** load and set the background pixmap */
TQPixmap bgp( locate( "data", TQApplication::reverseLayout() ? "kpercentage/pics/kpercentmain_bg_rtl.png" : "kpercentage/pics/kpercentmain_bg.png" ) );
// resize( 520, 220 );
@@ -55,15 +55,15 @@ KPercentMain::KPercentMain( TQWidget *parent, const char *name ) :
KIntValidator *validLine = new KIntValidator( this );
line_edit_percentage = new TQLineEdit( this, "line_edit_percentage" );
- line_edit_percentage->setAlignment( int( TQLineEdit::AlignHCenter ) );
+ line_edit_percentage->tqsetAlignment( int( TQLineEdit::AlignHCenter ) );
line_edit_percentage->setValidator( validLine );
line_edit_basevalue = new TQLineEdit( this, "line_edit_basevalue" );
- line_edit_basevalue->setAlignment( int( TQLineEdit::AlignHCenter ) );
+ line_edit_basevalue->tqsetAlignment( int( TQLineEdit::AlignHCenter ) );
line_edit_basevalue->setValidator( validLine );
line_edit_percentvalue = new TQLineEdit( this, "line_edit_percentvalue" );
- line_edit_percentvalue->setAlignment( int( TQLineEdit::AlignHCenter ) );
+ line_edit_percentvalue->tqsetAlignment( int( TQLineEdit::AlignHCenter ) );
line_edit_percentvalue->setValidator( validLine );
progress_bar_count = new TQProgressBar( this, "progress_bar_count" );
@@ -119,7 +119,7 @@ KPercentMain::KPercentMain( TQWidget *parent, const char *name ) :
label_count->setBackgroundOrigin( TQDialog::ParentOrigin );
//////
- // begin layouting
+ // begin tqlayouting
//////
TQVBoxLayout *main_layout = new TQVBoxLayout ( this, 0, -1, "main_layout" );
main_layout->setMargin( 20 );
@@ -197,17 +197,17 @@ KPercentMain::KPercentMain( TQWidget *parent, const char *name ) :
void KPercentMain::newTask()
{
// no Editline can be focused
- line_edit_percentage->setFocusPolicy( NoFocus );
- line_edit_basevalue->setFocusPolicy( NoFocus );
- line_edit_percentvalue->setFocusPolicy( NoFocus );
+ line_edit_percentage->setFocusPolicy( TQ_NoFocus );
+ line_edit_basevalue->setFocusPolicy( TQ_NoFocus );
+ line_edit_percentvalue->setFocusPolicy( TQ_NoFocus );
// set the number of managed tasks into a label
- label_count->setText( TQString( i18n("You got %1 of %2 exercises.").arg(count).arg(number) ) ); // update Label for the Progress
+ label_count->setText( TQString( i18n("You got %1 of %2 exercises.").tqarg(count).tqarg(number) ) ); // update Label for the Progress
// progress_bar_count->setProgress( count*100 ); // updating Progrssbar
startTimer( 10 );
// set string which task is just workin on (Task x of y)
- TQString taskNumber( i18n( "Exercise no. %1:" ).arg(count+1) );
+ TQString taskNumber( i18n( "Exercise no. %1:" ).tqarg(count+1) );
label_number->setText( taskNumber );
// label_number->adjustSize();
@@ -245,7 +245,7 @@ void KPercentMain::newTask()
// delete this one
line_edit_input->clear();
// make the line_edit_layout accessable
- line_edit_input->setFocusPolicy( StrongFocus );
+ line_edit_input->setFocusPolicy( TQ_StrongFocus );
// set the focus on it
line_edit_input->setFocus();
}
@@ -292,8 +292,8 @@ void KPercentMain::slotApplyInput()
total_answers++;
progress_bar_right_wrong->setTotalSteps( total_answers );
progress_bar_right_wrong->setProgress( right_answers );
- label_right->setText( i18n( "%1%\nright" ).arg( (100*right_answers)/total_answers ) );
- label_wrong->setText( i18n( "%1%\nwrong" ).arg( 100-(100*right_answers)/total_answers ) );
+ label_right->setText( i18n( "%1%\nright" ).tqarg( (100*right_answers)/total_answers ) );
+ label_wrong->setText( i18n( "%1%\nwrong" ).tqarg( 100-(100*right_answers)/total_answers ) );
newTask(); // next task, perhaps
}
@@ -304,8 +304,8 @@ void KPercentMain::slotApplyInput()
total_answers++;
progress_bar_right_wrong->setTotalSteps( total_answers );
progress_bar_right_wrong->setProgress( right_answers );
- label_right->setText( i18n( "%1%\nright" ).arg( (100*right_answers)/total_answers ) );
- label_wrong->setText( i18n( "%1%\nwrong" ).arg( 100-(100*right_answers)/total_answers ) );
+ label_right->setText( i18n( "%1%\nright" ).tqarg( (100*right_answers)/total_answers ) );
+ label_wrong->setText( i18n( "%1%\nwrong" ).tqarg( 100-(100*right_answers)/total_answers ) );
}
}
}
diff --git a/kpercentage/kpercentage/kpercentmain.h b/kpercentage/kpercentage/kpercentmain.h
index 51004dc5..789d2755 100644
--- a/kpercentage/kpercentage/kpercentmain.h
+++ b/kpercentage/kpercentage/kpercentmain.h
@@ -22,7 +22,7 @@
#ifndef KPERCENTMAIN_H
#define KPERCENTMAIN_H
-// Qt includes
+// TQt includes
// KDE includes
@@ -44,8 +44,9 @@ class TQVBoxLayout;
class KPercentMain : public KDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- KPercentMain( TQWidget *parent, const char *name = 0 );
+ KPercentMain( TQWidget *tqparent, const char *name = 0 );
/** checks, if the task is solved right */
bool validateTask();
/** prepares the dialog for a new task */
diff --git a/kpercentage/kpercentage/ksplashscreen.cpp b/kpercentage/kpercentage/ksplashscreen.cpp
index 4eb43959..226fa881 100644
--- a/kpercentage/kpercentage/ksplashscreen.cpp
+++ b/kpercentage/kpercentage/ksplashscreen.cpp
@@ -19,7 +19,7 @@
* *
***************************************************************************/
-// Qt includes
+// TQt includes
#include <tqcanvas.h>
#include <tqtimer.h>
@@ -39,10 +39,10 @@ KSplashScreen::KSplashScreen( KPercentage *percentage, const char *name ) :
/* load the background pixmap */
TQPixmap bgp( locate( "data", "kpercentage/pics/splash.png" ) );
/* wait some time and start the main window */
- TQCanvas *canvas = new TQCanvas( this );
+ TQCanvas *canvas = new TQCanvas( TQT_TQOBJECT(this) );
canvas->resize( 400, 300 );
/* set the background pixmap */
- canvas->setBackgroundPixmap( bgp );
+ canvas->tqsetBackgroundPixmap( bgp );
//remove version number from splash annma 14/02/2005
//TQCanvasText *t = new TQCanvasText( KPERCENTAGE_VERSION, canvas );
//t->move( 330.0, 260.0 );
diff --git a/kpercentage/kpercentage/ksplashscreen.h b/kpercentage/kpercentage/ksplashscreen.h
index a9ffe655..638dc2a9 100644
--- a/kpercentage/kpercentage/ksplashscreen.h
+++ b/kpercentage/kpercentage/ksplashscreen.h
@@ -35,6 +35,7 @@ class KPercentage;
class KSplashScreen : public KDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */