summaryrefslogtreecommitdiffstats
path: root/korganizer/multiagendaview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /korganizer/multiagendaview.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korganizer/multiagendaview.cpp')
-rw-r--r--korganizer/multiagendaview.cpp218
1 files changed, 109 insertions, 109 deletions
diff --git a/korganizer/multiagendaview.cpp b/korganizer/multiagendaview.cpp
index e2a7281e8..fb5cd6255 100644
--- a/korganizer/multiagendaview.cpp
+++ b/korganizer/multiagendaview.cpp
@@ -27,68 +27,68 @@
#include <kglobalsettings.h>
-#include <qlayout.h>
-#include <qvbox.h>
-#include <qobjectlist.h>
+#include <tqlayout.h>
+#include <tqvbox.h>
+#include <tqobjectlist.h>
#define FOREACH_VIEW(av) \
-for(QValueList<KOAgendaView*>::ConstIterator it = mAgendaViews.constBegin(); \
+for(TQValueList<KOAgendaView*>::ConstIterator it = mAgendaViews.constBegin(); \
it != mAgendaViews.constEnd();) \
for(KOAgendaView* av = (it != mAgendaViews.constEnd() ? (*it) : 0); \
it != mAgendaViews.constEnd(); ++it, av = (*it) )
using namespace KOrg;
-MultiAgendaView::MultiAgendaView(Calendar * cal, QWidget * parent, const char *name ) :
+MultiAgendaView::MultiAgendaView(Calendar * cal, TQWidget * parent, const char *name ) :
AgendaView( cal, parent, name ),
mLastMovedSplitter( 0 ),
mUpdateOnShow( false ),
mPendingChanges( true )
{
- QBoxLayout *topLevelLayout = new QHBoxLayout( this );
+ TQBoxLayout *topLevelLayout = new TQHBoxLayout( this );
- QFontMetrics fm( font() );
+ TQFontMetrics fm( font() );
int topLabelHeight = 2 * fm.height();
- QVBox *topSideBox = new QVBox( this );
- QWidget *topSideSpacer = new QWidget( topSideBox );
+ TQVBox *topSideBox = new TQVBox( this );
+ TQWidget *topSideSpacer = new TQWidget( topSideBox );
topSideSpacer->setFixedHeight( topLabelHeight );
- mLeftSplitter = new QSplitter( Qt::Vertical, topSideBox );
+ mLeftSplitter = new TQSplitter( Qt::Vertical, topSideBox );
mLeftSplitter->setOpaqueResize( KGlobalSettings::opaqueResize() );
- QLabel *label = new QLabel( i18n("All Day"), mLeftSplitter );
+ TQLabel *label = new TQLabel( i18n("All Day"), mLeftSplitter );
label->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::WordBreak );
- QVBox *sideBox = new QVBox( mLeftSplitter );
+ TQVBox *sideBox = new TQVBox( mLeftSplitter );
EventIndicator *eiSpacer = new EventIndicator( EventIndicator::Top, sideBox );
eiSpacer->changeColumns( 0 );
mTimeLabels = new TimeLabels( 24, sideBox );
eiSpacer = new EventIndicator( EventIndicator::Bottom, sideBox );
eiSpacer->changeColumns( 0 );
- mLeftBottomSpacer = new QWidget( topSideBox );
+ mLeftBottomSpacer = new TQWidget( topSideBox );
topLevelLayout->addWidget( topSideBox );
- mScrollView = new QScrollView( this );
- mScrollView->setResizePolicy( QScrollView::Manual );
- mScrollView->setVScrollBarMode( QScrollView::AlwaysOff );
- mScrollView->setFrameShape( QFrame::NoFrame );
+ mScrollView = new TQScrollView( this );
+ mScrollView->setResizePolicy( TQScrollView::Manual );
+ mScrollView->setVScrollBarMode( TQScrollView::AlwaysOff );
+ mScrollView->setFrameShape( TQFrame::NoFrame );
topLevelLayout->addWidget( mScrollView, 100 );
- mTopBox = new QHBox( mScrollView->viewport() );
+ mTopBox = new TQHBox( mScrollView->viewport() );
mScrollView->addChild( mTopBox );
- topSideBox = new QVBox( this );
- topSideSpacer = new QWidget( topSideBox );
+ topSideBox = new TQVBox( this );
+ topSideSpacer = new TQWidget( topSideBox );
topSideSpacer->setFixedHeight( topLabelHeight );
- mRightSplitter = new QSplitter( Qt::Vertical, topSideBox );
+ mRightSplitter = new TQSplitter( Qt::Vertical, topSideBox );
mRightSplitter->setOpaqueResize( KGlobalSettings::opaqueResize() );
- new QWidget( mRightSplitter );
- sideBox = new QVBox( mRightSplitter );
+ new TQWidget( mRightSplitter );
+ sideBox = new TQVBox( mRightSplitter );
eiSpacer = new EventIndicator( EventIndicator::Top, sideBox );
eiSpacer->setFixedHeight( eiSpacer->minimumHeight() );
eiSpacer->changeColumns( 0 );
- mScrollBar = new QScrollBar( Qt::Vertical, sideBox );
+ mScrollBar = new TQScrollBar( Qt::Vertical, sideBox );
eiSpacer = new EventIndicator( EventIndicator::Bottom, sideBox );
eiSpacer->setFixedHeight( eiSpacer->minimumHeight() );
eiSpacer->changeColumns( 0 );
- mRightBottomSpacer = new QWidget( topSideBox );
+ mRightBottomSpacer = new TQWidget( topSideBox );
topLevelLayout->addWidget( topSideBox );
recreateViews();
@@ -113,9 +113,9 @@ void MultiAgendaView::recreateViews()
CalendarResourceManager *manager = calres->resourceManager();
for ( CalendarResourceManager::ActiveIterator it = manager->activeBegin(); it != manager->activeEnd(); ++it ) {
if ( (*it)->canHaveSubresources() ) {
- QStringList subResources = (*it)->subresources();
- for ( QStringList::ConstIterator subit = subResources.constBegin(); subit != subResources.constEnd(); ++subit ) {
- QString type = (*it)->subresourceType( *subit );
+ TQStringList subResources = (*it)->subresources();
+ for ( TQStringList::ConstIterator subit = subResources.constBegin(); subit != subResources.constEnd(); ++subit ) {
+ TQString type = (*it)->subresourceType( *subit );
if ( !(*it)->subresourceActive( *subit ) || (!type.isEmpty() && type != "event") )
continue;
addView( (*it)->labelForSubresource( *subit ), *it, *subit );
@@ -131,19 +131,19 @@ void MultiAgendaView::recreateViews()
return;
setupViews();
- QTimer::singleShot( 0, this, SLOT(slotResizeScrollView()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(slotResizeScrollView()) );
mTimeLabels->updateConfig();
- QScrollBar *scrollBar = mAgendaViews.first()->agenda()->verticalScrollBar();
+ TQScrollBar *scrollBar = mAgendaViews.first()->agenda()->verticalScrollBar();
mScrollBar->setMinValue( scrollBar->minValue() );
mScrollBar->setMaxValue( scrollBar->maxValue() );
mScrollBar->setLineStep( scrollBar->lineStep() );
mScrollBar->setPageStep( scrollBar->pageStep() );
mScrollBar->setValue( scrollBar->value() );
- connect( mTimeLabels->verticalScrollBar(), SIGNAL(valueChanged(int)),
- mScrollBar, SLOT(setValue(int)) );
- connect( mScrollBar, SIGNAL(valueChanged(int)),
- mTimeLabels, SLOT(positionChanged(int)) );
+ connect( mTimeLabels->verticalScrollBar(), TQT_SIGNAL(valueChanged(int)),
+ mScrollBar, TQT_SLOT(setValue(int)) );
+ connect( mScrollBar, TQT_SIGNAL(valueChanged(int)),
+ mTimeLabels, TQT_SLOT(positionChanged(int)) );
installSplitterEventFilter( mLeftSplitter );
installSplitterEventFilter( mRightSplitter );
@@ -152,7 +152,7 @@ void MultiAgendaView::recreateViews()
void MultiAgendaView::deleteViews()
{
- for ( QValueList<QWidget*>::ConstIterator it = mAgendaWidgets.constBegin();
+ for ( TQValueList<TQWidget*>::ConstIterator it = mAgendaWidgets.constBegin();
it != mAgendaWidgets.constEnd(); ++it ) {
delete *it;
}
@@ -164,53 +164,53 @@ void MultiAgendaView::deleteViews()
void MultiAgendaView::setupViews()
{
FOREACH_VIEW( agenda ) {
- connect( agenda, SIGNAL( newEventSignal() ),
- SIGNAL( newEventSignal() ) );
- connect( agenda, SIGNAL( editIncidenceSignal( Incidence * ) ),
- SIGNAL( editIncidenceSignal( Incidence * ) ) );
- connect( agenda, SIGNAL( showIncidenceSignal( Incidence * ) ),
- SIGNAL( showIncidenceSignal( Incidence * ) ) );
- connect( agenda, SIGNAL( deleteIncidenceSignal( Incidence * ) ),
- SIGNAL( deleteIncidenceSignal( Incidence * ) ) );
- connect( agenda, SIGNAL( startMultiModify( const QString & ) ),
- SIGNAL( startMultiModify( const QString & ) ) );
- connect( agenda, SIGNAL( endMultiModify() ),
- SIGNAL( endMultiModify() ) );
-
- connect( agenda, SIGNAL( incidenceSelected( Incidence * ) ),
- SIGNAL( incidenceSelected( Incidence * ) ) );
-
- connect( agenda, SIGNAL(cutIncidenceSignal(Incidence*)),
- SIGNAL(cutIncidenceSignal(Incidence*)) );
- connect( agenda, SIGNAL(copyIncidenceSignal(Incidence*)),
- SIGNAL(copyIncidenceSignal(Incidence*)) );
- connect( agenda, SIGNAL(pasteIncidenceSignal()),
- SIGNAL(pasteIncidenceSignal()) );
- connect( agenda, SIGNAL(toggleAlarmSignal(Incidence*)),
- SIGNAL(toggleAlarmSignal(Incidence*)) );
- connect( agenda, SIGNAL(dissociateOccurrenceSignal(Incidence*, const QDate&)),
- SIGNAL(dissociateOccurrenceSignal(Incidence*, const QDate&)) );
- connect( agenda, SIGNAL(dissociateFutureOccurrenceSignal(Incidence*, const QDate&)),
- SIGNAL(dissociateFutureOccurrenceSignal(Incidence*, const QDate&)) );
-
- connect( agenda, SIGNAL(newEventSignal(const QDate&)),
- SIGNAL(newEventSignal(const QDate&)) );
- connect( agenda, SIGNAL(newEventSignal(const QDateTime&)),
- SIGNAL(newEventSignal(const QDateTime&)) );
- connect( agenda, SIGNAL(newEventSignal(const QDateTime&, const QDateTime&)),
- SIGNAL(newEventSignal(const QDateTime&, const QDateTime&)) );
- connect( agenda, SIGNAL(newTodoSignal(const QDate&)),
- SIGNAL(newTodoSignal(const QDate&)) );
-
- connect( agenda, SIGNAL(incidenceSelected(Incidence*)),
- SLOT(slotSelectionChanged()) );
-
- connect( agenda, SIGNAL(timeSpanSelectionChanged()),
- SLOT(slotClearTimeSpanSelection()) );
-
- disconnect( agenda->agenda(), SIGNAL(zoomView(const int,const QPoint&,const Qt::Orientation)), agenda, 0 );
- connect( agenda->agenda(), SIGNAL(zoomView(const int,const QPoint&,const Qt::Orientation)),
- SLOT(zoomView(const int,const QPoint&,const Qt::Orientation)) );
+ connect( agenda, TQT_SIGNAL( newEventSignal() ),
+ TQT_SIGNAL( newEventSignal() ) );
+ connect( agenda, TQT_SIGNAL( editIncidenceSignal( Incidence * ) ),
+ TQT_SIGNAL( editIncidenceSignal( Incidence * ) ) );
+ connect( agenda, TQT_SIGNAL( showIncidenceSignal( Incidence * ) ),
+ TQT_SIGNAL( showIncidenceSignal( Incidence * ) ) );
+ connect( agenda, TQT_SIGNAL( deleteIncidenceSignal( Incidence * ) ),
+ TQT_SIGNAL( deleteIncidenceSignal( Incidence * ) ) );
+ connect( agenda, TQT_SIGNAL( startMultiModify( const TQString & ) ),
+ TQT_SIGNAL( startMultiModify( const TQString & ) ) );
+ connect( agenda, TQT_SIGNAL( endMultiModify() ),
+ TQT_SIGNAL( endMultiModify() ) );
+
+ connect( agenda, TQT_SIGNAL( incidenceSelected( Incidence * ) ),
+ TQT_SIGNAL( incidenceSelected( Incidence * ) ) );
+
+ connect( agenda, TQT_SIGNAL(cutIncidenceSignal(Incidence*)),
+ TQT_SIGNAL(cutIncidenceSignal(Incidence*)) );
+ connect( agenda, TQT_SIGNAL(copyIncidenceSignal(Incidence*)),
+ TQT_SIGNAL(copyIncidenceSignal(Incidence*)) );
+ connect( agenda, TQT_SIGNAL(pasteIncidenceSignal()),
+ TQT_SIGNAL(pasteIncidenceSignal()) );
+ connect( agenda, TQT_SIGNAL(toggleAlarmSignal(Incidence*)),
+ TQT_SIGNAL(toggleAlarmSignal(Incidence*)) );
+ connect( agenda, TQT_SIGNAL(dissociateOccurrenceSignal(Incidence*, const TQDate&)),
+ TQT_SIGNAL(dissociateOccurrenceSignal(Incidence*, const TQDate&)) );
+ connect( agenda, TQT_SIGNAL(dissociateFutureOccurrenceSignal(Incidence*, const TQDate&)),
+ TQT_SIGNAL(dissociateFutureOccurrenceSignal(Incidence*, const TQDate&)) );
+
+ connect( agenda, TQT_SIGNAL(newEventSignal(const TQDate&)),
+ TQT_SIGNAL(newEventSignal(const TQDate&)) );
+ connect( agenda, TQT_SIGNAL(newEventSignal(const TQDateTime&)),
+ TQT_SIGNAL(newEventSignal(const TQDateTime&)) );
+ connect( agenda, TQT_SIGNAL(newEventSignal(const TQDateTime&, const TQDateTime&)),
+ TQT_SIGNAL(newEventSignal(const TQDateTime&, const TQDateTime&)) );
+ connect( agenda, TQT_SIGNAL(newTodoSignal(const TQDate&)),
+ TQT_SIGNAL(newTodoSignal(const TQDate&)) );
+
+ connect( agenda, TQT_SIGNAL(incidenceSelected(Incidence*)),
+ TQT_SLOT(slotSelectionChanged()) );
+
+ connect( agenda, TQT_SIGNAL(timeSpanSelectionChanged()),
+ TQT_SLOT(slotClearTimeSpanSelection()) );
+
+ disconnect( agenda->agenda(), TQT_SIGNAL(zoomView(const int,const TQPoint&,const Qt::Orientation)), agenda, 0 );
+ connect( agenda->agenda(), TQT_SIGNAL(zoomView(const int,const TQPoint&,const Qt::Orientation)),
+ TQT_SLOT(zoomView(const int,const TQPoint&,const Qt::Orientation)) );
}
FOREACH_VIEW( agenda ) {
@@ -218,9 +218,9 @@ void MultiAgendaView::setupViews()
}
int minWidth = 0;
- for ( QValueList<QWidget*>::ConstIterator it = mAgendaWidgets.constBegin(); it != mAgendaWidgets.constEnd(); ++it )
+ for ( TQValueList<TQWidget*>::ConstIterator it = mAgendaWidgets.constBegin(); it != mAgendaWidgets.constEnd(); ++it )
minWidth = QMAX( minWidth, (*it)->minimumSizeHint().width() );
- for ( QValueList<QWidget*>::ConstIterator it = mAgendaWidgets.constBegin(); it != mAgendaWidgets.constEnd(); ++it )
+ for ( TQValueList<TQWidget*>::ConstIterator it = mAgendaWidgets.constBegin(); it != mAgendaWidgets.constEnd(); ++it )
(*it)->setMinimumWidth( minWidth );
}
@@ -253,7 +253,7 @@ int MultiAgendaView::currentDateCount()
return 0;
}
-void MultiAgendaView::showDates(const QDate & start, const QDate & end)
+void MultiAgendaView::showDates(const TQDate & start, const TQDate & end)
{
mStartDate = start;
mEndDate = end;
@@ -296,7 +296,7 @@ void MultiAgendaView::slotSelectionChanged()
}
}
-bool MultiAgendaView::eventDurationHint(QDateTime & startDt, QDateTime & endDt, bool & allDay)
+bool MultiAgendaView::eventDurationHint(TQDateTime & startDt, TQDateTime & endDt, bool & allDay)
{
FOREACH_VIEW( agenda ) {
bool valid = agenda->eventDurationHint( startDt, endDt, allDay );
@@ -314,7 +314,7 @@ void MultiAgendaView::slotClearTimeSpanSelection()
}
}
-void MultiAgendaView::setTypeAheadReceiver(QObject * o)
+void MultiAgendaView::setTypeAheadReceiver(TQObject * o)
{
FOREACH_VIEW( agenda )
agenda->setTypeAheadReceiver( o );
@@ -326,35 +326,35 @@ void MultiAgendaView::finishTypeAhead()
agenda->finishTypeAhead();
}
-void MultiAgendaView::addView( const QString &label, KCal::ResourceCalendar * res, const QString & subRes )
+void MultiAgendaView::addView( const TQString &label, KCal::ResourceCalendar * res, const TQString & subRes )
{
- QVBox *box = new QVBox( mTopBox );
- QLabel *l = new QLabel( label, box );
+ TQVBox *box = new TQVBox( mTopBox );
+ TQLabel *l = new TQLabel( label, box );
l->setAlignment( AlignVCenter | AlignHCenter );
KOAgendaView* av = new KOAgendaView( calendar(), box, 0, true );
av->setResource( res, subRes );
av->setIncidenceChanger( mChanger );
- av->agenda()->setVScrollBarMode( QScrollView::AlwaysOff );
+ av->agenda()->setVScrollBarMode( TQScrollView::AlwaysOff );
mAgendaViews.append( av );
mAgendaWidgets.append( box );
box->show();
mTimeLabels->setAgenda( av->agenda() );
- connect( av->agenda()->verticalScrollBar(), SIGNAL(valueChanged(int)),
- mTimeLabels, SLOT(positionChanged(int)) );
- connect( mTimeLabels->verticalScrollBar(), SIGNAL(valueChanged(int)),
- av, SLOT(setContentsPos(int)) );
+ connect( av->agenda()->verticalScrollBar(), TQT_SIGNAL(valueChanged(int)),
+ mTimeLabels, TQT_SLOT(positionChanged(int)) );
+ connect( mTimeLabels->verticalScrollBar(), TQT_SIGNAL(valueChanged(int)),
+ av, TQT_SLOT(setContentsPos(int)) );
installSplitterEventFilter( av->splitter() );
}
-void MultiAgendaView::resizeEvent(QResizeEvent * ev)
+void MultiAgendaView::resizeEvent(TQResizeEvent * ev)
{
resizeScrollView( ev->size() );
AgendaView::resizeEvent( ev );
}
-void MultiAgendaView::resizeScrollView(const QSize & size)
+void MultiAgendaView::resizeScrollView(const TQSize & size)
{
const int widgetWidth = size.width() - mTimeLabels->width() - mScrollBar->width();
int width = QMAX( mTopBox->sizeHint().width(), widgetWidth );
@@ -387,12 +387,12 @@ void MultiAgendaView::updateConfig()
agenda->updateConfig();
}
-// KDE4: not needed anymore, QSplitter has a moved signal there
-bool MultiAgendaView::eventFilter(QObject * obj, QEvent * event)
+// KDE4: not needed anymore, TQSplitter has a moved signal there
+bool MultiAgendaView::eventFilter(TQObject * obj, TQEvent * event)
{
- if ( obj->className() == QCString("QSplitterHandle") ) {
- if ( (event->type() == QEvent::MouseMove && KGlobalSettings::opaqueResize())
- || event->type() == QEvent::MouseButtonRelease ) {
+ if ( obj->className() == TQCString("QSplitterHandle") ) {
+ if ( (event->type() == TQEvent::MouseMove && KGlobalSettings::opaqueResize())
+ || event->type() == TQEvent::MouseButtonRelease ) {
FOREACH_VIEW( agenda ) {
if ( agenda->splitter() == obj->parent() )
mLastMovedSplitter = agenda->splitter();
@@ -401,7 +401,7 @@ bool MultiAgendaView::eventFilter(QObject * obj, QEvent * event)
mLastMovedSplitter = mLeftSplitter;
else if ( mRightSplitter == obj->parent() )
mLastMovedSplitter = mRightSplitter;
- QTimer::singleShot( 0, this, SLOT(resizeSplitters()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(resizeSplitters()) );
}
}
return AgendaView::eventFilter( obj, event );
@@ -422,7 +422,7 @@ void MultiAgendaView::resizeSplitters()
mRightSplitter->setSizes( mLastMovedSplitter->sizes() );
}
-void MultiAgendaView::zoomView( const int delta, const QPoint & pos, const Qt::Orientation ori )
+void MultiAgendaView::zoomView( const int delta, const TQPoint & pos, const Qt::Orientation ori )
{
if ( ori == Qt::Vertical ) {
if ( delta > 0 ) {
@@ -441,16 +441,16 @@ void MultiAgendaView::zoomView( const int delta, const QPoint & pos, const Qt::O
mTimeLabels->repaint();
}
-// KDE4: not needed, use existing QSplitter signals instead
-void MultiAgendaView::installSplitterEventFilter(QSplitter * splitter)
+// KDE4: not needed, use existing TQSplitter signals instead
+void MultiAgendaView::installSplitterEventFilter(TQSplitter * splitter)
{
- QObjectList *objlist = splitter->queryList( "QSplitterHandle" );
+ TQObjectList *objlist = splitter->queryList( "QSplitterHandle" );
// HACK: when not being visible, the splitter handle is sometimes not found
// for unknown reasons, so trigger an update when we are shown again
if ( objlist->count() == 0 && !isVisible() )
mUpdateOnShow = true;
- QObjectListIt it( *objlist );
- QObject *obj;
+ TQObjectListIt it( *objlist );
+ TQObject *obj;
while ( (obj = it.current()) != 0 ) {
obj->removeEventFilter( this );
obj->installEventFilter( this );