Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.





Hello Qt using Qt Creator under Lubuntu, crosscompiled to Windows
is a Hello Qt program.
Technical facts
Application type(s)
Operating system(s) or programming environment(s)
IDE(s):
Project type:
C++ standard:
Compiler(s):
Libraries used:
Qt: version 5.4.1 (32 bit)
STL: GNU ISO C++ Library, version 4.9.2
Qt project file: ./CppHelloQtQtCreatorLubuntuToWindows/CppHelloQtQtCreatorLubuntuToWindows.pro
./CppHelloQtQtCreatorLubuntuToWindows/dialog.h
//---------------------------------------------------------------------------
/*
CppHelloQtQtCreatorLubuntu, Hello World program using Qt Creator under Lubuntu
Copyright (C) 2013 Richel Bilderbeek
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/CppHelloQtQtCreatorLubuntu.htm
//---------------------------------------------------------------------------
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
namespace Ui {
class Dialog;
}
class Dialog : public QDialog
{
Q_OBJECT
public:
explicit Dialog(QWidget *parent = 0);
~Dialog();
private:
Ui::Dialog *ui;
};
#endif // DIALOG_H
|
./CppHelloQtQtCreatorLubuntuToWindows/dialog.cpp
//---------------------------------------------------------------------------
/*
CppHelloQtQtCreatorLubuntu, Hello World program using Qt Creator under Lubuntu
Copyright (C) 2013 Richel Bilderbeek
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/CppHelloQtQtCreatorLubuntu.htm
//---------------------------------------------------------------------------
#include "dialog.h"
#include "ui_dialog.h"
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
this->setWindowTitle(QApplication::applicationName());
}
Dialog::~Dialog()
{
delete ui;
}
|
./CppHelloQtQtCreatorLubuntuToWindows/main.cpp
//---------------------------------------------------------------------------
/*
CppHelloQtQtCreatorLubuntu, Hello World program using Qt Creator under Lubuntu
Copyright (C) 2013 Richel Bilderbeek
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/CppHelloQtQtCreatorLubuntu.htm
//---------------------------------------------------------------------------
//Support both Qt4 and Qt5
#include <qglobal.h>
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
#include <QApplication>
#else
#include <QApplication>
#endif
#include "dialog.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Dialog w;
w.show();
return a.exec();
}
|
./CppHelloQtQtCreatorLubuntuToWindows/CppHelloQtQtCreatorLubuntuToWindows.sh
#!/bin/bash
#From http://richelbilderbeek.nl/CppHelloQtQtCreatorLubuntuToWindows.htm
echo "Cross compiling to Windows"
myfile="i686-pc-mingw32-qmake"
#myfile="../../Libraries/mxe/usr/bin/i686-pc-mingw32-qmake"
mytarget="CppHelloQtQtCreatorLubuntuToWindows"
myprofile=$mytarget.pro
if [ -e $myfile ]
then
echo "MXE crosscompiler '$myfile' found"
else
echo "MXE crosscompiler '$myfile' not found"
#exit
fi
if [ -e $myprofile ]
then
echo "Qt Creator project '$myprofile' found"
else
echo "Qt Creator project '$myprofile' not found"
exit
fi
echo "1/2: Creating Windows makefile"
$myfile $myprofile
if [ -e Makefile ]
then
echo "Makefile created successfully"
else
echo "FAIL: $myfile $myprofile"
exit
fi
echo "2/2: making makefile"
make
if [ -e ./release/$mytarget.exe ]
then
echo "SUCCESS"
else
echo "FAIL"
fi
#Cleaning up
rm Makefile
rm Makefile.*
rm -r release
rm -r debug
rm ui_*.*
|
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.

This page has been created by the tool CodeToHtml