Fixed building of qocoa subtree.

This commit is contained in:
Keith Bennett 2014-03-22 15:28:33 +00:00
parent 16598a8386
commit 0c33019f93
6 changed files with 26 additions and 24 deletions

View File

@ -1,16 +1,16 @@
project(Qocoa) project(Qocoa)
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
find_package(Qt4 COMPONENTS QtMain QtCore QtGui REQUIRED) #find_package(Qt4 COMPONENTS QtMain QtCore QtGui REQUIRED)
include(UseQt4) #include(UseQt4)
set(SOURCES set(SOURCES
main.cpp #main.cpp
gallery.cpp #gallery.cpp
) )
set(HEADERS set(HEADERS
gallery.h #gallery.h
qsearchfield.h qsearchfield.h
qbutton.h qbutton.h
qprogressindicatorspinning.h qprogressindicatorspinning.h
@ -37,12 +37,14 @@ else()
qt4_add_resources(RESOURCES_SOURCES ${RESOURCES}) qt4_add_resources(RESOURCES_SOURCES ${RESOURCES})
endif() endif()
add_executable(Qocoa #add_executable(Qocoa
WIN32 MACOSX_BUNDLE # WIN32 MACOSX_BUNDLE
${SOURCES} ${MOC_SOURCES} ${RESOURCES_SOURCES} # ${SOURCES} ${MOC_SOURCES} ${RESOURCES_SOURCES}
) #)
target_link_libraries(Qocoa ${QT_LIBRARIES}) #target_link_libraries(Qocoa ${QT_LIBRARIES})
if(APPLE) add_library (Qocoa STATIC ${SOURCES} ${MOC_SOURCES} ${HEADERS} ${RESOURCES_SOURCES})
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

@ -30,7 +30,7 @@ public:
explicit QButton(QWidget *parent, BezelStyle bezelStyle = Rounded); explicit QButton(QWidget *parent, BezelStyle bezelStyle = Rounded);
public slots: public Q_SLOTS:
void setText(const QString &text); void setText(const QString &text);
void setImage(const QPixmap &image); void setImage(const QPixmap &image);
void setChecked(bool checked); void setChecked(bool checked);
@ -39,7 +39,7 @@ public:
void setCheckable(bool checkable); void setCheckable(bool checkable);
bool isChecked(); bool isChecked();
signals: Q_SIGNALS:
void clicked(bool checked = false); void clicked(bool checked = false);
private: private:

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

@ -19,7 +19,7 @@ public:
explicit QProgressIndicatorSpinning(QWidget *parent, explicit QProgressIndicatorSpinning(QWidget *parent,
Thickness thickness = Default); Thickness thickness = Default);
public slots: public Q_SLOTS:
void animate(bool animate = true); void animate(bool animate = true);
private: private:
friend class QProgressIndicatorSpinningPrivate; friend class QProgressIndicatorSpinningPrivate;

View File

@ -21,19 +21,19 @@ public:
void setFocus(Qt::FocusReason); void setFocus(Qt::FocusReason);
void setMenu(QMenu *menu); void setMenu(QMenu *menu);
public slots: public Q_SLOTS:
void setText(const QString &text); void setText(const QString &text);
void setPlaceholderText(const QString &text); void setPlaceholderText(const QString &text);
void clear(); void clear();
void selectAll(); void selectAll();
void setFocus(); void setFocus();
signals: Q_SIGNALS:
void textChanged(const QString &text); void textChanged(const QString &text);
void editingFinished(); void editingFinished();
void returnPressed(); void returnPressed();
private slots: private Q_SLOTS:
void popupMenu(); void popupMenu();
protected: protected:

View File

@ -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;
@ -198,7 +198,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()