Commit b95b7db5 authored by schurade's avatar schurade
Browse files

added MOC file creation to the CMakeLists.txt for /gui/qt4 and did an example...

added MOC file creation to the CMakeLists.txt for /gui/qt4 and did an example connect for a load function
parent 7cef1648
......@@ -9,8 +9,15 @@ SET( QT_LINK_LIBRARIES ${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTOPENGL_LIBRARY} )
# add here all classes that inherit from QObject
SET(GUI_QT4_MOC_HDRS
WMainWindow.h
)
QT4_WRAP_CPP(GUI_QT4_MOC_SRCS ${GUI_QT4_MOC_HDRS} )
FILE(GLOB GUI_QT4_SRC "*.cpp")
ADD_LIBRARY( guiqt4 SHARED ${GUI_QT4_SRC} )
ADD_LIBRARY( guiqt4 SHARED ${GUI_QT4_SRC} ${GUI_QT4_MOC_SRCS} )
TARGET_LINK_LIBRARIES( guiqt4 gui ge ${QT_LINK_LIBRARIES} )
......@@ -21,6 +21,8 @@
//
//---------------------------------------------------------------------------
#include <iostream>
#include <QtGui/QDockWidget>
#include "WMainWindow.h"
......@@ -156,6 +158,9 @@ void WMainWindow::setupGUI( QMainWindow *MainWindow )
QObject::connect( m_actionExit, SIGNAL( activated() ), MainWindow,
SLOT( close() ) );
QObject::connect( m_actionLoad, SIGNAL( activated() ), this,
SLOT( load() ) );
QMetaObject::connectSlotsByName( MainWindow );
}
......@@ -163,3 +168,8 @@ void WMainWindow::setEnabled( bool enable )
{
// TODO(wiebel): implement here
}
void WMainWindow::load()
{
std::cout << "test output: load function" << std::endl;
}
......@@ -46,8 +46,10 @@ class WQtPipelineBrowser;
* This class contains the main window and the layout
* of the widgets within the window.
*/
class WMainWindow : public WGUI
class WMainWindow : public QObject, public WGUI
{
Q_OBJECT
public:
/**
......@@ -65,6 +67,11 @@ public:
void setEnabled( bool enable );
private:
/**
* Helper routine for adding new docks with GL content
*/
void addDockableGLWidget( QMainWindow *MainWindow );
QAction* m_actionLoad;
QAction* m_actionSave;
QAction* m_actionPreferences;
......@@ -80,10 +87,12 @@ private:
WQtGLWidget* m_glWidget;
WQtPipelineBrowser* m_pipelineBrowser;
private slots:
/**
* Helper routine for adding new docks with GL content
* gets called when menu option or toolbar button load is activated
*/
void addDockableGLWidget( QMainWindow *MainWindow );
void load();
};
#endif // WMAINWINDOW_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment