diff --git a/src/gui/qocoa/CMakeLists.txt b/src/gui/qocoa/CMakeLists.txt index 513f81f7d..c1dcdce35 100644 --- a/src/gui/qocoa/CMakeLists.txt +++ b/src/gui/qocoa/CMakeLists.txt @@ -1,16 +1,16 @@ project(Qocoa) cmake_minimum_required(VERSION 2.8) -find_package(Qt4 COMPONENTS QtMain QtCore QtGui REQUIRED) -include(UseQt4) +#find_package(Qt4 COMPONENTS QtMain QtCore QtGui REQUIRED) +#include(UseQt4) set(SOURCES - main.cpp - gallery.cpp + #main.cpp + #gallery.cpp ) set(HEADERS - gallery.h + #gallery.h qsearchfield.h qbutton.h qprogressindicatorspinning.h @@ -37,12 +37,14 @@ else() qt4_add_resources(RESOURCES_SOURCES ${RESOURCES}) endif() -add_executable(Qocoa - WIN32 MACOSX_BUNDLE - ${SOURCES} ${MOC_SOURCES} ${RESOURCES_SOURCES} -) -target_link_libraries(Qocoa ${QT_LIBRARIES}) +#add_executable(Qocoa +# WIN32 MACOSX_BUNDLE +# ${SOURCES} ${MOC_SOURCES} ${RESOURCES_SOURCES} +#) +#target_link_libraries(Qocoa ${QT_LIBRARIES}) -if(APPLE) - set_target_properties(Qocoa PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit") -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() diff --git a/src/gui/qocoa/qbutton.h b/src/gui/qocoa/qbutton.h index 93e598f80..c84ad73fd 100644 --- a/src/gui/qocoa/qbutton.h +++ b/src/gui/qocoa/qbutton.h @@ -30,7 +30,7 @@ public: explicit QButton(QWidget *parent, BezelStyle bezelStyle = Rounded); -public slots: +public Q_SLOTS: void setText(const QString &text); void setImage(const QPixmap &image); void setChecked(bool checked); @@ -39,7 +39,7 @@ public: void setCheckable(bool checkable); bool isChecked(); -signals: +Q_SIGNALS: void clicked(bool checked = false); private: diff --git a/src/gui/qocoa/qbutton_mac.mm b/src/gui/qocoa/qbutton_mac.mm index 15490e453..dccc771ac 100644 --- a/src/gui/qocoa/qbutton_mac.mm +++ b/src/gui/qocoa/qbutton_mac.mm @@ -137,7 +137,7 @@ public: void clicked() { - emit qButton->clicked(qButton->isChecked()); + Q_EMIT qButton->clicked(qButton->isChecked()); } ~QButtonPrivate() { diff --git a/src/gui/qocoa/qprogressindicatorspinning.h b/src/gui/qocoa/qprogressindicatorspinning.h index ae40a92a2..17b20e44d 100644 --- a/src/gui/qocoa/qprogressindicatorspinning.h +++ b/src/gui/qocoa/qprogressindicatorspinning.h @@ -19,7 +19,7 @@ public: explicit QProgressIndicatorSpinning(QWidget *parent, Thickness thickness = Default); -public slots: +public Q_SLOTS: void animate(bool animate = true); private: friend class QProgressIndicatorSpinningPrivate; diff --git a/src/gui/qocoa/qsearchfield.h b/src/gui/qocoa/qsearchfield.h index 5abf4986a..4d012cd06 100644 --- a/src/gui/qocoa/qsearchfield.h +++ b/src/gui/qocoa/qsearchfield.h @@ -21,19 +21,19 @@ public: void setFocus(Qt::FocusReason); void setMenu(QMenu *menu); -public slots: +public Q_SLOTS: void setText(const QString &text); void setPlaceholderText(const QString &text); void clear(); void selectAll(); void setFocus(); -signals: +Q_SIGNALS: void textChanged(const QString &text); void editingFinished(); void returnPressed(); -private slots: +private Q_SLOTS: void popupMenu(); protected: diff --git a/src/gui/qocoa/qsearchfield_mac.mm b/src/gui/qocoa/qsearchfield_mac.mm index 345ee7848..01d55937c 100644 --- a/src/gui/qocoa/qsearchfield_mac.mm +++ b/src/gui/qocoa/qsearchfield_mac.mm @@ -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; @@ -198,7 +198,7 @@ void QSearchField::clear() return; [pimpl->nsSearchField setStringValue:@""]; - emit textChanged(QString()); + Q_EMIT textChanged(QString()); } void QSearchField::selectAll()