#!/usr/bin/env ruby require "qte" require "qpe" include Qte include Qpe class SampleWindow < QMainWindow def initialize() super() setCaption(tr("サンプル")) @msg = QLabel.new(tr("これはサンプルプログラム"),self) @msg.setGeometry(10,10,300,30) @tw = QTabWidget.new( self ) @tw.setGeometry(10,50,620,400) @w0 = QWidget.new( self ) #ウィジェット0作成 @w1 = QWidget.new( self ) #ウィジェット1作成 @tw.addTab( @w0, tr("ウィジェット0") ) #タブに追加 @tw.addTab( @w1, tr("ウィジェット1") ) # @tw.showPage( @w1 ) #ウィジェット1を表示 #ウィジェット0上の配置 @msg0 = QLabel.new(tr("ウィジェット0のエリア"), @w0) @msg0.setGeometry(10,10,300,100) #ウィジェット1上の配置 @msg1 = QLabel.new(tr("ウィジェット1\nのエリア"), @w1) @msg1.setGeometry(10,10,300,100) end end $defaultCodec = QTextCodec.codecForName("utf8") app = QPEApplication.new([$0]+ARGV) app.setDefaultCodec($defaultCodec) QApplication.setFont(QFont.new("lcfont",18)) app.showMainWidget(SampleWindow.new) app.exec