TimeTrackingView::TimeTrackingView( QToolBar* toolBar, QWidget* parent ) : QWidget( parent ) , m_taskSelector( new TimeTrackingTaskSelector( toolBar, this ) ) , m_dayOfWeek( 0 ) { setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); // plumbing m_paintAttributes.initialize( palette() ); for( int i = 0; i < 7; ++i ) { m_shortDayNames[i] = QDate::shortDayName( i + 1 ); } connect( m_taskSelector, SIGNAL( startEvent( TaskId ) ), SIGNAL( startEvent( TaskId ) ) ); connect( m_taskSelector, SIGNAL( stopEvents() ), SIGNAL( stopEvents() ) ); connect( m_taskSelector, SIGNAL( updateSummariesPlease() ), SLOT( slotUpdateSummaries() ) ); setFocusProxy( m_taskSelector ); setFocusPolicy( Qt::StrongFocus ); }
TimeTrackingView::TimeTrackingView( QToolBar* toolBar, QWidget* parent ) : QWidget( parent ) , m_taskSelector( new TimeTrackingTaskSelector( toolBar, this ) ) , m_dayOfWeek( 0 ) { #ifdef Q_WS_MAC m_fixedFont.setFamily( "Andale Mono" ); m_fixedFont.setPointSize( 11 ); m_narrowFont = font(); // stay with the desktop m_narrowFont.setPointSize( 11 ); #else m_fixedFont = font(); m_fixedFont.setPointSizeF( 0.9 * m_fixedFont.pointSizeF() ); m_narrowFont = m_fixedFont; #endif setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); // plumbing m_pulse.setLoopCount( 0 ); m_pulse.setDuration( 2000 ); m_paintAttributes.initialize( palette() ); m_pulse.setCurveShape( QTimeLine::SineCurve ); for( int i = 0; i < 7; ++i ) { m_shortDayNames[i] = QDate::shortDayName( i + 1 ); } connect( &m_pulse, SIGNAL( valueChanged( qreal ) ), SLOT( slotPulseValueChanged( qreal ) ) ); connect( m_taskSelector, SIGNAL( startEvent( TaskId ) ), SIGNAL( startEvent( TaskId ) ) ); connect( m_taskSelector, SIGNAL( stopEvents() ), SIGNAL( stopEvents() ) ); connect( m_taskSelector, SIGNAL( updateSummariesPlease() ), SLOT( slotUpdateSummaries() ) ); setFocusProxy( m_taskSelector ); setFocusPolicy( Qt::StrongFocus ); }