Skip to content

Commit

Permalink
incomplete example of Jamroot with Qt4
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpoelen committed Dec 10, 2015
1 parent 1ca09cb commit 4c0b4b9
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
24 changes: 24 additions & 0 deletions bjam-qt-example/Jamroot
@@ -0,0 +1,24 @@
using qt : / : /usr/bin : /usr/include/qt4 : /usr/lib ;

import qt4 ;
if ! [ qt4.initialized ]
{
ECHO "Warning: Qt4 not initialized in user-config.jam" ;
exit ;
}

import cast ;

# project : requirements <threading>multi ;

exe main
:
main.cpp
[ cast moc/main.moc moccable-cpp : main.h ]
/qt//QtGui
:
<cxxflags>-idirafter=/usr/include/qt4/QtGui/
<cxxflags>-idirafter=/usr/include/qt4/
# TODO BAD
<cxxflags>-Ibin/gcc-4.9.1/debug/threading-multi/
;
30 changes: 30 additions & 0 deletions bjam-qt-example/main.cpp
@@ -0,0 +1,30 @@
// Copyright Vladimir Prus 2005.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)

#include "main.h"

#include <iostream>

My_widget ::My_widget() : QWidget()
{
QPushButton* b = new QPushButton("Push me", this);

connect(b, SIGNAL(clicked()), this, SLOT(theSlot()));
}

void My_widget ::theSlot()
{
std::cout << "Clicked\n";
}

int main(int ac, char* av[])
{
QApplication app(ac, av);
My_widget mw;
mw.show();
app.exec();
}

#include "main.moc"
19 changes: 19 additions & 0 deletions bjam-qt-example/main.h
@@ -0,0 +1,19 @@
#ifndef AA
#define AA

#include <qwidget.h>
#include <qpushbutton.h>
#include <qapplication.h>

class My_widget : public QWidget
{
Q_OBJECT
public:
My_widget();

private slots:
void theSlot();

};

#endif

0 comments on commit 4c0b4b9

Please sign in to comment.