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)
target_link_libraries(${PROGNAME} ${QT_QTDBUS_LIBRARY})
endif()
if(APPLE)
set_target_properties(${PROGNAME} PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit")
endif()
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})
if(APPLE)
set_target_properties(Qocoa PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit")
endif()
#if(APPLE)
# set_target_properties(Qocoa PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit")
#endif()

View File

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

View File

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

View File

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