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)
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()

View File

@ -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:

View File

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

View File

@ -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;

View File

@ -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:

View File

@ -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;
@ -198,7 +198,7 @@ void QSearchField::clear()
return;
[pimpl->nsSearchField setStringValue:@""];
emit textChanged(QString());
Q_EMIT textChanged(QString());
}
void QSearchField::selectAll()