diff options
Diffstat (limited to 'kplato/kptcalendarpanel.cc')
-rw-r--r-- | kplato/kptcalendarpanel.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/kplato/kptcalendarpanel.cc b/kplato/kptcalendarpanel.cc index e6322944..59ab2f01 100644 --- a/kplato/kptcalendarpanel.cc +++ b/kplato/kptcalendarpanel.cc @@ -65,7 +65,7 @@ CalendarPanel::CalendarPanel(TQWidget *parent, TQDate dt, const char *name, WFla CalendarPanel::CalendarPanel( TQWidget *parent, const char *name ) : TQFrame(parent,name) { - init( TQDate::tqcurrentDate() ); + init( TQDate::currentDate() ); } void CalendarPanel::init( const TQDate &dt ) @@ -96,10 +96,10 @@ void CalendarPanel::init( const TQDate &dt ) setFontSize(10); line->setValidator(val); line->installEventFilter( this ); - yearForward->setPixmap(BarIcon(TQString::tqfromLatin1("2rightarrow"))); - yearBackward->setPixmap(BarIcon(TQString::tqfromLatin1("2leftarrow"))); - monthForward->setPixmap(BarIcon(TQString::tqfromLatin1("1rightarrow"))); - monthBackward->setPixmap(BarIcon(TQString::tqfromLatin1("1leftarrow"))); + yearForward->setPixmap(BarIcon(TQString::fromLatin1("2rightarrow"))); + yearBackward->setPixmap(BarIcon(TQString::fromLatin1("2leftarrow"))); + monthForward->setPixmap(BarIcon(TQString::fromLatin1("1rightarrow"))); + monthBackward->setPixmap(BarIcon(TQString::fromLatin1("1leftarrow"))); setDate(dt); // set button texts connect(table, TQT_SIGNAL(dateChanged(TQDate)), TQT_SLOT(dateChangedSlot(TQDate))); connect(table, TQT_SIGNAL(tableClicked()), TQT_SLOT(tableClickedSlot())); @@ -164,7 +164,7 @@ CalendarPanel::resizeEvent(TQResizeEvent*) // ----- calculate button row height: for(count=0; count<NoOfButtons; ++count) { if ( buttons[count] ) { // closeButton may be 0L - sizes[count]=buttons[count]->tqsizeHint(); + sizes[count]=buttons[count]->sizeHint(); buttonHeight=TQMAX(buttonHeight, sizes[count].height()); } else @@ -175,7 +175,7 @@ CalendarPanel::resizeEvent(TQResizeEvent*) for(count=0; count<NoOfButtons; ++count) { if(buttons[count]==selectMonth) { TQSize metricBound = tqstyle().tqsizeFromContents(TQStyle::CT_ToolButton, selectMonth, maxMonthRect); - sizes[count].setWidth(TQMAX(metricBound.width(), maxMonthRect.width()+2*TQApplication::tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin))); + sizes[count].setWidth(TQMAX(metricBound.width(), maxMonthRect.width()+2*TQApplication::tqstyle().pixelMetric(TQStyle::PM_ButtonMargin))); } } // ----- center buttons @@ -195,7 +195,7 @@ CalendarPanel::resizeEvent(TQResizeEvent*) x+=w; } // ----- place the line edit for direct input: - sizes[0]=line->tqsizeHint(); + sizes[0]=line->sizeHint(); int week_width=d->selectWeek->fontMetrics().width(i18n("Week XX"))+((d->closeButton != 0L) ? 50 : 20); line->setGeometry(0, height()-sizes[0].height(), width()-week_width, sizes[0].height()); d->selectWeek->setGeometry(width()-week_width, height()-sizes[0].height(), week_width, sizes[0].height()); @@ -209,7 +209,7 @@ CalendarPanel::dateChangedSlot(TQDate date) { //kdDebug() << "CalendarPanel::dateChangedSlot: date changed (" << date.year() << "/" << date.month() << "/" << date.day() << ")." << endl; line->setText(KGlobal::locale()->formatDate(date, true)); - d->selectWeek->setText(i18n("Week %1").tqarg(weekOfYear(date))); + d->selectWeek->setText(i18n("Week %1").arg(weekOfYear(date))); selectMonth->setText(KGlobal::locale()->calendar()->monthName(date.month(), false)); selectYear->setText(date.toString("yyyy")); emit(dateChanged(date)); @@ -242,7 +242,7 @@ CalendarPanel::setDate(const TQDate& date) TQString temp; // ----- table->setDate(date); - d->selectWeek->setText(i18n("Week %1").tqarg(weekOfYear(date))); + d->selectWeek->setText(i18n("Week %1").arg(weekOfYear(date))); selectMonth->setText(KGlobal::locale()->calendar()->monthName(date.month(), false)); temp.setNum(date.year()); selectYear->setText(temp); @@ -285,7 +285,7 @@ CalendarPanel::selectWeekClicked() PopupFrame* popup = new PopupFrame(this); DateInternalWeekSelector* picker = new DateInternalWeekSelector(fontsize, popup); // ----- - picker->resize(picker->tqsizeHint()); + picker->resize(picker->sizeHint()); popup->setMainWidget(picker); connect(picker, TQT_SIGNAL(closeMe(int)), popup, TQT_SLOT(close(int))); picker->setFocus(); @@ -322,7 +322,7 @@ CalendarPanel::selectMonthClicked() PopupFrame* popup = new PopupFrame(this); DateInternalMonthPicker* picker = new DateInternalMonthPicker(fontsize, popup); // ----- - picker->resize(picker->tqsizeHint()); + picker->resize(picker->sizeHint()); popup->setMainWidget(picker); picker->setFocus(); connect(picker, TQT_SIGNAL(closeMe(int)), popup, TQT_SLOT(close(int))); @@ -352,7 +352,7 @@ CalendarPanel::selectYearClicked() PopupFrame* popup = new PopupFrame(this); DateInternalYearSelector* picker = new DateInternalYearSelector(fontsize, popup); // ----- - picker->resize(picker->tqsizeHint()); + picker->resize(picker->sizeHint()); popup->setMainWidget(picker); connect(picker, TQT_SIGNAL(closeMe(int)), popup, TQT_SLOT(close(int))); picker->setFocus(); @@ -409,9 +409,9 @@ CalendarPanel::lineEnterPressed() } TQSize -CalendarPanel::tqsizeHint() const +CalendarPanel::sizeHint() const { - TQSize tableSize=table->tqsizeHint(); + TQSize tableSize=table->sizeHint(); TQWidget *buttons[]={ yearBackward, monthBackward, @@ -427,13 +427,13 @@ CalendarPanel::tqsizeHint() const // ----- store the size hints: for(count=0; count<NoOfButtons; ++count) { if ( buttons[count] ) - sizes[count]=buttons[count]->tqsizeHint(); + sizes[count]=buttons[count]->sizeHint(); else sizes[count] = TQSize(0,0); if(buttons[count]==selectMonth) { TQSize metricBound = tqstyle().tqsizeFromContents(TQStyle::CT_ToolButton, selectMonth, maxMonthRect); - cx+=TQMAX(metricBound.width(), maxMonthRect.width()+2*TQApplication::tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin)); + cx+=TQMAX(metricBound.width(), maxMonthRect.width()+2*TQApplication::tqstyle().pixelMetric(TQStyle::PM_ButtonMargin)); } else { cx+=sizes[count].width(); } @@ -442,7 +442,7 @@ CalendarPanel::tqsizeHint() const // ----- calculate width hint: cx=TQMAX(cx, tableSize.width()); // line edit ignored // ----- calculate height hint: - cy+=tableSize.height()+line->tqsizeHint().height(); + cy+=tableSize.height()+line->sizeHint().height(); return TQSize(cx, cy); } @@ -471,7 +471,7 @@ CalendarPanel::setFontSize(int s) } TQFontMetrics metrics(selectMonth->fontMetrics()); for(int i=1; i <= 12; ++i) - { // maxMonthRect is used by tqsizeHint() + { // maxMonthRect is used by sizeHint() r=metrics.boundingRect(KGlobal::locale()->calendar()->monthName(i, false)); maxMonthRect.setWidth(TQMAX(r.width(), maxMonthRect.width())); maxMonthRect.setHeight(TQMAX(r.height(), maxMonthRect.height())); @@ -490,7 +490,7 @@ CalendarPanel::setCloseButton( bool enable ) TQToolTip::add(d->closeButton, i18n("Close")); d->closeButton->setPixmap( SmallIcon("remove") ); connect( d->closeButton, TQT_SIGNAL( clicked() ), - tqtopLevelWidget(), TQT_SLOT( close() ) ); + topLevelWidget(), TQT_SLOT( close() ) ); } else { delete d->closeButton; |