public static void main(String [] args) { TDECmdLineArgs.init( args , "", "", "", "version"); TDEApplication app = new TDEApplication(); TQApplication app = new TQApplication(args); myWidget = new (); app.setMainWidget( myWidget ); myWidget.show(); app.exec(); } /** * decodePixmap extracts a pixmap from coded data * @param size of uncompressed data * @param code string coded data * @param isCompressed need data to be uncompressed */ private static TQPixmap decodePixmap(int size, String code, boolean isCompressed) { int len = code.length() >> 1; byte [] data = new byte[len]; try { for (int i=0, j=0 ; i < len; ++i, j+=2) { data[i] = (byte)Short.parseShort(code.substring(j, j+2), 16); } if (isCompressed) { byte [] pic = new byte [size]; Inflater inflater = new Inflater(); pic = new byte [size]; inflater.setInput(data); inflater.inflate(pic, 0, size); return new TQPixmap(pic); } else { return new TQPixmap(data); } } catch (Exception e) { System.err.println("Problem, while reading image data: "+e.getMessage()); } return null; } /** * polish does some last initialization just before the widget * is displayed. Here we setup: * i) databases * ... */ public void polish() { if ( != null ) { TQSqlCursor cursor = .sqlCursor(); if ( cursor == null ) { cursor = new TQSqlCursor( "" ); cursor = new TQSqlCursor( "", true, TQSqlDatabase.database("") ); if ( .isReadOnly() ) cursor.setMode( TQSqlCursor.ReadOnly ); .setSqlCursor( cursor, false, true ); } if ( !cursor.isActive() ) .refresh( TQDataTable.RefreshAll ); } if ( != null ) { if ( .sqlCursor() == null ) { TQSqlCursor cursor = new TQSqlCursor( "" ); TQSqlCursor cursor = new TQSqlCursor( "", true, TQSqlDatabase.database("") ); .setSqlCursor( cursor, true ); .refresh(); .first(); } } super.polish(); } /** * TQ_SLOT * languageChange sets the strings according to current language */ protected void languageChange() { .header().setLabel( , ( " " ) ); .clear(); .header() .horizontalHeader() .setLabel( , ( " " ) ); .verticalHeader().setLabel( ( " " ) ); .findItem( ) if ( != null) .setText( ( " " ) ); }