Sample: How to integrate Qt and IADP SDK

Sample: How to integrate Qt and IADP SDK

First, you must integrate Qt and Visual Studio 2008 Consider we use QWidget on our application (in practice, you could use any of QtGui classes) // App.h #include <QWidget> #include <adpcppf.h> using namespace com::intel::adp; class Test : public QWidget, Application { Q_OBJECT public: Test(QWidget *parent = 0); ~Test(); // Add your another methods; private: static ApplicationId id; // Add your another member };
24 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

// App.cpp
#include "app.h"

ApplicationId Test::id = ADP_DEBUG_APPLICATIONID;

Test::Test(QWidget *parent) : public QWidget(parent), Application(id)
{
//Constructor
}

Test::~Test()
{
//Destructor
}

// Your next code

Finally, the main.cpp

//main.cpp

#include "QApplication"

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

try{
Test *test;
test->show();
return app.exec();

} catch (AdpException &e) {

// code if failed
}
}

Did we saw delete keyword?
It doesn't necessary to use that. Qt did it for you automatically

regards,

Thank you for the contribution.

First, you must integrate Qt and Visual Studio 2008
Consider we use QWidget on our application (in practice, you could use any of QtGui classes)

// App.h
#include <QWidget.h>
#include <adpcppf.h&gt

using namespace com::intel::adp;

class Test : public QWidget, Application
{
Q_OBJECT

public:
Test(QWidget *parent = 0);
~Test();
// Add your another methods;

private:
static ApplicationId id;
// Add your another member
};

You are welcome, Brian

Hey Brian,
I am seeing the same problem while integrating the sdk with the qt app . Can you send me the fix or details too

I am also wondering can't this be done without Visual Studio? How to achieve IADP integration for Meego using just the QT as we are doing development in coding. Can't really find any helpful link so far. Let me know if anybody has been able to integrate IADP using just QT.

This what I was look for. Thank to all of U!

Thanks Chandra,
This really helped me a lot.

Chandra,

I am looking forward to it, the more we share the more we grow. Thank you for the contribution.

The link is still not available!

Yes, it looks like it still needs blog approval. Can it e re-posted, perhaps it was lost somehow with one of the website updates.

Hi,

I am a newbie to this program. I am using QT creator (installed at default location) and the IADP SDK (also installed at the default location). I have included "adpcppf.h" and tried following your code above, however, when i try to build the project, it does not recognise the ApplicationId as a valid type.

The first step you state is "you must integrate Qt and Visual Studio 20008"- I take it since I am not using visual studio I do not need to do this??

Can you explain the steps I need to take to set up the QT/IADP environment? How should I specify the required namespace?

Additionally in the .pro file what libraries do i need to declare?

Is there another way I can access the document you have been trying to upload?

Best Regards,
Joe

Joe,

While I do not have the aforementioned document I can outline the basic steps:

1.) Add include references to AppUp SDK
2.) Specify Debug/Release AppUp Libraries in linker settings
3.) Add AppUp authorization code to initialization section fo your application/game

What are you using to develop your QT project? If you have source code you can share I would be happy to have a look and perhaps provide a working integration example.

Hi Brian,

Thanks for the response, you triggered a couple of ideas which i tried but failed. So i will show you want i have got.

I am just using the helloworld program while i try to integrate the appup SDK in to my environment. I am using QT creator for development.

I have the follow code in my files,

helloworld.pro:
---------------------------------------------------------------------------------
QT += core gui

TARGET = helloworld
TEMPLATE = app

SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h \
../../../../../../Program Files (x86)/Intel/IntelAppUpSDK/Cpp/include/adpcppf.h\
ApplicationId.h

FORMS += mainwindow.ui

LIBS = -L"c:\Program Files (x86)\Intel\IntelAppUpSDK\Cpp\lib" -ladpcored -ladpcppf -ladpcppfd -ladpcore
--------------------------------------------------------------------------

main.cpp
-------------------------------------------------------------
#include
#include "mainwindow.h"
#include
#include

using namespace com::intel::adp;

const ApplicationId myApplicationID(ADP_DEBUG_APPLICATIONID);

int main(int argc, char *argv[])
{
Application *myApplication = NULL;
try{
myApplication = new Application(myApplicationID);

}catch (AdpException){

}

QApplication a(argc, argv);
MainWindow w;
w.show();

return a.exec();
}
-------------------------------------------------------------------------------------

mainwindow.cpp
-----------------------------------------------------------------------------
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);

setWindowTitle("HELLO MEEGO!");
setWindowIcon(QIcon::fromTheme("nautilus"));

//setup a menu
QAction *quitAction = new QAction(tr("&Quit"), this);
quitAction->setShortcut(tr("Ctrl+Q"));
quitAction->setStatusTip(tr("Say goodbye to Hello Meego!"));
connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));

QMenu *menu = menuBar()->addMenu(tr("&File"));
menu->addAction(quitAction);

QLabel *label = new QLabel("Hello MeeGo!!", this, 0);
QRect lg = label->geometry();
QRect wg = this->geometry();
label->setGeometry(wg.width()/2 - lg.width()/2,
wg.height()/2 - lg.height()/2,
lg.width(), lg.height());

}

MainWindow::~MainWindow()
{
delete ui;
}
-------------------------------------------------------------------------------------

mainwindow.h
-------------------------------------------------------------------------------------
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include
#include

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
Q_OBJECT

public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

private:
Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
---------------------------------------------------------------------------------------------

By commenting out the appup SDK lines of code in main.cpp the program compiles and runs. However, if i build the project as detailed above I get the following errors,

In function 'int qMain(int, char**)':
'Application' was not declared in this scope
'myApplication' was not declared in this scope
expected type-specifier before 'Application'
expected ';' before 'Application'
expected type-specifier before 'AdpException

I am sure this is a real'newbie' error but I cannot see what else I need to do to include the SDK in QT creator.

Any help will be much appreciated.

Best Regards,
Joe

Joe,

I can fix this up for you. Please provide a link to the complete project.
* http://www.4shared.com/

Hi Brian,

Many thanks for all your help, here is the link; http://www.4shared.com/dir/4EmukN-X/QT_projects.html

I included a couple of the appup headers just in case, hope this is OK.

Regards,
Joe

Thanks

You can see complementary of this article at http://appdeveloper.intel.com/en-us/blog/2010/06/01/how-integrate-iadp-sdk-qt-vs-2008-blog-version

Kind regards

Chandra,

That link results in:

Access denied

You are not authorized to access this page.

I'm sorry about that. When I last checked the link today (6/2/2010). It's marked as unpublished at the background image. Do we have waiting an approval for every blog entry we posted? I can't see some kind of "publish" button

Chandra,

Ahh yes, it will need to be approved by the blog moderator before others may view it. This can take a few days.

Ahh, I'm so sorry for this inconvenient. So, as Brian said, let's waiting for a few days :)

Leave a Comment

Please sign in to add a comment. Not a member? Join today