QMacStyle: Remove a couple void *, dead code
Change-Id: If05fbdf8cc5ced81adfd75232313969223bf1453 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
parent
cdc5f7ab5c
commit
ee1868df2b
@ -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];
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user