A multi-platform GUI-building program

Slides:



Advertisements
Similar presentations
First Steps with Qt Julien Finet Kitware Inc. Jan. 05 th 2010.
Advertisements

Sven Johannsen C++ User Group Aachen 01/08/15
Lecture 4: Embedded Application Framework Qt Tutorial Cheng-Liang (Paul) Hsieh ECE 424 Embedded Systems Design.
QT GUI Programming CS340 – Software Design © 2009 – Jason Leigh University of Illinois at Chicago.
Review of Scientific Programming in C and Fortran Michael McLennan Software Architect HUBzero™ Platform for Scientific Collaboration.
Dale Roberts Introduction to Visual Programming Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation Namespaces Simple Make Files (Ignore all class references.
CS 202 Computer Science II Lab Fall 2009 September 17.
Unix Continuum of Tools Do something once: use the command line Do something many times: –Use an alias –Use a shell script Do something that is complex.
CS 202 Computer Science II Lab Fall 2009 September 10.
ספטמבר 04Copyright Meir Kalech1 C programming Language Chapter 10: Appendices.
CS 240: Data Structures Supplemental: Command Line Input.
Linux Qt Graphical User Interface (GUI) Development In this session, we will cover Qt GUI development tools including: Qt Creator for remote debug and.
QT Intro. 김기형
LAMAD Symbian Qt install and deploy Installing Qt SDK and deploying Qt applications.
LAMAD Symbian Qt Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS.
Oct ROOT 2002, CERN, Geneva Qt-Based Implementation of Low Level ROOT Graphical Layer By V.Fine.
Qt Igor November 8, 2002 Friday’s HENP Group Meeting.
Shorthand operators.
Initialization of Clang
Blanchette and Summerfield, Ch. 2
1 INF160 IS Development Environments AUBG, COS dept Lecture 06 Title: Dev Env: Code::Blocks (Extract from Syllabus) Reference:
CTK Hackfest Testing framework November 2011 Inria – Sofia Antipolis.
Cross-platform GUI Frameworks for 3D Apps and Games: Qt vs wxWidgets
…WHAT YOU SHOULD HAVE LEARNED IN ETEC1101… IN JAVA 2. C => JAVA.
FLTK Tutorial.
Using Qt for GUI development Brad Whitlock March 2002.
ITEC 320 C++ Examples.
11 Introduction to Object Oriented Programming (Continued) Cats.
1 + 1 becomes 11 what does our software promise?.
CS-1030 Dr. Mark L. Hornick 1 Java Review Interactive.
4.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Project1: Unix Shell with History Feature Goals Descriptions Methodology Submission.
-1- National Alliance for Medical Image Computing First Steps with Qt Julien Finet Kitware Inc. Jan. 05 th 2010.
Lin Chen 09/06/2011. Global variables const int maxCandidates = 10; // Names of the candidates participating in this state's primary string candidate[maxCandidates];
LLNL-PRES-xxxxxx This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.
QT Programming QT Programming Ruku Roychowdhury. Background QT is a cross platform application framework. Widely used to develop GUI applications. Originally.
. The ideas behind Qt and a live demo Qt in Education.
Java and C++ Transitioning. A simple example public class HelloWorldApp { public static void main(String[] args) { //Display the string. System.out.println("Hello.
QT – Introduction C++ GUI Programming with Qt 4
EEL 5937 The Bond Agent System (3) EEL 5937 Multi Agent Systems Lecture 17, March. 4, 2003 Lotzi Bölöni.
Introduction to Objective-C Spring Goals An introduction to Objective-C As implemented by the Apple LLVM Compiler 4.0 (a.k.a. Clang) Only the basics…
EIToolkit stub doc. main.cpp file int main(int argc, char* argv[]) { EIProperties::UseStandards(); // create the stub ExampleStub stub; stub.Start();
February 28, 2005 Introduction to Classes. Object Oriented Programming An object is a software bundle of related variables and methods. Software objects.
Department of Computer Science and Engineering, HKUST 1 HKUST Summer Programming Course 2008 Using Member Functions and Data Members.
Make a Copy Of File Main.cpp (of Student-Class). Place It On Your Desktop. Open it With A Text Editor 3.
StEvent I/O Model And Writing a Maker Or How to Add a New Detector Akio Ogawa BNL 2003 Nov Dubna.
Processing == Java + Extra Utilities Processing Adds: – Drawing functions – Text and font manipulations – Image and video – 3D transformations – Keyboard.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
1 Data Structures and Algorithms Stack. 2 The Stack ADT Introduction to the Stack data structure Designing a Stack class using dynamic arrays Linked Stacks.
1. 2 Qt Toolkit ● C++ toolkit for cross-platform GUI application development – GUI functions (GUI = graphical user interface) – Data access components,
Eclipse.
Mobile Application Development with MeeGo™ - Touch Apps & UI Design
Mark Redekopp David Kempe
Introduction to programming in java
HCI/CHI: Computer-Human Interaction
Jonathan Riddell Canonical Kubuntu Ubuntu KDE
CMPE 135: Object-Oriented Analysis and Design November 21 Class Meeting Department of Computer Engineering San Jose State University Fall 2017 Instructor:
QT graphical user interface framework
Programming Language Concepts (CIS 635)
Mobile Application Development with MeeGo™ - Programming with SDK
Project1: Unix Shell using Multi-Processing
הרצאה 08 פרמטרים ל- main קרן כליף.
The Designer.
Custom Widgets & Events
Getting Started with Milestone 2
QtSpim Demo & Tutorial SPRING 2011.
A multi-platform GUI-building program
Running a Java Program using Blue Jay.
Makefile Assignment Create a file called f1.cpp. It should contain the following function: int squareIt ( int x ) { //insert code to calc and return the.
Presentation transcript:

A multi-platform GUI-building program Using Qt4 A multi-platform GUI-building program

Basic steps Create a directory (myqt) to contain everything. All work is done IN this directory Start Qt Designer to construct your primary GUI panel Creates myqt.ui which will LATER be converted into ui_myqt.h Create main.cpp it must have this name or you have to modify the .pro file Run: qmake-qt4 -project {-o xxx} Creates the initial xxx.pro file The default (where xxx is myqt) will be the name of the containing directory Run: qmake-qt4 xxx.Pro Uses the xxx.pro file to create a makefile Use a text editor to create xxx.h Use a text editor to create xxx.cpp Rewrite main.cpp to use the above files Re-run: qmake-qt4 –project {-o xxx} this will add the xxx.cpp file Re-run: qmake-qt4 xxx.Pro Run make Add more C++ code to continue the implementation. Reference: http://www.informit.com/articles/article.aspx?p=1405224&seqNum=3

This is the original “main.cpp” (created by hand) #include <QApplication> #include <QDialog> #include "ui_xxx.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); Ui::xxx ui; QDialog *dialog = new QDialog; ui.setupUi(dialog); dialog->show(); return app.exec(); }

xxx.h created by hand // NOTE there is no “ui_” prefix here #ifndef xxx_H #define xxx_H  #include <QDialog> #include "ui_xxx.h"   class xxx : public QDialog, public Ui::xxx { Q_OBJECT public: xxx(QWidget *parent = 0); private slots: void on_lineEdit_textChanged(); }; #endif

NEW main.cpp (after initial build) #include <QApplication> #include "xxx.h" // NOTE no “ui_” prefix on the name here!! int main(int argc, char *argv[]) { QApplication app(argc, argv); xxx *dialog = new xxx; dialog->show(); return app.exec(); }

Files after 1st make. Folder name = qt4GUI hand-created (textfiles or qt Designer): djdialog1.ui djmain.cpp djdialog1.cpp djdialog1.h qt-created qt4-GUI.pro ui_djdialog1.h moc_djdialog1.cpp Makefile results of make djdialog1.0 moc_djdialog1.o qt4-GUI

#include <QtGui> #include "djdialog1 #include <QtGui> #include "djdialog1.h" // note: no "ui_" prefix here #include <sstream> #include <string> int int1, int2, answer; djdialog1::djdialog1(QWidget *parent) : QDialog(parent) { setupUi(this); // initialize my form connect(int1box, SIGNAL(textChanged(const QString &)), this, SLOT(on_int1box_textChanged())); connect(int2box, SIGNAL(textChanged(const QString &)), this, SLOT(on_int2box_textChanged())); connect(GoButton, SIGNAL(clicked()), this, SLOT(accept())); }

void djdialog1::on_GoButton_clicked() { QString qreply; qreply=QString::number(answer); answerbox->append(qreply); } void djdialog1::on_int1box_textChanged(const QString &arg) {bool ok; int1 = arg.toInt(&ok,10); void djdialog1::on_int2box_textChanged(const QString &arg) int2 = arg.toInt(&ok,10);}