summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-05-15 13:28:21 -0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-05-15 22:40:05 +0000
commitee1868df2b6b60d59dff1a14fa2c16a9e759ef19 (patch)
tree09939b2c96895adf4e63e0c7d8f9c0f63ac549da /src/plugins/styles
parentcdc5f7ab5cdadff42e7736f66c823debbc0d85fc (diff)
QMacStyle: Remove a couple void *, dead code
Change-Id: If05fbdf8cc5ced81adfd75232313969223bf1453 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm22
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac_p_p.h11
2 files changed, 13 insertions, 20 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index d4eb7141bd..43806381cc 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -1777,10 +1777,9 @@ void QMacStylePrivate::setAutoDefaultButton(QObject *button) const
}
QMacStylePrivate::QMacStylePrivate()
- : mouseDown(false), backingStoreNSView(nil)
+ : backingStoreNSView(nil)
{
defaultButtonStart = CFAbsoluteTimeGetCurrent();
- memset(&buttonState, 0, sizeof(ButtonState));
}
QMacStylePrivate::~QMacStylePrivate()
@@ -2144,12 +2143,10 @@ QMacStyle::QMacStyle()
QMacAutoReleasePool pool;
d->receiver = [[NotificationReceiver alloc] initWithPrivate:d];
- NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
-
- [[NSNotificationCenter defaultCenter] addObserver:receiver
- selector:@selector(scrollBarStyleDidChange:)
- name:NSPreferredScrollerStyleDidChangeNotification
- object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:d->receiver
+ selector:@selector(scrollBarStyleDidChange:)
+ name:NSPreferredScrollerStyleDidChangeNotification
+ object:nil];
d->indicatorBranchButtonCell = nil;
}
@@ -2159,9 +2156,8 @@ QMacStyle::~QMacStyle()
Q_D(QMacStyle);
QMacAutoReleasePool pool;
- NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
- [[NSNotificationCenter defaultCenter] removeObserver:receiver];
- [receiver release];
+ [[NSNotificationCenter defaultCenter] removeObserver:d->receiver];
+ [d->receiver release];
delete qt_mac_backgroundPattern;
qt_mac_backgroundPattern = 0;
@@ -3399,8 +3395,8 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
if (!(opt->state & State_Children))
break;
if (!d->indicatorBranchButtonCell)
- const_cast<QMacStylePrivate *>(d)->indicatorBranchButtonCell = (void *)[[NSButtonCell alloc] init];
- NSButtonCell *triangleCell = (NSButtonCell *)d->indicatorBranchButtonCell;
+ const_cast<QMacStylePrivate *>(d)->indicatorBranchButtonCell = [[NSButtonCell alloc] init];
+ NSButtonCell *triangleCell = d->indicatorBranchButtonCell;
[triangleCell setButtonType:NSOnOffButton];
[triangleCell setState:(opt->state & State_Open) ? NSOnState : NSOffState];
[triangleCell setBezelStyle:NSDisclosureBezelStyle];
diff --git a/src/plugins/styles/mac/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
index 68d77deb06..f312adac52 100644
--- a/src/plugins/styles/mac/qmacstyle_mac_p_p.h
+++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
@@ -118,6 +118,8 @@
Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(CGContext);
Q_FORWARD_DECLARE_OBJC_CLASS(NSView);
+Q_FORWARD_DECLARE_OBJC_CLASS(NSButtonCell);
+Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(NotificationReceiver));
QT_BEGIN_NAMESPACE
@@ -244,15 +246,10 @@ public:
mutable QPointer<QObject> autoDefaultButton;
static QVector<QPointer<QObject> > scrollBars;
- struct ButtonState {
- int frame;
- enum { ButtonDark, ButtonLight } dir;
- } buttonState;
mutable QPointer<QFocusFrame> focusWidget;
CFAbsoluteTime defaultButtonStart;
- bool mouseDown;
- void* receiver;
- void *indicatorBranchButtonCell;
+ QT_MANGLE_NAMESPACE(NotificationReceiver) *receiver;
+ NSButtonCell *indicatorBranchButtonCell;
NSView *backingStoreNSView;
QHash<QCocoaWidget, NSView *> cocoaControls;
};