Remove some old QT_MAC_USE_COCOA cruft
Change-Id: Ib9cb57563274c722023084e94f2cd439088366a8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
parent
3a30a2fcb3
commit
33bdb93ae1
@ -69,11 +69,7 @@ namespace QTest
|
||||
QEvent::Type type;
|
||||
type = press ? QEvent::KeyPress : QEvent::KeyRelease;
|
||||
qt_handleKeyEvent(window, type, code, modifier, text, repeat, delay);
|
||||
#ifdef QT_MAC_USE_COCOA
|
||||
QTest::qWait(20);
|
||||
#else
|
||||
qApp->processEvents();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sendKeyEvent(KeyAction action, QWindow *window, Qt::Key code,
|
||||
|
@ -39,8 +39,6 @@
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#ifdef QT_MAC_USE_COCOA
|
||||
|
||||
//![0]
|
||||
SearchWidget::SearchWidget(QWidget *parent)
|
||||
: QMacCocoaViewContainer(0, parent)
|
||||
@ -76,57 +74,6 @@ QSize SearchWidget::sizeHint() const
|
||||
return QSize(150, 40);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// The SearchWidget class wraps a native HISearchField.
|
||||
SearchWidget::SearchWidget(QWidget *parent)
|
||||
:QWidget(parent)
|
||||
{
|
||||
|
||||
// Create a native search field and pass its window id to QWidget::create.
|
||||
searchFieldText = CFStringCreateWithCString(0, "search", 0);
|
||||
HISearchFieldCreate(NULL/*bounds*/, kHISearchFieldAttributesSearchIcon | kHISearchFieldAttributesCancel,
|
||||
NULL/*menu ref*/, searchFieldText, &searchField);
|
||||
create(reinterpret_cast<WId>(searchField));
|
||||
|
||||
// Use a Qt menu for the search field menu.
|
||||
QMenu *searchMenu = createMenu(this);
|
||||
MenuRef menuRef = searchMenu->macMenu(0);
|
||||
HISearchFieldSetSearchMenu(searchField, menuRef);
|
||||
setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||
}
|
||||
|
||||
SearchWidget::~SearchWidget()
|
||||
{
|
||||
CFRelease(searchField);
|
||||
CFRelease(searchFieldText);
|
||||
}
|
||||
|
||||
// Get the size hint from the search field.
|
||||
QSize SearchWidget::sizeHint() const
|
||||
{
|
||||
EventRef event;
|
||||
HIRect optimalBounds;
|
||||
CreateEvent(0, kEventClassControl,
|
||||
kEventControlGetOptimalBounds,
|
||||
GetCurrentEventTime(),
|
||||
kEventAttributeUserEvent, &event);
|
||||
|
||||
SendEventToEventTargetWithOptions(event,
|
||||
HIObjectGetEventTarget(HIObjectRef(winId())),
|
||||
kEventTargetDontPropagate);
|
||||
|
||||
GetEventParameter(event,
|
||||
kEventParamControlOptimalBounds, typeHIRect,
|
||||
0, sizeof(HIRect), 0, &optimalBounds);
|
||||
|
||||
ReleaseEvent(event);
|
||||
return QSize(optimalBounds.size.width + 100, // make it a bit wider.
|
||||
optimalBounds.size.height);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
QMenu *createMenu(QWidget *parent)
|
||||
{
|
||||
QMenu *searchMenu = new QMenu(parent);
|
||||
|
@ -261,9 +261,7 @@ private slots:
|
||||
#endif
|
||||
void raise();
|
||||
void lower();
|
||||
#ifndef QT_MAC_USE_COCOA
|
||||
void stackUnder();
|
||||
#endif
|
||||
void testContentsPropagation();
|
||||
void saveRestoreGeometry();
|
||||
void restoreVersion1Geometry_data();
|
||||
@ -320,9 +318,7 @@ private slots:
|
||||
void moveChild();
|
||||
void showAndMoveChild();
|
||||
|
||||
#ifndef QT_MAC_USE_COCOA
|
||||
void subtractOpaqueSiblings();
|
||||
#endif
|
||||
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
void setGeometry_win();
|
||||
|
Loading…
Reference in New Issue
Block a user