summaryrefslogtreecommitdiffstats
path: root/kpercentage/kpercentage/kpercentage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kpercentage/kpercentage/kpercentage.cpp')
-rw-r--r--kpercentage/kpercentage/kpercentage.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/kpercentage/kpercentage/kpercentage.cpp b/kpercentage/kpercentage/kpercentage.cpp
index d8ff8e34..f51f8364 100644
--- a/kpercentage/kpercentage/kpercentage.cpp
+++ b/kpercentage/kpercentage/kpercentage.cpp
@@ -23,10 +23,10 @@
#include <stdlib.h>
// Qt includes
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
// KDE includes
#include <khelpmenu.h>
@@ -52,7 +52,7 @@ KPercentage::KPercentage( const char *name ) :
KIconLoader icon_loader;
// let's set a suitable, not too small font size
- QFont the_font( font() );
+ TQFont the_font( font() );
the_font.setPointSize( 14 );
//the_font.setBold(true);
setFont( the_font );
@@ -61,59 +61,59 @@ KPercentage::KPercentage( const char *name ) :
percent_main = new KPercentMain( this, "KPercentage" );
// fixed geometry bacause of background pixmap
- setFixedSize( QSize( 548, 248 ) );
+ setFixedSize( TQSize( 548, 248 ) );
/** load and set background pixmap */
- QPixmap bgp( locate( "data", QApplication::reverseLayout() ? "kpercentage/pics/kpercentage_bg_rtl.png" : "kpercentage/pics/kpercentage_bg.png" ) );
+ TQPixmap bgp( locate( "data", TQApplication::reverseLayout() ? "kpercentage/pics/kpercentage_bg_rtl.png" : "kpercentage/pics/kpercentage_bg.png" ) );
setBackgroundPixmap( bgp );
- QLabel *label_number = new QLabel( i18n( "Number of tasks:" ), this );
- QLabel *label_level = new QLabel( i18n( "Level:" ), this );
- QLabel *label_choose = new QLabel( i18n( "Choose an exercise type:" ), this );
+ TQLabel *label_number = new TQLabel( i18n( "Number of tasks:" ), this );
+ TQLabel *label_level = new TQLabel( i18n( "Level:" ), this );
+ TQLabel *label_choose = new TQLabel( i18n( "Choose an exercise type:" ), this );
/** make labels transparent */
label_number->setBackgroundPixmap( bgp );
- label_number->setBackgroundOrigin( QLabel::ParentOrigin );
+ label_number->setBackgroundOrigin( TQLabel::ParentOrigin );
label_level->setBackgroundPixmap( bgp );
- label_level->setBackgroundOrigin( QLabel::ParentOrigin );
+ label_level->setBackgroundOrigin( TQLabel::ParentOrigin );
label_choose->setBackgroundPixmap( bgp );
- label_choose->setBackgroundOrigin( QLabel::ParentOrigin );
+ label_choose->setBackgroundOrigin( TQLabel::ParentOrigin );
KPushButton *button_basevalue = new KPushButton( i18n( "x% &of ?? = y" ), this );
KPushButton *button_percentvalue = new KPushButton( i18n( "x% of &y = ??" ), this );
KPushButton *button_percentage = new KPushButton( i18n( "??% o&f x = y" ), this );
KPushButton *button_random = new KPushButton( i18n( "??" ), this );
KPushButton *button_help = new KPushButton( KStdGuiItem::help().text(), this );
- button_help->setIconSet( QIconSet( icon_loader.loadIcon( "help", KIcon::NoGroup, 32 ) ) );
+ button_help->setIconSet( TQIconSet( icon_loader.loadIcon( "help", KIcon::NoGroup, 32 ) ) );
KHelpMenu *help_menu = new KHelpMenu( this, KGlobal::instance()->aboutData(), true );
- button_help->setPopup( ( QPopupMenu* ) ( help_menu->menu() ) );
+ button_help->setPopup( ( TQPopupMenu* ) ( help_menu->menu() ) );
KPushButton *button_close = new KPushButton( i18n( "E&xit" ), this );
- button_close->setIconSet( QIconSet( icon_loader.loadIcon( "exit", KIcon::NoGroup, 32 ) ) );
+ button_close->setIconSet( TQIconSet( icon_loader.loadIcon( "exit", KIcon::NoGroup, 32 ) ) );
combo_box_level = new KComboBox( this );
combo_box_level->insertItem( i18n( "Easy" ) );
combo_box_level->insertItem( i18n( "Medium" ) );
combo_box_level->insertItem( i18n( "Crazy" ) );
- spin_box_number = new QSpinBox( 1, 10, 1, this );
+ spin_box_number = new TQSpinBox( 1, 10, 1, this );
spin_box_number->setValue( 5 );
// connecting all the slots
- connect( button_basevalue, SIGNAL( clicked() ), this, SLOT( selBasevalue() ) );
- connect( button_percentvalue, SIGNAL( clicked() ), this, SLOT( selPercentvalue() ) );
- connect( button_percentage, SIGNAL( clicked() ), this, SLOT( selPercentage() ) );
- connect( button_random, SIGNAL( clicked() ), this, SLOT( selRandom() ) );
- connect( button_help, SIGNAL( clicked() ), this, SLOT( needHelp() ) );
- connect( button_close, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( button_basevalue, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selBasevalue() ) );
+ connect( button_percentvalue, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selPercentvalue() ) );
+ connect( button_percentage, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selPercentage() ) );
+ connect( button_random, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selRandom() ) );
+ connect( button_help, TQT_SIGNAL( clicked() ), this, TQT_SLOT( needHelp() ) );
+ connect( button_close, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) );
////////
// begin layouting
////////
- QVBoxLayout *main_layout = new QVBoxLayout( this, 20, 20, "main_layout" );
- main_layout->setResizeMode( QLayout::FreeResize );
+ TQVBoxLayout *main_layout = new TQVBoxLayout( this, 20, 20, "main_layout" );
+ main_layout->setResizeMode( TQLayout::FreeResize );
- QHBoxLayout *top_layout = new QHBoxLayout( main_layout, -1, "top_layout" );
+ TQHBoxLayout *top_layout = new TQHBoxLayout( main_layout, -1, "top_layout" );
top_layout->addWidget( label_number );
top_layout->addWidget( spin_box_number );
top_layout->addSpacing( 20 );
@@ -124,12 +124,12 @@ KPercentage::KPercentage( const char *name ) :
main_layout->addSpacing( 40 );
main_layout->addStretch();
- QHBoxLayout *bottom_layout = new QHBoxLayout( main_layout, -1, "bottom_layout" );
- QVBoxLayout *bLeftLayout = new QVBoxLayout( bottom_layout );
+ TQHBoxLayout *bottom_layout = new TQHBoxLayout( main_layout, -1, "bottom_layout" );
+ TQVBoxLayout *bLeftLayout = new TQVBoxLayout( bottom_layout );
bLeftLayout->addWidget( label_choose );
bLeftLayout->addSpacing( 10 );
- QGridLayout *grid_layout = new QGridLayout( bLeftLayout, 2, 2, 10 );
+ TQGridLayout *grid_layout = new TQGridLayout( bLeftLayout, 2, 2, 10 );
grid_layout->addWidget( button_basevalue, 0, 0 );
grid_layout->addWidget( button_percentvalue, 1, 0 );
grid_layout->addWidget( button_percentage, 0, 1 );
@@ -137,7 +137,7 @@ KPercentage::KPercentage( const char *name ) :
bottom_layout->addStretch();
- QVBoxLayout *b_right_layout = new QVBoxLayout( bottom_layout );
+ TQVBoxLayout *b_right_layout = new TQVBoxLayout( bottom_layout );
b_right_layout->addStretch();
b_right_layout->addWidget( button_help );
b_right_layout->addSpacing( 10 );
@@ -150,25 +150,25 @@ KPercentage::KPercentage( const char *name ) :
////////
// Tooltips
- QToolTip::add( button_basevalue, i18n( "Exercises with base value omitted" ) );
- QToolTip::add( button_percentvalue, i18n( "Exercises with percent value omitted" ) );
- QToolTip::add( button_percentage, i18n( "Exercises with percentage omitted" ) );
- QToolTip::add( button_random, i18n( "Several exercise types in random" ) );
- QToolTip::add( spin_box_number, i18n( "Choose the number of exercises from 1 to 10." ) );
- QToolTip::add( combo_box_level, i18n( "Choose the level of difficulty." ) );
- QToolTip::add( button_close, i18n( "Close KPercentage." ) );
- QToolTip::add( button_help, i18n( "Get some help." ) );
+ TQToolTip::add( button_basevalue, i18n( "Exercises with base value omitted" ) );
+ TQToolTip::add( button_percentvalue, i18n( "Exercises with percent value omitted" ) );
+ TQToolTip::add( button_percentage, i18n( "Exercises with percentage omitted" ) );
+ TQToolTip::add( button_random, i18n( "Several exercise types in random" ) );
+ TQToolTip::add( spin_box_number, i18n( "Choose the number of exercises from 1 to 10." ) );
+ TQToolTip::add( combo_box_level, i18n( "Choose the level of difficulty." ) );
+ TQToolTip::add( button_close, i18n( "Close KPercentage." ) );
+ TQToolTip::add( button_help, i18n( "Get some help." ) );
////////
// WhatsThis
- QWhatsThis::add( button_basevalue, i18n( "Click here to start a sequence of exercises where the base value is omitted.") );
- QWhatsThis::add( button_percentvalue, i18n( "Click here to start a sequence of exercises where the percent value is omitted." ) );
- QWhatsThis::add( button_percentage, i18n( "Click here to start a sequence of exercises where the percentage is omitted." ) );
- QWhatsThis::add( button_random, i18n( "Click here to start a sequence of exercises where one value is omitted at random." ) );
- QWhatsThis::add( spin_box_number, i18n( "Here you can adjust the number of exercises from 1 to 10." ) );
- QWhatsThis::add( combo_box_level, i18n( "Choose one of the levels <i>easy</i>, <i>medium</i>, and <i>crazy</i>." ) );
- QWhatsThis::add( button_close, i18n( "Close KPercentage." ) );
- QWhatsThis::add( button_help, i18n( "Get some help." ) );
+ TQWhatsThis::add( button_basevalue, i18n( "Click here to start a sequence of exercises where the base value is omitted.") );
+ TQWhatsThis::add( button_percentvalue, i18n( "Click here to start a sequence of exercises where the percent value is omitted." ) );
+ TQWhatsThis::add( button_percentage, i18n( "Click here to start a sequence of exercises where the percentage is omitted." ) );
+ TQWhatsThis::add( button_random, i18n( "Click here to start a sequence of exercises where one value is omitted at random." ) );
+ TQWhatsThis::add( spin_box_number, i18n( "Here you can adjust the number of exercises from 1 to 10." ) );
+ TQWhatsThis::add( combo_box_level, i18n( "Choose one of the levels <i>easy</i>, <i>medium</i>, and <i>crazy</i>." ) );
+ TQWhatsThis::add( button_close, i18n( "Close KPercentage." ) );
+ TQWhatsThis::add( button_help, i18n( "Get some help." ) );
}
void KPercentage::selPercentage()
@@ -210,7 +210,7 @@ void KPercentage::startExercise()
percent_main->setNumber( spin_box_number->value() );
percent_main->selected_level = combo_box_level->currentItem();
percent_main->initExercise();
- QPoint p = pos();
+ TQPoint p = pos();
hide();
percent_main->move( p );
percent_main->exec();
@@ -223,7 +223,7 @@ void KPercentage::needHelp()
kapp->invokeHelp( "", "kpercentage" );
}
-void KPercentage::closeEvent( QCloseEvent * )
+void KPercentage::closeEvent( TQCloseEvent * )
{
exit( 0 );
}