Qocoa compilation fix for MacOS.

This commit is contained in:
Francois Ferrand 2013-05-01 09:43:09 +02:00
parent d2ab008aa0
commit a85ac07576
5 changed files with 18 additions and 15 deletions

View File

@ -238,6 +238,9 @@ target_link_libraries(${PROGNAME}
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
target_link_libraries(${PROGNAME} ${QT_QTDBUS_LIBRARY}) target_link_libraries(${PROGNAME} ${QT_QTDBUS_LIBRARY})
endif() endif()
if(APPLE)
set_target_properties(${PROGNAME} PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit")
endif()
set_target_properties(${PROGNAME} PROPERTIES ENABLE_EXPORTS ON) set_target_properties(${PROGNAME} PROPERTIES ENABLE_EXPORTS ON)

View File

@ -45,6 +45,6 @@ endif()
add_library (Qocoa STATIC ${SOURCES} ${MOC_SOURCES} ${HEADERS} ${RESOURCES_SOURCES}) add_library (Qocoa STATIC ${SOURCES} ${MOC_SOURCES} ${HEADERS} ${RESOURCES_SOURCES})
if(APPLE) #if(APPLE)
set_target_properties(Qocoa PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit") # set_target_properties(Qocoa PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit")
endif() #endif()

View File

@ -137,7 +137,7 @@ public:
void clicked() void clicked()
{ {
emit qButton->clicked(qButton->isChecked()); Q_EMIT qButton->clicked(qButton->isChecked());
} }
~QButtonPrivate() { ~QButtonPrivate() {

View File

@ -21,9 +21,9 @@ THE SOFTWARE.
*/ */
#include <Foundation/NSString.h> #include <Foundation/NSString.h>
#include <QString> #include <QtCore/QString>
#include <QVBoxLayout> #include <QtGui/QVBoxLayout>
#include <QMacCocoaViewContainer> #include <QtGui/QMacCocoaViewContainer>
static inline NSString* fromQString(const QString &string) static inline NSString* fromQString(const QString &string)
{ {

View File

@ -28,8 +28,8 @@ THE SOFTWARE.
#import "Foundation/NSNotification.h" #import "Foundation/NSNotification.h"
#import "AppKit/NSSearchField.h" #import "AppKit/NSSearchField.h"
#include <QApplication> #include <QtGui/QApplication>
#include <QClipboard> #include <QtGui/QClipboard>
#define KEYCODE_A 0 #define KEYCODE_A 0
#define KEYCODE_X 7 #define KEYCODE_X 7
@ -45,19 +45,19 @@ public:
void textDidChange(const QString &text) void textDidChange(const QString &text)
{ {
if (qSearchField) if (qSearchField)
emit qSearchField->textChanged(text); Q_EMIT qSearchField->textChanged(text);
} }
void textDidEndEditing() void textDidEndEditing()
{ {
if (qSearchField) if (qSearchField)
emit qSearchField->editingFinished(); Q_EMIT qSearchField->editingFinished();
} }
void returnPressed() void returnPressed()
{ {
if (qSearchField) if (qSearchField)
emit qSearchField->returnPressed(); Q_EMIT qSearchField->returnPressed();
} }
QPointer<QSearchField> qSearchField; QPointer<QSearchField> qSearchField;
@ -193,7 +193,7 @@ void QSearchField::clear()
return; return;
[pimpl->nsSearchField setStringValue:@""]; [pimpl->nsSearchField setStringValue:@""];
emit textChanged(QString()); Q_EMIT textChanged(QString());
} }
void QSearchField::selectAll() void QSearchField::selectAll()
@ -246,7 +246,7 @@ void QSearchField::changeEvent(QEvent* event)
return; return;
const bool enabled = isEnabled(); const bool enabled = isEnabled();
[pimpl->nsSearchField setEnabled: enabled] [pimpl->nsSearchField setEnabled: enabled];
} }
QWidget::changeEvent(event); QWidget::changeEvent(event);
} }