Qt 4.8
Public Functions | Properties | List of all members
QCocoaEventLoopIntegration Class Reference

#include <qcocoaeventloopintegration.h>

Inheritance diagram for QCocoaEventLoopIntegration:
QPlatformEventLoopIntegration

Public Functions

 QCocoaEventLoopIntegration ()
 
void qtNeedsToProcessEvents ()
 
void quitEventLoop ()
 
void startEventLoop ()
 
- Public Functions inherited from QPlatformEventLoopIntegration
qint64 nextTimerEvent () const
 
 QPlatformEventLoopIntegration ()
 
void setNextTimerEvent (qint64 nextTimerEvent)
 
virtual ~QPlatformEventLoopIntegration ()
 

Properties

CFRunLoopSourceRef m_source
 
CFRunLoopSourceContext m_sourceContext
 
CFRunLoopTimerContext m_timerContext
 

Additional Inherited Members

- Static Public Functions inherited from QPlatformEventLoopIntegration
static void processEvents ()
 
- Protected Variables inherited from QPlatformEventLoopIntegration
QScopedPointer< QPlatformEventLoopIntegrationPrivated_ptr
 

Detailed Description

Definition at line 50 of file qcocoaeventloopintegration.h.

Constructors and Destructors

◆ QCocoaEventLoopIntegration()

QCocoaEventLoopIntegration::QCocoaEventLoopIntegration ( )

Definition at line 68 of file qcocoaeventloopintegration.mm.

68  :
70 {
71  [NSApplication sharedApplication];
72  m_sourceContext.version = 0;
73  m_sourceContext.info = this;
74  m_sourceContext.retain = 0;
75  m_sourceContext.release = 0;
76  m_sourceContext.copyDescription = 0;
77  m_sourceContext.equal = 0;
78  m_sourceContext.hash = 0;
79  m_sourceContext.schedule = 0;
80  m_sourceContext.cancel = 0;
82 
83  m_source = CFRunLoopSourceCreate(0,0,&m_sourceContext);
84  CFRunLoopAddSource(CFRunLoopGetMain(),m_source,kCFRunLoopCommonModes);
85 
86  m_timerContext.version = 0;
87  m_timerContext.info = this;
88  m_timerContext.retain = 0;
89  m_timerContext.release = 0;
90  m_timerContext.copyDescription = 0;
91  CFAbsoluteTime fireDate = CFAbsoluteTimeGetCurrent ();
92  CFTimeInterval interval = 30;
93 
94  CFRunLoopTimerRef m_timerSource = CFRunLoopTimerCreate(0,fireDate,interval,0,0,timerCallback,&m_timerContext);
95  CFRunLoopAddTimer(CFRunLoopGetMain(),m_timerSource,kCFRunLoopCommonModes);
96 }
CFRunLoopSourceContext m_sourceContext
void wakeupCallback(void *)
void timerCallback(CFRunLoopTimerRef timer, void *info)

Functions

◆ qtNeedsToProcessEvents()

void QCocoaEventLoopIntegration::qtNeedsToProcessEvents ( )
virtual

Implements QPlatformEventLoopIntegration.

Definition at line 108 of file qcocoaeventloopintegration.mm.

109 {
110  CFRunLoopSourceSignal(m_source);
111 }

◆ quitEventLoop()

void QCocoaEventLoopIntegration::quitEventLoop ( )
virtual

Implements QPlatformEventLoopIntegration.

Definition at line 103 of file qcocoaeventloopintegration.mm.

104 {
105  [[NSApplication sharedApplication] terminate:nil];
106 }

◆ startEventLoop()

void QCocoaEventLoopIntegration::startEventLoop ( )
virtual

Implements QPlatformEventLoopIntegration.

Definition at line 98 of file qcocoaeventloopintegration.mm.

99 {
100  [[NSApplication sharedApplication] run];
101 }
QFuture< T > run(Function function,...)

Properties

◆ m_source

CFRunLoopSourceRef QCocoaEventLoopIntegration::m_source
private

◆ m_sourceContext

CFRunLoopSourceContext QCocoaEventLoopIntegration::m_sourceContext
private

Definition at line 59 of file qcocoaeventloopintegration.h.

Referenced by QCocoaEventLoopIntegration().

◆ m_timerContext

CFRunLoopTimerContext QCocoaEventLoopIntegration::m_timerContext
private

Definition at line 60 of file qcocoaeventloopintegration.h.

Referenced by QCocoaEventLoopIntegration().


The documentation for this class was generated from the following files: