diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kchart/kchartLegendConfigPage.cc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kchart/kchartLegendConfigPage.cc')
-rw-r--r-- | kchart/kchartLegendConfigPage.cc | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/kchart/kchartLegendConfigPage.cc b/kchart/kchartLegendConfigPage.cc index 7c30bcdd..fdbf3f10 100644 --- a/kchart/kchartLegendConfigPage.cc +++ b/kchart/kchartLegendConfigPage.cc @@ -26,13 +26,13 @@ #include <kfontdialog.h> #include <kiconloader.h> -#include <qlabel.h> -#include <qbuttongroup.h> -#include <qvbuttongroup.h> -#include <qradiobutton.h> -#include <qlineedit.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqlabel.h> +#include <tqbuttongroup.h> +#include <tqvbuttongroup.h> +#include <tqradiobutton.h> +#include <tqlineedit.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include "kchart_params.h" #include "kchart_factory.h" @@ -45,36 +45,36 @@ namespace KChart KChartLegendConfigPage::KChartLegendConfigPage( KChartParams* params, - QWidget* parent ) : - QWidget( parent ),_params( params ) + TQWidget* tqparent ) : + TQWidget( tqparent ),_params( params ) { //Layout for 4 blocks - QGridLayout* layout = new QGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); + TQGridLayout* tqlayout = new TQGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); //1. Block: General settings - QButtonGroup* gb = new QButtonGroup( 0, Qt::Vertical, i18n("General"), this ); - gb->layout()->setSpacing(KDialog::spacingHint()); - gb->layout()->setMargin(KDialog::marginHint()); - layout->addWidget( gb, 0, 0 ); + TQButtonGroup* gb = new TQButtonGroup( 0, Qt::Vertical, i18n("General"), this ); + gb->tqlayout()->setSpacing(KDialog::spacingHint()); + gb->tqlayout()->setMargin(KDialog::marginHint()); + tqlayout->addWidget( gb, 0, 0 ); - QGridLayout *grid2 = new QGridLayout( gb->layout(), 4, 2 ); + TQGridLayout *grid2 = new TQGridLayout( gb->tqlayout(), 4, 2 ); - QLabel* lab = new QLabel( i18n("Title:"), gb ); - QWhatsThis::add(lab, i18n("Write here the title of the legend, which is displayed at the top of the legend box.")); + TQLabel* lab = new TQLabel( i18n("Title:"), gb ); + TQWhatsThis::add(lab, i18n("Write here the title of the legend, which is displayed at the top of the legend box.")); grid2->addWidget( lab, 0, 0 ); - title = new QLineEdit( gb ); + title = new TQLineEdit( gb ); grid2->addWidget( title, 0, 1 ); // 2. Block: Legend position - gb = new QButtonGroup( 0, Qt::Vertical, i18n("Legend Position"), this ); - QWhatsThis::add(gb, i18n("<qt>Choose the location of the legend on the chart by " + gb = new TQButtonGroup( 0, Qt::Vertical, i18n("Legend Position"), this ); + TQWhatsThis::add(gb, i18n("<qt>Choose the location of the legend on the chart by " "clicking a location button.\nUse the central button to <b>hide</b> the legend.</qt>")); - gb->layout()->setSpacing(KDialog::spacingHint()); - gb->layout()->setMargin(KDialog::marginHint()); + gb->tqlayout()->setSpacing(KDialog::spacingHint()); + gb->tqlayout()->setMargin(KDialog::marginHint()); gb->setExclusive( true ); - QGridLayout *grid1 = new QGridLayout( gb->layout(), 5, 5 ); + TQGridLayout *grid1 = new TQGridLayout( gb->tqlayout(), 5, 5 ); lTopLeft = addButton( grid1, gb, i18n("Top-Left"), "chart_legend_topleft", 0, 0 ); lTopLeftTop = addButton( grid1, gb, i18n("Top-Left-Top"), "chart_legend_toplefttop", 0, 1 ); @@ -98,86 +98,86 @@ KChartLegendConfigPage::KChartLegendConfigPage( KChartParams* params, lBottomRightBottom= addButton( grid1, gb, i18n("Bottom-Right-Bottom"), "chart_legend_bottomrightbottom",4, 3 ); lBottomRight = addButton( grid1, gb, i18n("Bottom-Right"), "chart_legend_bottomright", 4, 4 ); - gb->setAlignment( Qt::AlignLeft ); - layout->addMultiCellWidget( gb, 1,2, 0,0 ); + gb->tqsetAlignment( TQt::AlignLeft ); + tqlayout->addMultiCellWidget( gb, 1,2, 0,0 ); // 3. Block: Font - gb = new QButtonGroup( 0, Qt::Vertical, i18n("Font"), this ); - QWhatsThis::add(gb, i18n("This Font box can be used to set different fonts for the legend title and the individual entries.")); - gb->layout()->setSpacing(KDialog::spacingHint()); - gb->layout()->setMargin(KDialog::marginHint()); - layout->addWidget( gb, 0, 1 ); + gb = new TQButtonGroup( 0, Qt::Vertical, i18n("Font"), this ); + TQWhatsThis::add(gb, i18n("This Font box can be used to set different fonts for the legend title and the individual entries.")); + gb->tqlayout()->setSpacing(KDialog::spacingHint()); + gb->tqlayout()->setMargin(KDialog::marginHint()); + tqlayout->addWidget( gb, 0, 1 ); - QGridLayout *grid4 = new QGridLayout( gb->layout(), 4, 2 ); - titleLegendFontButton = new QPushButton( gb ); + TQGridLayout *grid4 = new TQGridLayout( gb->tqlayout(), 4, 2 ); + titleLegendFontButton = new TQPushButton( gb ); - lab = new QLabel( i18n("Legend title font:"), gb ); + lab = new TQLabel( i18n("Legend title font:"), gb ); grid4->addWidget( lab, 0 ,0 ); titleLegendFontButton->setText( i18n("Select Font...") ); - QWhatsThis::add(titleLegendFontButton, i18n("Click here to display the KDE font chooser dialog. You will be able to change the font family, style and size for the legend title.")); + TQWhatsThis::add(titleLegendFontButton, i18n("Click here to display the KDE font chooser dialog. You will be able to change the font family, style and size for the legend title.")); grid4->addWidget( titleLegendFontButton, 1, 0 ); - lab = new QLabel( i18n("Legend text font:"), gb ); + lab = new TQLabel( i18n("Legend text font:"), gb ); grid4->addWidget( lab, 2, 0 ); - textLegendFontButton = new QPushButton( gb ); + textLegendFontButton = new TQPushButton( gb ); textLegendFontButton->setText( i18n("Select Font...") ); - QWhatsThis::add(textLegendFontButton, i18n("Click here to display the KDE font chooser dialog. You will be able to change the font family, style and size for the legend text.")); + TQWhatsThis::add(textLegendFontButton, i18n("Click here to display the KDE font chooser dialog. You will be able to change the font family, style and size for the legend text.")); grid4->addWidget( textLegendFontButton, 3, 0 ); - connect( titleLegendFontButton, SIGNAL(clicked()), - this, SLOT(changeTitleLegendFont())); - connect( textLegendFontButton, SIGNAL(clicked()), - this, SLOT(changeTextLegendFont())); + connect( titleLegendFontButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(changeTitleLegendFont())); + connect( textLegendFontButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(changeTextLegendFont())); - // 4. Block: Orientation - orientationGroup = new QVButtonGroup( i18n("Orientation"), this ); - QWhatsThis::add(orientationGroup, i18n("Select, if the legend's items should be drawn next to each other, or below each other.")); + // 4. Block: Qt::Orientation + orientationGroup = new TQVButtonGroup( i18n("Qt::Orientation"), this ); + TQWhatsThis::add(orientationGroup, i18n("Select, if the legend's items should be drawn next to each other, or below each other.")); orientationGroup->setRadioButtonExclusive(true); - orientationGroup->layout()->setSpacing(KDialog::spacingHint()); - orientationGroup->layout()->setMargin(KDialog::marginHint()); - layout->addWidget( orientationGroup, 1, 1 ); + orientationGroup->tqlayout()->setSpacing(KDialog::spacingHint()); + orientationGroup->tqlayout()->setMargin(KDialog::marginHint()); + tqlayout->addWidget( orientationGroup, 1, 1 ); - QRadioButton* orientation = new QRadioButton( i18n("Vertically"), orientationGroup ); - orientation = new QRadioButton( i18n("Horizontally"), orientationGroup ); + TQRadioButton* orientation = new TQRadioButton( i18n("Vertically"), orientationGroup ); + orientation = new TQRadioButton( i18n("Horizontally"), orientationGroup ); Q_UNUSED(orientation); // 5. Block: Text Colors - gb = new QButtonGroup( 0, Qt::Vertical, i18n("Color"), this ); - QWhatsThis::add(gb, i18n("This Color box can be used to set different colors for the legend title and text.")); - gb->layout()->setSpacing(KDialog::spacingHint()); - gb->layout()->setMargin(KDialog::marginHint()); - layout->addWidget( gb, 2, 1 ); + gb = new TQButtonGroup( 0, Qt::Vertical, i18n("Color"), this ); + TQWhatsThis::add(gb, i18n("This Color box can be used to set different colors for the legend title and text.")); + gb->tqlayout()->setSpacing(KDialog::spacingHint()); + gb->tqlayout()->setMargin(KDialog::marginHint()); + tqlayout->addWidget( gb, 2, 1 ); - QGridLayout *grid3 = new QGridLayout( gb->layout(), 6, 2 ); + TQGridLayout *grid3 = new TQGridLayout( gb->tqlayout(), 6, 2 ); - lab = new QLabel( i18n("Legend title color:"), gb ); + lab = new TQLabel( i18n("Legend title color:"), gb ); grid3->addWidget( lab, 0, 0 ); legendTitleColor = new KColorButton( gb ); - QWhatsThis::add(legendTitleColor, i18n("Click here to display the KDE Select Color dialog. You will be able to change the color for the legend title.")); + TQWhatsThis::add(legendTitleColor, i18n("Click here to display the KDE Select Color dialog. You will be able to change the color for the legend title.")); grid3->addWidget( legendTitleColor, 1, 0 ); - lab = new QLabel( i18n("Legend text color:"), gb ); + lab = new TQLabel( i18n("Legend text color:"), gb ); grid3->addWidget( lab, 2, 0 ); legendTextColor = new KColorButton( gb ); - QWhatsThis::add(legendTextColor, i18n("Click here to display the KDE Select Color dialog. You will be able to change the color for the legend text.")); + TQWhatsThis::add(legendTextColor, i18n("Click here to display the KDE Select Color dialog. You will be able to change the color for the legend text.")); grid3->addWidget( legendTextColor, 3, 0 ); - lab = new QLabel( i18n("Legend frame color:"), gb ); + lab = new TQLabel( i18n("Legend frame color:"), gb ); grid3->addWidget( lab, 4, 0 ); legendFrameColor = new KColorButton( gb ); - QWhatsThis::add(legendFrameColor, i18n("Click here to display the KDE Select Color dialog. You will be able to change the color for the legend frame.")); + TQWhatsThis::add(legendFrameColor, i18n("Click here to display the KDE Select Color dialog. You will be able to change the color for the legend frame.")); grid3->addWidget( legendFrameColor, 5, 0 ); //it's not good but I don't know how //to reduce space - layout->addColSpacing( 1, 300 ); + tqlayout->addColSpacing( 1, 300 ); } void KChartLegendConfigPage::init() @@ -246,7 +246,7 @@ void KChartLegendConfigPage::init() legendTextColor->setColor(_params->legendTextColor()); - QColor frameColor(Qt::black); + TQColor frameColor(TQt::black); bool bFound; const KDChartParams::KDChartFrameSettings * legendFrame = _params->frameSettings( KDChartEnums::AreaLegend, bFound ); @@ -266,32 +266,32 @@ void KChartLegendConfigPage::init() titleLegend = _params->legendTitleFont(); titleLegendIsRelative = _params->legendTitleFontUseRelSize() - ? QButton::On - : QButton::Off; - if( QButton::On == titleLegendIsRelative ) + ? TQButton::On + : TQButton::Off; + if( TQButton::On == titleLegendIsRelative ) titleLegend.setPointSize( _params->legendTitleFontRelSize() ); textLegend=_params->legendFont(); textLegendIsRelative = _params->legendFontUseRelSize() - ? QButton::On - : QButton::Off; - if( QButton::On == textLegendIsRelative ) + ? TQButton::On + : TQButton::Off; + if( TQButton::On == textLegendIsRelative ) textLegend.setPointSize(_params->legendFontRelSize()); } void KChartLegendConfigPage::changeTitleLegendFont() { - QButton::ToggleState state = titleLegendIsRelative; - if ( KFontDialog::getFont( titleLegend,false,this, true,&state ) != QDialog::Rejected - && QButton::NoChange != state ) + TQButton::ToggleState state = titleLegendIsRelative; + if ( KFontDialog::getFont( titleLegend,false,this, true,&state ) != TQDialog::Rejected + && TQButton::NoChange != state ) titleLegendIsRelative = state; } void KChartLegendConfigPage::changeTextLegendFont() { - QButton::ToggleState state = textLegendIsRelative; - if ( KFontDialog::getFont( textLegend,false,this, true,&state ) != QDialog::Rejected - && QButton::NoChange != state ) + TQButton::ToggleState state = textLegendIsRelative; + if ( KFontDialog::getFont( textLegend,false,this, true,&state ) != TQDialog::Rejected + && TQButton::NoChange != state ) textLegendIsRelative = state; } @@ -343,8 +343,8 @@ void KChartLegendConfigPage::apply() _params->setLegendTitleTextColor(legendTitleColor->color()); _params->setLegendTextColor(legendTextColor->color()); - const QColor frameColor(legendFrameColor->color()); - if( frameColor == Qt::black ) + const TQColor frameColor(legendFrameColor->color()); + if( frameColor == TQt::black ) _params->removeFrame( KDChartEnums::AreaLegend ); else _params->setSimpleFrame( KDChartEnums::AreaLegend, @@ -356,29 +356,29 @@ void KChartLegendConfigPage::apply() 0, frameColor ); - _params->setLegendTitleFont(titleLegend, QButton::Off == titleLegendIsRelative); - if( QButton::On == titleLegendIsRelative ) + _params->setLegendTitleFont(titleLegend, TQButton::Off == titleLegendIsRelative); + if( TQButton::On == titleLegendIsRelative ) _params->setLegendTitleFontRelSize(titleLegend.pointSize()); - _params->setLegendFont(textLegend, QButton::Off == textLegendIsRelative); - if( QButton::On == textLegendIsRelative ) + _params->setLegendFont(textLegend, TQButton::Off == textLegendIsRelative); + if( TQButton::On == textLegendIsRelative ) _params->setLegendFontRelSize(textLegend.pointSize()); } -QPushButton* KChartLegendConfigPage::addButton( QGridLayout* layout, - QButtonGroup* gb, - const QString &toolTipText, - const QString &icon, +TQPushButton* KChartLegendConfigPage::addButton( TQGridLayout* tqlayout, + TQButtonGroup* gb, + const TQString &toolTipText, + const TQString &icon, int posY, int posX ) { - QPushButton* button = new QPushButton( gb ); + TQPushButton* button = new TQPushButton( gb ); button->setToggleButton( true ); button->setPixmap( BarIcon( icon, KIcon::SizeMedium, KIcon::DefaultState, KChartFactory::global() ) ); - QToolTip::add( button, toolTipText ); - layout->addWidget( button, posY, posX ); + TQToolTip::add( button, toolTipText ); + tqlayout->addWidget( button, posY, posX ); return button; } |