From fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 5 Jul 2011 06:00:29 +0000 Subject: TQt4 port kmymoney This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmymoney2/widgets/kmymoneywizard.cpp | 134 +++++++++++++++++------------------ 1 file changed, 67 insertions(+), 67 deletions(-) (limited to 'kmymoney2/widgets/kmymoneywizard.cpp') diff --git a/kmymoney2/widgets/kmymoneywizard.cpp b/kmymoney2/widgets/kmymoneywizard.cpp index d7fcfdb..68eaf02 100644 --- a/kmymoney2/widgets/kmymoneywizard.cpp +++ b/kmymoney2/widgets/kmymoneywizard.cpp @@ -17,12 +17,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -42,8 +42,8 @@ #include #include -KMyMoneyWizardPagePrivate::KMyMoneyWizardPagePrivate(QObject* parent, const char* name) : - QObject(parent, name) +KMyMoneyWizardPagePrivate::KMyMoneyWizardPagePrivate(TQObject* tqparent, const char* name) : + TQObject(tqparent, name) { } @@ -53,17 +53,17 @@ void KMyMoneyWizardPagePrivate::emitCompleteStateChanged(void) } -KMyMoneyWizardPage::KMyMoneyWizardPage(unsigned int step, QWidget* widget, const char* name) : +KMyMoneyWizardPage::KMyMoneyWizardPage(unsigned int step, TQWidget* widget, const char* name) : m_step(step), m_widget(widget), - d(new KMyMoneyWizardPagePrivate(widget, name)) + d(new KMyMoneyWizardPagePrivate(TQT_TQOBJECT(widget), name)) { - m_mandatoryGroup = new kMandatoryFieldGroup(widget); - QObject::connect(m_mandatoryGroup, SIGNAL(stateChanged()), object(), SIGNAL(completeStateChanged())); + m_mandatoryGroup = new kMandatoryFieldGroup(TQT_TQOBJECT(widget)); + TQObject::connect(m_mandatoryGroup, TQT_SIGNAL(stateChanged()), object(), TQT_SIGNAL(completeStateChanged())); widget->hide(); } -QObject* KMyMoneyWizardPage::object(void) const +TQObject* KMyMoneyWizardPage::object(void) const { return d; } @@ -98,19 +98,19 @@ bool KMyMoneyWizardPage::isLastPage(void) const bool KMyMoneyWizardPage::isComplete(void) const { if(!isLastPage()) - QToolTip::add(wizard()->m_nextButton, i18n("Continue with next page")); + TQToolTip::add(wizard()->m_nextButton, i18n("Continue with next page")); else - QToolTip::add(wizard()->m_finishButton, i18n("Finish wizard")); + TQToolTip::add(wizard()->m_finishButton, i18n("Finish wizard")); return m_mandatoryGroup->isEnabled(); } -const QString& KMyMoneyWizardPage::helpContext(void) const +const TQString& KMyMoneyWizardPage::helpContext(void) const { - return QString::null; + return TQString(); } -KMyMoneyWizard::KMyMoneyWizard(QWidget *parent, const char *name, bool modal, WFlags f) : - QDialog(parent, name, modal, f), +KMyMoneyWizard::KMyMoneyWizard(TQWidget *tqparent, const char *name, bool modal, WFlags f) : + TQDialog(tqparent, name, modal, f), m_step(0) { // enable the little grip in the right corner @@ -132,8 +132,8 @@ KMyMoneyWizard::KMyMoneyWizard(QWidget *parent, const char *name, bool modal, WF m_helpButton->setIconSet( SmallIconSet( "help" ) ); } - // create button layout - m_buttonLayout = new QHBoxLayout; + // create button tqlayout + m_buttonLayout = new TQHBoxLayout; m_buttonLayout->addWidget(m_helpButton); m_buttonLayout->addStretch(1); m_buttonLayout->addWidget(m_backButton); @@ -141,41 +141,41 @@ KMyMoneyWizard::KMyMoneyWizard(QWidget *parent, const char *name, bool modal, WF m_buttonLayout->addWidget(m_finishButton); m_buttonLayout->addWidget(m_cancelButton); - // create wizard layout - m_wizardLayout = new QVBoxLayout(this, 6, 0, "wizardLayout"); + // create wizard tqlayout + m_wizardLayout = new TQVBoxLayout(this, 6, 0, "wizardLayout"); m_titleLabel = new KMyMoneyTitleLabel(this, "titleLabel"); m_wizardLayout->addWidget(m_titleLabel); - QHBoxLayout* hboxLayout = new QHBoxLayout(0, 0, 6, "hboxLayout"); + TQHBoxLayout* hboxLayout = new TQHBoxLayout(0, 0, 6, "hboxLayout"); - // create stage layout and frame - m_stepFrame = new QFrame(this, "stepFrame"); + // create stage tqlayout and frame + m_stepFrame = new TQFrame(this, "stepFrame"); m_stepFrame->setPaletteBackgroundColor(KGlobalSettings::highlightColor()); - m_stepLayout = new QVBoxLayout(m_stepFrame, 11, 6, "stepLayout"); - m_stepLayout->addWidget(new QLabel("", m_stepFrame)); - m_stepLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding)); - m_stepLabel = new QLabel(m_stepFrame, "stepLabel"); - m_stepLabel->setAlignment(Qt::AlignHCenter); + m_stepLayout = new TQVBoxLayout(m_stepFrame, 11, 6, "stepLayout"); + m_stepLayout->addWidget(new TQLabel("", m_stepFrame)); + m_stepLayout->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding)); + m_stepLabel = new TQLabel(m_stepFrame, "stepLabel"); + m_stepLabel->tqsetAlignment(TQt::AlignHCenter); m_stepLayout->addWidget(m_stepLabel); hboxLayout->addWidget(m_stepFrame); - // FIXME use the protected virtual method QWidget::paletteChange() to update the palette + // FIXME use the protected virtual method TQWidget::paletteChange() to update the palette // information when the user selected a different color set using the KConfigCenter m_stepPalette = m_stepLabel->palette(); - QColorGroup::ColorRole role = QColorGroup::Foreground; - QColor color = KGlobalSettings::highlightedTextColor(); - m_stepPalette.setColor( QPalette::Active, role, color ); - m_stepPalette.setColor( QPalette::Inactive, role, color ); - m_stepPalette.setColor( QPalette::Disabled, role, color ); + TQColorGroup::ColorRole role = TQColorGroup::Foreground; + TQColor color = KGlobalSettings::highlightedTextColor(); + m_stepPalette.setColor( TQPalette::Active, role, color ); + m_stepPalette.setColor( TQPalette::Inactive, role, color ); + m_stepPalette.setColor( TQPalette::Disabled, role, color ); m_stepLabel->setPalette(m_stepPalette); - // create page layout - m_pageLayout = new QVBoxLayout(0, 0, 6, "pageLayout"); + // create page tqlayout + m_pageLayout = new TQVBoxLayout(0, 0, 6, "pageLayout"); // the page will be inserted later dynamically above this line - QFrame* line = new QFrame( this, "line" ); - line->setFrameShadow( QFrame::Sunken ); - line->setFrameShape( QFrame::HLine ); + TQFrame* line = new TQFrame( this, "line" ); + line->setFrameShadow( TQFrame::Sunken ); + line->setFrameShape( TQFrame::HLine ); m_pageLayout->addWidget( line ); m_pageLayout->addLayout(m_buttonLayout); @@ -183,7 +183,7 @@ KMyMoneyWizard::KMyMoneyWizard(QWidget *parent, const char *name, bool modal, WF hboxLayout->addLayout(m_pageLayout); m_wizardLayout->addLayout(hboxLayout); - resize(QSize(770, 520).expandedTo(minimumSizeHint())); + resize(TQSize(770, 520).expandedTo(tqminimumSizeHint())); clearWState(WState_Polished); m_titleLabel->setText("No Title specified"); @@ -191,33 +191,33 @@ KMyMoneyWizard::KMyMoneyWizard(QWidget *parent, const char *name, bool modal, WF m_finishButton->hide(); - connect(m_backButton, SIGNAL(clicked()), this, SLOT(backButtonClicked())); - connect(m_nextButton, SIGNAL(clicked()), this, SLOT(nextButtonClicked())); - connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_finishButton, SIGNAL(clicked()), this, SLOT(accept())); - connect(m_helpButton, SIGNAL(clicked()), this, SLOT(helpButtonClicked())); + connect(m_backButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(backButtonClicked())); + connect(m_nextButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(nextButtonClicked())); + connect(m_cancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(m_finishButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); + connect(m_helpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(helpButtonClicked())); } -void KMyMoneyWizard::setTitle(const QString& txt) +void KMyMoneyWizard::setTitle(const TQString& txt) { m_titleLabel->setText(txt); } -void KMyMoneyWizard::addStep(const QString& text) +void KMyMoneyWizard::addStep(const TQString& text) { - QLabel* step = new QLabel(text, m_stepFrame); - step->setFrameStyle(QFrame::Panel | QFrame::Raised); - step->setAlignment(Qt::AlignHCenter); - step->setFrameStyle(QFrame::Box | QFrame::Sunken); + TQLabel* step = new TQLabel(text, m_stepFrame); + step->setFrameStyle(TQFrame::Panel | TQFrame::Raised); + step->tqsetAlignment(TQt::AlignHCenter); + step->setFrameStyle(TQFrame::Box | TQFrame::Sunken); step->setMargin(2); step->setPalette( m_stepPalette ); m_steps.append(step); m_stepLayout->insertWidget(m_steps.count(), step); - QFont font(step->font()); + TQFont font(step->font()); font.setBold(true); - QFontMetrics fm(font); + TQFontMetrics fm(font); int w = fm.width(text)+30; if(m_stepFrame->minimumWidth() < w) { m_stepFrame->setMinimumWidth(w); @@ -239,14 +239,14 @@ void KMyMoneyWizard::selectStep(unsigned int step) return; m_step = step; - QValueList::iterator it_l; - QFont f = m_steps[0]->font(); + TQValueList::iterator it_l; + TQFont f = m_steps[0]->font(); for(it_l = m_steps.begin(); it_l != m_steps.end(); ++it_l) { f.setBold(false); - (*it_l)->setFrameStyle(QFrame::NoFrame); + (*it_l)->setFrameStyle(TQFrame::NoFrame); if(--step == 0) { f.setBold(true); - (*it_l)->setFrameStyle(QFrame::Box | QFrame::Sunken); + (*it_l)->setFrameStyle(TQFrame::Box | TQFrame::Sunken); } (*it_l)->setFont(f); } @@ -260,7 +260,7 @@ void KMyMoneyWizard::reselectStep(void) void KMyMoneyWizard::updateStepCount(void) { - QValueList::iterator it_l; + TQValueList::iterator it_l; int stepCount = 0; int hiddenAdjust = 0; int step = 0; @@ -271,7 +271,7 @@ void KMyMoneyWizard::updateStepCount(void) hiddenAdjust++; ++step; } - m_stepLabel->setText(i18n("Step %1 of %2").arg(m_step - hiddenAdjust).arg(stepCount)); + m_stepLabel->setText(i18n("Step %1 of %2").tqarg(m_step - hiddenAdjust).tqarg(stepCount)); } void KMyMoneyWizard::setFirstPage(KMyMoneyWizardPage* page) @@ -287,12 +287,12 @@ void KMyMoneyWizard::switchPage(KMyMoneyWizardPage* oldPage) if(oldPage) { oldPage->widget()->hide(); m_pageLayout->remove(oldPage->widget()); - disconnect(oldPage->object(), SIGNAL(completeStateChanged()), this, SLOT(completeStateChanged())); + disconnect(oldPage->object(), TQT_SIGNAL(completeStateChanged()), this, TQT_SLOT(completeStateChanged())); } KMyMoneyWizardPage* newPage = m_history.back(); if(newPage) { m_pageLayout->insertWidget(0, newPage->widget()); - connect(newPage->object(), SIGNAL(completeStateChanged()), this, SLOT(completeStateChanged())); + connect(newPage->object(), TQT_SIGNAL(completeStateChanged()), this, TQT_SLOT(completeStateChanged())); newPage->widget()->show(); selectStep(newPage->step()); if(newPage->isLastPage()) { @@ -302,7 +302,7 @@ void KMyMoneyWizard::switchPage(KMyMoneyWizardPage* oldPage) m_finishButton->setDefault(false); m_nextButton->setDefault(true); } - QWidget* w = newPage->initialFocusWidget(); + TQWidget* w = newPage->initialFocusWidget(); if(w) w->setFocus(); } @@ -337,7 +337,7 @@ void KMyMoneyWizard::nextButtonClicked(void) void KMyMoneyWizard::helpButtonClicked(void) { KMyMoneyWizardPage* currentPage = m_history.back(); - QString ctx = currentPage->helpContext(); + TQString ctx = currentPage->helpContext(); if(ctx.isEmpty()) ctx = m_helpContext; kapp->invokeHelp(ctx); @@ -369,7 +369,7 @@ void KMyMoneyWizard::accept(void) m_finishButton->setFocus(); KMyMoneyWizardPage* page = m_history.back(); if(page->isComplete()) - QDialog::accept(); + TQDialog::accept(); } #include "kmymoneywizard.moc" -- cgit v1.2.1