ChQt Home Page

This page is just to announce that we have started work on building Ch interface to Qt library.

The image below shows a very simple Qt application consisting of two buttons:

The Ch source code for this example is as follows


#include <chqt.h>
#include <chqt.h>
#include <stdlib.h>
#include <string.h>
//
/* This function will be used as button callback */
void note() {
  fprintf(_stderr, "Clicked\n");
}
//
int main(int argc, char *argv[]) {
  QApplication app = QApplication(argc, argv);
  QWidget *top =  new QWidget();
  QPushButton *b1 = new QPushButton("Push me", (QWidget*)top);
  QPushButton *b2 = new QPushButton("Push me", (QWidget*)top);
  ButtonCallbacks handler = ButtonCallbacks();
  handler.setCallback_pressed(note);
  QObject::connect(b1, SIGNAL(pressed()), &handler, SLOT(pressed()));
  ((QWidget*)b2)->move(100,50);
  app.setMainWidget((QWidget*)top);
  top->show();
  return app.exec();
}

Copyright 2006 Roman Putanowicz

Email: putanowr at twins.pk.edu.pl

Last Modified: Thu, 06 Jul 2006 13:08:00 CEST

Made with PubTal 3.1.3