All pastes #199240 Raw Edit

Miscellany

public text v1 · immutable
#199240 ·published 2006-10-12 12:19 UTC
rendered paste body
program nowidget;

uses qt4;

const
  METHOD = '0';
  SLOT = '1';
  SIGNAL = '2';
var
  App: QApplicationH;
  Button: QPushButtonH;
  Str: WideString;
  Font: QFontH;
  MainWindow: QWidgetH;
  Notebook: QTabWidgetH;
  Page: QWidgetH;
begin
  App := QApplication_Create(@argc,argv);

  MainWindow := QWidget_Create;

  QWidget_setGeometry(MainWindow, 300, 300, 300, 300);

  Notebook := QTabWidget_create(MainWindow);

  QWidget_setGeometry(Notebook, 50, 50, 200, 200);

  Page := QWidget_create(MainWindow);
  
  Str := 'MyFirstPage';

  QTabWidget_insertTab(Notebook, 0, Page, @Str);

  Str := 'Quit';
  Button := QPushButton_create(@Str, Page);

  QWidget_setGeometry(Button, 50, 50, 100, 30);

  QObject_connect(Button, '2clicked()', App, '1quit()',  QtAutoConnection);

  QWidget_show(MainWindow);

  QApplication_Exec;
end.