Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) HelloQtQtCreatorCygwin

 

QtQt CreatorCygwin

 

Hello Qt using Qt Creator under Cygwin 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 project file: ./CppHelloQtQtCreatorCygwin/CppHelloQtQtCreatorCygwin.pro

 

QT       += core gui

#Support both Qt4 and Qt5
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TEMPLATE = app
SOURCES += main.cpp\
        dialog.cpp
HEADERS  += dialog.h
FORMS    += dialog.ui

 

 

 

 

 

./CppHelloQtQtCreatorCygwin/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

 

 

 

 

 

./CppHelloQtQtCreatorCygwin/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;
}

 

 

 

 

 

./CppHelloQtQtCreatorCygwin/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();
}

 

 

 

 

 

./CppHelloQtQtCreatorCygwin/CppHelloQtQtCreatorCygwin.sh

 

#!/bin/bash
mymake="make.exe"
myqmake="/usr/lib/qt4/bin/qmake.exe"
mytarget="CppHelloQtQtCreatorCygwin"
myprofile=$mytarget.pro
myexe=$mytarget.exe


if [ -e $myqmake ]
then
  echo "Compiler '$myqmake' found"
else
  echo "Compiler '$myqmake' not found directly"
  #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"
$myqmake $myprofile

if [ -e Makefile ]
then
  echo "Makefile created successfully"
else
  echo "FAIL: $myqmake $myprofile"
  exit
fi

if [ -e $mymake ]
then
  echo "Compiler '$mymake' found"
else
  echo "Compiler '$mymake' not found directly"
  #exit
fi

echo "2/2: making makefile"

$mymake

echo $myexe

if [ -e $myexe ]
then
  echo "SUCCESS"
else
  echo "FAIL"
fi

#Cleaning up
rm *.o
rm $myexe
rm Makefile
rm ui_*.*
rm moc_*.*

 

 

 

 

 

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

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml