diff options
Diffstat (limited to 'qtjava/javalib/examples/widgets/WidgetView.java')
-rw-r--r-- | qtjava/javalib/examples/widgets/WidgetView.java | 372 |
1 files changed, 186 insertions, 186 deletions
diff --git a/qtjava/javalib/examples/widgets/WidgetView.java b/qtjava/javalib/examples/widgets/WidgetView.java index d000ce8b..2907f49c 100644 --- a/qtjava/javalib/examples/widgets/WidgetView.java +++ b/qtjava/javalib/examples/widgets/WidgetView.java @@ -15,23 +15,23 @@ import org.kde.qt.*; -class WidgetView extends QMainWindow +class WidgetView extends TQMainWindow { private String MOVIEFILENAME = "trolltech.gif"; -private QLabel msg; -private QCheckBox cb[] = new QCheckBox[3]; -private QGroupBox bg; -private QLabel movielabel; -private QMovie movie; -private QWidget central; -private QProgressBar prog; +private TQLabel msg; +private TQCheckBox cb[] = new TQCheckBox[3]; +private TQGroupBox bg; +private TQLabel movielabel; +private TQMovie movie; +private TQWidget central; +private TQProgressBar prog; private int progress; -private QTabWidget tabs; -private QMultiLineEdit edit; -private QPopupMenu textStylePopup; +private TQTabWidget tabs; +private TQMultiLineEdit edit; +private TQPopupMenu textStylePopup; private int plainStyleID; -private QWidget bla; +private TQWidget bla; private AnalogClock aclock; private DigitalClock dclock; @@ -110,23 +110,23 @@ static String[] fileprint = { -class MyListView extends QListView +class MyListView extends TQListView { -public MyListView( QWidget parent ) +public MyListView( TQWidget parent ) { this(parent, null); } -public MyListView( QWidget parent, String name ) +public MyListView( TQWidget parent, String name ) { super( parent, name ); selected = null; } -protected void contentsMousePressEvent( QMouseEvent e ) +protected void contentsMousePressEvent( TQMouseEvent e ) { selected = selectedItem(); // super.contentsMousePressEvent( e ); } -protected void contentsMouseReleaseEvent( QMouseEvent e ) +protected void contentsMouseReleaseEvent( TQMouseEvent e ) { // super.contentsMouseReleaseEvent( e ); if ( selectedItem() != selected ) { @@ -135,7 +135,7 @@ protected void contentsMouseReleaseEvent( QMouseEvent e ) } } -private QListViewItem selected; +private TQListViewItem selected; } // // WidgetView contains lots of Qt widgets. @@ -150,38 +150,38 @@ private QListViewItem selected; /* -class MyWhatsThis extends QWhatsThis +class MyWhatsThis extends TQWhatsThis { -public MyWhatsThis( QListBox lb) +public MyWhatsThis( TQListBox lb) { super( lb ); listbox = lb; } -public String text( QPoint p) { - QListBoxItem i = listbox.itemAt( p ); +public String text( TQPoint p) { + TQListBoxItem i = listbox.itemAt( p ); if ( i != null && i.pixmap() != null ) { return "Isn't that a <em>wonderful</em> pixmap? <br>" + "Imagine, you could even decorate a" + " <b>red</b> pushbutton with it! :-)"; } - return "This is a QListBox."; + return "This is a TQListBox."; } -private QListBox listbox; +private TQListBox listbox; } -class MyMenuItem extends QCustomMenuItem +class MyMenuItem extends TQCustomMenuItem { -public MyMenuItem( String s, QFont f ) +public MyMenuItem( String s, TQFont f ) { string = s; font = f; } - public void paint( QPainter p, QColorGroup cg, boolean act, + public void paint( TQPainter p, TQColorGroup cg, boolean act, boolean enabled, int x, int y, int w, int h ) { p.setFont ( font ); @@ -190,13 +190,13 @@ public MyMenuItem( String s, QFont f ) string ); } - public QSize sizeHint() + public TQSize sizeHint() { - return QFontMetrics( font ).size( AlignAuto | AlignVCenter | + return TQFontMetrics( font ).size( AlignAuto | AlignVCenter | ShowPrefix | DontClip, string ); } private String string; -private QFont font; +private TQFont font; } */ @@ -205,40 +205,40 @@ private QFont font; // Construct the WidgetView with children // -WidgetView( QWidget parent, String name ) +WidgetView( TQWidget parent, String name ) { super( parent, name ); - QColor col = new QColor(); + TQColor col = new TQColor(); // Set the window caption/title setCaption( "Qt Example - Widgets Demo Application" ); // create a toolbar - QToolBar tools = new QToolBar( this, "toolbar" ); + TQToolBar tools = new TQToolBar( this, "toolbar" ); // put something in it - QPixmap openIcon = new QPixmap( fileopen ); - QToolButton toolb = new QToolButton( new QIconSet(openIcon), "toolbutton 1", + TQPixmap openIcon = new TQPixmap( fileopen ); + TQToolButton toolb = new TQToolButton( new TQIconSet(openIcon), "toolbutton 1", "", this, SLOT("open()"), tools, "open file" ); - QWhatsThis.add( toolb, "This is a <b>QToolButton</b>. It lives in a " - + "QToolBar. This particular button doesn't do anything " + TQWhatsThis.add( toolb, "This is a <b>TQToolButton</b>. It lives in a " + + "TQToolBar. This particular button doesn't do anything " + "useful." ); - QPixmap saveIcon = new QPixmap( filesave ); - toolb = new QToolButton( new QIconSet(saveIcon), "toolbutton 2", "", + TQPixmap saveIcon = new TQPixmap( filesave ); + toolb = new TQToolButton( new TQIconSet(saveIcon), "toolbutton 2", "", this, SLOT("dummy()"), tools, "save file" ); - QWhatsThis.add( toolb, "This is also a <b>QToolButton</b>." ); + TQWhatsThis.add( toolb, "This is also a <b>TQToolButton</b>." ); - QPixmap printIcon = new QPixmap( fileprint ); - toolb = new QToolButton( new QIconSet(printIcon), "toolbutton 3", "", + TQPixmap printIcon = new TQPixmap( fileprint ); + toolb = new TQToolButton( new TQIconSet(printIcon), "toolbutton 3", "", this, SLOT("dummy()"), tools, "print file" ); - QWhatsThis.add( toolb, "This is the third <b>QToolButton</b>."); + TQWhatsThis.add( toolb, "This is the third <b>TQToolButton</b>."); - toolb = QWhatsThis.whatsThisButton( tools ); - QWhatsThis.add( toolb, "This is a <b>What's This</b> button " + toolb = TQWhatsThis.whatsThisButton( tools ); + TQWhatsThis.add( toolb, "This is a <b>What's This</b> button " + "It enables the user to ask for help " + "about widgets on the screen."); @@ -246,51 +246,51 @@ WidgetView( QWidget parent, String name ) qApp().installEventFilter( this ); //make a central widget to contain the other widgets - central = new QWidget( this ); + central = new TQWidget( this ); setCentralWidget( central ); // Create a layout to position the widgets - QHBoxLayout topLayout = new QHBoxLayout( central, 10 ); + TQHBoxLayout topLayout = new TQHBoxLayout( central, 10 ); // Create a grid layout to hold most of the widgets - QGridLayout grid = new QGridLayout( 0, 3 ); //3 wide and autodetect number of rows + TQGridLayout grid = new TQGridLayout( 0, 3 ); //3 wide and autodetect number of rows topLayout.addLayout( grid, 1 ); // Create an easter egg - QToolTip.add( menuBar(), new QRect( 0, 0, 2, 2 ), "easter egg" ); + TQToolTip.add( menuBar(), new TQRect( 0, 0, 2, 2 ), "easter egg" ); - QPopupMenu popup; - popup = new QPopupMenu( this ); + TQPopupMenu popup; + popup = new TQPopupMenu( this ); menuBar().insertItem( "&File", popup ); int id; id = popup.insertItem( "&New" ); popup.setItemEnabled( id, false ); - id = popup.insertItem( new QIconSet(openIcon), "&Open", this, SLOT(" open()") ); + id = popup.insertItem( new TQIconSet(openIcon), "&Open", this, SLOT(" open()") ); popup.insertSeparator(); - popup.insertItem( "&Quit", qApp(), SLOT("quit()"), new QKeySequence(CTRL+Key_Q) ); + popup.insertItem( "&Quit", qApp(), SLOT("quit()"), new TQKeySequence(CTRL+Key_Q) ); - textStylePopup = popup = new QPopupMenu( this ); + textStylePopup = popup = new TQPopupMenu( this ); menuBar().insertItem( "&Edit", popup ); plainStyleID = id = popup.insertItem( "&Plain" ); - popup.setAccel( new QKeySequence(CTRL+Key_T), id ); + popup.setAccel( new TQKeySequence(CTRL+Key_T), id ); popup.insertSeparator(); -/* QFont f = font(); +/* TQFont f = font(); f.setBold( true ); id = popup.insertItem( new MyMenuItem( "&Bold", f ) ); - popup.setAccel( new QKeySequence(CTRL+Key_B), id ); + popup.setAccel( new TQKeySequence(CTRL+Key_B), id ); f = font(); f.setItalic( true ); id = popup.insertItem( new MyMenuItem( "&Italic", f ) ); popup.setItemChecked( id, true ); - popup.setAccel( new QKeySequence(CTRL+Key_I), id ); + popup.setAccel( new TQKeySequence(CTRL+Key_I), id ); f = font(); f.setUnderline( true ); id = popup.insertItem( new MyMenuItem( "&Underline", f ) ); - popup.setAccel( new QKeySequence(CTRL+Key_U), id ); + popup.setAccel( new TQKeySequence(CTRL+Key_U), id ); f = font(); f.setStrikeOut( true ); id = popup.insertItem( new MyMenuItem( "&Strike", f ) ); @@ -307,101 +307,101 @@ WidgetView( QWidget parent, String name ) // Give the dclock widget a blue palette col.setRgb( 0xaa, 0xbe, 0xff ); - dclock.setPalette( new QPalette( col ) ); + dclock.setPalette( new TQPalette( col ) ); // make tool tips for both of them - QToolTip.add( aclock, "custom widget: analog clock" ); - QToolTip.add( dclock, "custom widget: digital clock" ); + TQToolTip.add( aclock, "custom widget: analog clock" ); + TQToolTip.add( dclock, "custom widget: digital clock" ); // Create a push button. - QPushButton pb; - pb = new QPushButton( "&Push button 1", central, "button1" ); + TQPushButton pb; + pb = new TQPushButton( "&Push button 1", central, "button1" ); grid.addWidget( pb, 0, 0, AlignVCenter ); connect( pb, SIGNAL("clicked()"), SLOT("button1Clicked()") ); - QToolTip.add( pb, "push button 1" ); - QWhatsThis.add( pb, "This is a <b>QPushButton</b>.<br>" + TQToolTip.add( pb, "push button 1" ); + TQWhatsThis.add( pb, "This is a <b>TQPushButton</b>.<br>" + "Click it and watch...<br>" + "The wonders of modern technology."); - QPixmap pm = new QPixmap(); + TQPixmap pm = new TQPixmap(); boolean pix = pm.load("qt.png"); if ( !pix ) { - QMessageBox.information( null, "Qt Widgets Example", + TQMessageBox.information( null, "Qt Widgets Example", "Could not load the file \"qt.png\", which\n" + "contains an icon used...\n\n" + "The text \"line 42\" will be substituted.", - QMessageBox.Ok + QMessageBox.Default ); + TQMessageBox.Ok + TQMessageBox.Default ); } - // Create a label containing a QMovie - movie = new QMovie( MOVIEFILENAME ); - movielabel = new QLabel( central, "label0" ); + // Create a label containing a TQMovie + movie = new TQMovie( MOVIEFILENAME ); + movielabel = new TQLabel( central, "label0" ); movie.connectStatus(this, SLOT("movieStatus(int)")); - movie.connectUpdate(this, SLOT("movieUpdate(QRect)")); - movielabel.setFrameStyle( QFrame.Box | QFrame.Plain ); + movie.connectUpdate(this, SLOT("movieUpdate(TQRect)")); + movielabel.setFrameStyle( TQFrame.Box | TQFrame.Plain ); movielabel.setMovie( movie ); movielabel.setFixedSize( 128+movielabel.frameWidth()*2, 64+movielabel.frameWidth()*2 ); grid.addWidget( movielabel, 0, 1, AlignCenter ); - QToolTip.add( movielabel, "movie" ); - QWhatsThis.add( movielabel, "This is a <b>QLabel</b> " - + "that contains a QMovie." ); + TQToolTip.add( movielabel, "movie" ); + TQWhatsThis.add( movielabel, "This is a <b>TQLabel</b> " + + "that contains a TQMovie." ); // Create a group of check boxes - bg = new QButtonGroup( central, "checkGroup" ); + bg = new TQButtonGroup( central, "checkGroup" ); bg.setTitle( "Check Boxes" ); grid.addWidget( bg, 1, 0 ); // Create a layout for the check boxes - QVBoxLayout vbox = new QVBoxLayout(bg, 10); + TQVBoxLayout vbox = new TQVBoxLayout(bg, 10); vbox.addSpacing( bg.fontMetrics().height() ); - cb[0] = new QCheckBox( bg ); + cb[0] = new TQCheckBox( bg ); cb[0].setText( "&Read" ); vbox.addWidget( cb[0] ); - cb[1] = new QCheckBox( bg ); + cb[1] = new TQCheckBox( bg ); cb[1].setText( "&Write" ); vbox.addWidget( cb[1] ); - cb[2] = new QCheckBox( bg ); + cb[2] = new TQCheckBox( bg ); cb[2].setText( "&Execute" ); vbox.addWidget( cb[2] ); connect( bg, SIGNAL("clicked(int)"), SLOT("checkBoxClicked(int)") ); - QToolTip.add( cb[0], "check box 1" ); - QToolTip.add( cb[1], "check box 2" ); - QToolTip.add( cb[2], "check box 3" ); + TQToolTip.add( cb[0], "check box 1" ); + TQToolTip.add( cb[1], "check box 2" ); + TQToolTip.add( cb[2], "check box 3" ); // Create a group of radio buttons - QRadioButton rb; - bg = new QButtonGroup( central, "radioGroup" ); + TQRadioButton rb; + bg = new TQButtonGroup( central, "radioGroup" ); bg.setTitle( "Radio buttons" ); grid.addWidget( bg, 1, 1 ); // Create a layout for the radio buttons - vbox = new QVBoxLayout(bg, 10); + vbox = new TQVBoxLayout(bg, 10); vbox.addSpacing( bg.fontMetrics().height() ); - rb = new QRadioButton( bg ); + rb = new TQRadioButton( bg ); rb.setText( "&AM" ); rb.setChecked( true ); vbox.addWidget(rb); - QToolTip.add( rb, "radio button 1" ); - rb = new QRadioButton( bg ); + TQToolTip.add( rb, "radio button 1" ); + rb = new TQRadioButton( bg ); rb.setText( "F&M" ); vbox.addWidget(rb); - QToolTip.add( rb, "radio button 2" ); - rb = new QRadioButton( bg ); + TQToolTip.add( rb, "radio button 2" ); + rb = new TQRadioButton( bg ); rb.setText( "&Short Wave" ); vbox.addWidget(rb); connect( bg, SIGNAL("clicked(int)"), SLOT("radioButtonClicked(int)") ); - QToolTip.add( rb, "radio button 3" ); + TQToolTip.add( rb, "radio button 3" ); // Create a list box - QListBox lb = new QListBox( central, "listBox" ); + TQListBox lb = new TQListBox( central, "listBox" ); for ( int i=0; i<100; i++ ) { // fill list box String str = "line " + i; if ( i == 42 && pix ) @@ -411,27 +411,27 @@ WidgetView( QWidget parent, String name ) } grid.addMultiCellWidget( lb, 2, 4, 0, 0 ); connect( lb, SIGNAL("selected(int)"), SLOT("listBoxItemSelected(int)") ); - QToolTip.add( lb, "list box" ); + TQToolTip.add( lb, "list box" ); // new MyWhatsThis( lb ); - vbox = new QVBoxLayout(8); + vbox = new TQVBoxLayout(8); grid.addLayout( vbox, 2, 1 ); // Create a slider - QSlider sb = new QSlider( 0, 300, 30, 100, QSlider.Horizontal, + TQSlider sb = new TQSlider( 0, 300, 30, 100, TQSlider.Horizontal, central, "Slider" ); - sb.setTickmarks( QSlider.Below ); + sb.setTickmarks( TQSlider.Below ); sb.setTickInterval( 10 ); - sb.setFocusPolicy( QWidget.TabFocus ); + sb.setFocusPolicy( TQWidget.TabFocus ); vbox.addWidget( sb ); connect( sb, SIGNAL("valueChanged(int)"), SLOT("sliderValueChanged(int)") ); - QToolTip.add( sb, "slider" ); - QWhatsThis.add( sb, "This is a <b>QSlider</b>. " + TQToolTip.add( sb, "slider" ); + TQWhatsThis.add( sb, "This is a <b>TQSlider</b>. " + "The tick marks are optional." + " This slider controls the speed of the movie." ); // Create a combo box - QComboBox combo = new QComboBox( false, central, "comboBox" ); + TQComboBox combo = new TQComboBox( false, central, "comboBox" ); combo.insertItem( "darkBlue" ); combo.insertItem( "darkRed" ); combo.insertItem( "darkGreen" ); @@ -440,10 +440,10 @@ WidgetView( QWidget parent, String name ) vbox.addWidget( combo ); connect( combo, SIGNAL("activated(int)"), this, SLOT("comboBoxItemActivated(int)") ); - QToolTip.add( combo, "read-only combo box" ); + TQToolTip.add( combo, "read-only combo box" ); // Create an editable combo box - QComboBox edCombo = new QComboBox( true, central, "edComboBox" ); + TQComboBox edCombo = new TQComboBox( true, central, "edComboBox" ); edCombo.insertItem( "Permutable" ); edCombo.insertItem( "Malleable" ); edCombo.insertItem( "Adaptable" ); @@ -452,21 +452,21 @@ WidgetView( QWidget parent, String name ) vbox.addWidget( edCombo ); connect( edCombo, SIGNAL("activated(String)"), this, SLOT("edComboBoxItemActivated(String)") ); - QToolTip.add( edCombo, "editable combo box" ); + TQToolTip.add( edCombo, "editable combo box" ); edCombo.setAutoCompletion( true ); - vbox = new QVBoxLayout(8); + vbox = new TQVBoxLayout(8); grid.addLayout( vbox, 2, 2 ); // Create a spin box - QSpinBox spin = new QSpinBox( 0, 10, 1, central, "spin" ); + TQSpinBox spin = new TQSpinBox( 0, 10, 1, central, "spin" ); spin.setSuffix(" mm"); spin.setSpecialValueText( "Auto" ); connect( spin, SIGNAL(" valueChanged(String)"), SLOT(" spinBoxValueChanged(String)") ); - QToolTip.add( spin, "spin box" ); - QWhatsThis.add( spin, "This is a <b>QSpinBox</b>. " + TQToolTip.add( spin, "spin box" ); + TQWhatsThis.add( spin, "This is a <b>TQSpinBox</b>. " + "You can chose values in a given range " + "either by using the arrow buttons " + "or by typing them in." ); @@ -475,22 +475,22 @@ WidgetView( QWidget parent, String name ) vbox.addStretch( 1 ); // Create a tabwidget that switches between multi line edits - tabs = new QTabWidget( central ); - //tabs.setTabPosition( QTabWidget.Bottom ); + tabs = new TQTabWidget( central ); + //tabs.setTabPosition( TQTabWidget.Bottom ); tabs.setMargin( 4 ); grid.addMultiCellWidget( tabs, 3, 3, 1, 2 ); - QMultiLineEdit mle = new QMultiLineEdit( tabs, "multiLineEdit" ); + TQMultiLineEdit mle = new TQMultiLineEdit( tabs, "multiLineEdit" ); edit = mle; - mle.setWordWrap( QMultiLineEdit.WidgetWidth ); - mle.setText("This is a QMultiLineEdit widget, " + mle.setWordWrap( TQMultiLineEdit.WidgetWidth ); + mle.setText("This is a TQMultiLineEdit widget, " + "useful for small multi-line " + "input fields."); - QToolTip.add( mle, "multi line editor" ); + TQToolTip.add( mle, "multi line editor" ); tabs.addTab( mle, "F&irst"); - mle = new QMultiLineEdit( tabs, "multiLineEdit" ); - String mleText = "This is another QMultiLineEdit widget."; + mle = new TQMultiLineEdit( tabs, "multiLineEdit" ); + String mleText = "This is another TQMultiLineEdit widget."; mleText += "\n"; mleText += "Japanese: "; mleText += (char) 0x6a38; // Kanji @@ -502,22 +502,22 @@ WidgetView( QWidget parent, String name ) mleText += (char) 0x00d8; // Norwegian mleText += "\n"; mleText += "Unicode (black square):"; - mleText += (char) 0x25A0; // BLACK SQUARE + mleText += (char) 0x25A0; // BLACK STQUARE mleText += "\n"; mle.setText( mleText ); - QToolTip.add( mle, "second multi line editor" ); + TQToolTip.add( mle, "second multi line editor" ); tabs.addTab( mle, "Se&cond"); // Create a single line edit - QLineEdit le = new QLineEdit( central, "lineEdit" ); + TQLineEdit le = new TQLineEdit( central, "lineEdit" ); grid.addMultiCellWidget( le, 4, 4, 1, 2 ); connect( le, SIGNAL("textChanged(String)"), SLOT("lineEditTextChanged(String)") ); - QToolTip.add( le, "single line editor" ); - QWhatsThis.add( le, "This is a <b>QLineEdit</b>, you can enter a " + TQToolTip.add( le, "single line editor" ); + TQWhatsThis.add( le, "This is a <b>TQLineEdit</b>, you can enter a " + "single line of text in it. " + "It also it accepts text drops." ); @@ -532,85 +532,85 @@ WidgetView( QWidget parent, String name ) grid.setColStretch(2,1); - QSplitter split = new QSplitter( Vertical, central, "splitter" ); + TQSplitter split = new TQSplitter( Vertical, central, "splitter" ); split.setOpaqueResize( true ); topLayout.addWidget( split, 1 ); - QListView lv = new MyListView( split ); + TQListView lv = new MyListView( split ); connect(lv, SIGNAL("selectionChanged()"), this, SLOT(" selectionChanged()") ); - connect(lv, SIGNAL("selectionChanged(QListViewItem)"), - this, SLOT(" selectionChanged(QListViewItem)") ); - connect(lv, SIGNAL("clicked(QListViewItem)"), - this, SLOT(" clicked(QListViewItem)") ); - connect(lv, SIGNAL("mySelectionChanged(QListViewItem)"), - this, SLOT(" mySelectionChanged(QListViewItem)") ); + connect(lv, SIGNAL("selectionChanged(TQListViewItem)"), + this, SLOT(" selectionChanged(TQListViewItem)") ); + connect(lv, SIGNAL("clicked(TQListViewItem)"), + this, SLOT(" clicked(TQListViewItem)") ); + connect(lv, SIGNAL("mySelectionChanged(TQListViewItem)"), + this, SLOT(" mySelectionChanged(TQListViewItem)") ); lv.addColumn( "One" ); lv.addColumn( "Two" ); lv.setAllColumnsShowFocus( true ); - QListViewItem lvi= new QListViewItem( lv, "Text", "Text" ); - lvi= new QListViewItem( lv, "Text", "Other Text" ); - lvi= new QListViewItem( lv, "Text", "More Text" ); - lvi= new QListViewItem( lv, "Text", "Extra Text" ); + TQListViewItem lvi= new TQListViewItem( lv, "Text", "Text" ); + lvi= new TQListViewItem( lv, "Text", "Other Text" ); + lvi= new TQListViewItem( lv, "Text", "More Text" ); + lvi= new TQListViewItem( lv, "Text", "Extra Text" ); lvi.setOpen(true); - new QListViewItem( lvi, "SubText", "Additional Text" ); - lvi= new QListViewItem( lvi, "SubText", "Side Text" ); - lvi= new QListViewItem( lvi, "SubSubText", "Complimentary Text" ); + new TQListViewItem( lvi, "SubText", "Additional Text" ); + lvi= new TQListViewItem( lvi, "SubText", "Side Text" ); + lvi= new TQListViewItem( lvi, "SubSubText", "Complimentary Text" ); - QToolTip.add( lv, "list view" ); - QWhatsThis.add( lv, "This is a <b>QListView</b>, you can display lists " + TQToolTip.add( lv, "list view" ); + TQWhatsThis.add( lv, "This is a <b>TQListView</b>, you can display lists " + "(or outline lists) of multiple-column data in it." ); - lv = new QListView( split ); + lv = new TQListView( split ); lv.addColumn( "Choices" ); - new QCheckListItem( lv, "Onion", QCheckListItem.CheckBox ); - new QCheckListItem( lv, "Artichoke", QCheckListItem.CheckBox ); - new QCheckListItem( lv, "Pepper", QCheckListItem.CheckBox ); - new QCheckListItem( lv, "Habaneros", QCheckListItem.CheckBox ); - new QCheckListItem( lv, "Pineapple", QCheckListItem.CheckBox ); - new QCheckListItem( lv, "Ham", QCheckListItem.CheckBox ); - new QCheckListItem( lv, "Pepperoni", QCheckListItem.CheckBox ); - new QCheckListItem( lv, "Garlic", QCheckListItem.CheckBox ); + new TQCheckListItem( lv, "Onion", TQCheckListItem.CheckBox ); + new TQCheckListItem( lv, "Artichoke", TQCheckListItem.CheckBox ); + new TQCheckListItem( lv, "Pepper", TQCheckListItem.CheckBox ); + new TQCheckListItem( lv, "Habaneros", TQCheckListItem.CheckBox ); + new TQCheckListItem( lv, "Pineapple", TQCheckListItem.CheckBox ); + new TQCheckListItem( lv, "Ham", TQCheckListItem.CheckBox ); + new TQCheckListItem( lv, "Pepperoni", TQCheckListItem.CheckBox ); + new TQCheckListItem( lv, "Garlic", TQCheckListItem.CheckBox ); - QCheckListItem lit = new QCheckListItem( lv, "Cheese" ); + TQCheckListItem lit = new TQCheckListItem( lv, "Cheese" ); lit.setOpen( true ); - new QCheckListItem( lit, "Cheddar", QCheckListItem.RadioButton ); - new QCheckListItem( lit, "Mozarella", QCheckListItem.RadioButton ); - new QCheckListItem( lit, "Jarlsberg", QCheckListItem.RadioButton ); + new TQCheckListItem( lit, "Cheddar", TQCheckListItem.RadioButton ); + new TQCheckListItem( lit, "Mozarella", TQCheckListItem.RadioButton ); + new TQCheckListItem( lit, "Jarlsberg", TQCheckListItem.RadioButton ); - QToolTip.add( lv, "list view" ); - QWhatsThis.add( lv, "This is also a <b>QListView</b>, with " + TQToolTip.add( lv, "list view" ); + TQWhatsThis.add( lv, "This is also a <b>TQListView</b>, with " + "interactive items." ); - QTextView qmlv = new QTextView( "<hr><h1>QTextView</h1>" + TQTextView qmlv = new TQTextView( "<hr><h1>TQTextView</h1>" + "<p>Qt supports formatted rich text, such " + "as the heading above, <em>emphasized</em> and " + "<b>bold</b> text, via an XML subset.</p> " + "<p>Style sheets are supported.</p>", "", split ); - qmlv.setFont(new QFont("Charter",11)); - qmlv.setFrameStyle( QFrame.WinPanel | QFrame.Sunken ); + qmlv.setFont(new TQFont("Charter",11)); + qmlv.setFrameStyle( TQFrame.WinPanel | TQFrame.Sunken ); // Create an label and a message in the status bar // The message is updated when buttons are clicked etc. - msg = new QLabel( statusBar(), "message" ); + msg = new TQLabel( statusBar(), "message" ); msg.setAlignment( AlignCenter ); - QFont boldfont = new QFont(); boldfont.setWeight(QFont.Bold); + TQFont boldfont = new TQFont(); boldfont.setWeight(TQFont.Bold); msg.setFont( boldfont ); statusBar().addWidget( msg, 4 ); - QToolTip.add( msg, "Message area" ); + TQToolTip.add( msg, "Message area" ); - QAccel a = new QAccel( this ); - a.connectItem( a.insertItem( new QKeySequence(Key_F9) ), + TQAccel a = new TQAccel( this ); + a.connectItem( a.insertItem( new TQKeySequence(Key_F9) ), this, SLOT(" showProperties()") ); - prog = new QProgressBar( statusBar(), "progress" ); + prog = new TQProgressBar( statusBar(), "progress" ); prog.setTotalSteps( 100 ); progress = 64; prog.setProgress( progress ); statusBar().addWidget( prog , 1 ); - QWhatsThis.add( prog, "This is a <b>QProgressBar</b> " + TQWhatsThis.add( prog, "This is a <b>TQProgressBar</b> " + "You can use it to show that a lengthy " + " process is progressing. " + "In this program, nothing much seems to happen." ); @@ -629,7 +629,7 @@ void button1Clicked() } -void movieUpdate( QRect r ) +void movieUpdate( TQRect r ) { // Uncomment this to test animated icons on your window manager //setIcon( movie.framePixmap() ); @@ -638,10 +638,10 @@ void movieUpdate( QRect r ) void movieStatus( int s ) { switch ( s ) { - case QMovie.SourceEmpty: - case QMovie.UnrecognizedFormat: + case TQMovie.SourceEmpty: + case TQMovie.UnrecognizedFormat: { - QPixmap pm = new QPixmap("tt-logo.png"); + TQPixmap pm = new TQPixmap("tt-logo.png"); movielabel.setPixmap(pm); movielabel.setFixedSize(pm.size()); } @@ -710,19 +710,19 @@ void comboBoxItemActivated( int index ) switch ( index ) { default: case 0: - QApplication.setWinStyleHighlightColor( darkBlue() ); + TQApplication.setWinStyleHighlightColor( darkBlue() ); break; case 1: - QApplication.setWinStyleHighlightColor( darkRed() ); + TQApplication.setWinStyleHighlightColor( darkRed() ); break; case 2: - QApplication.setWinStyleHighlightColor( darkGreen() ); + TQApplication.setWinStyleHighlightColor( darkGreen() ); break; case 3: - QApplication.setWinStyleHighlightColor( blue() ); + TQApplication.setWinStyleHighlightColor( blue() ); break; case 4: - QApplication.setWinStyleHighlightColor( red() ); + TQApplication.setWinStyleHighlightColor( red() ); break; } } @@ -757,12 +757,12 @@ void spinBoxValueChanged( String valueText ) static boolean identify_now = true; -public boolean eventFilter( QObject obj, QEvent event ) +public boolean eventFilter( TQObject obj, TQEvent event ) { - if ( event.type() == QEvent.MouseButtonPress && event instanceof QMouseEvent && identify_now ) { - QMouseEvent e = (QMouseEvent)event; - if ( e.button() == QMouseEvent.RightButton && - (e.state() & QMouseEvent.ControlButton) != 0 ){ + if ( event.type() == TQEvent.MouseButtonPress && event instanceof TQMouseEvent && identify_now ) { + TQMouseEvent e = (TQMouseEvent)event; + if ( e.button() == TQMouseEvent.RightButton && + (e.state() & TQMouseEvent.ControlButton) != 0 ){ String str = "The clicked widget is a\n"; str += obj.className(); str += "\nThe widget's name is\n"; @@ -771,7 +771,7 @@ public boolean eventFilter( QObject obj, QEvent event ) else str += "<no name>"; identify_now = false; // don't do it in message box - QMessageBox.information( (QWidget)obj, "Identify Widget", str ); + TQMessageBox.information( (TQWidget)obj, "Identify Widget", str ); identify_now = true; // allow it again } } @@ -782,13 +782,13 @@ public boolean eventFilter( QObject obj, QEvent event ) void open() { - QFileDialog.getOpenFileName( "", "Textfiles (.txt)", this ); + TQFileDialog.getOpenFileName( "", "Textfiles (.txt)", this ); } void dummy() { - QMessageBox.information( this, "Sorry", + TQMessageBox.information( this, "Sorry", "This function is not implemented" ); } @@ -796,17 +796,17 @@ void selectionChanged() { //qDebug("selectionChanged"); } -void selectionChanged( QListViewItem item) +void selectionChanged( TQListViewItem item) { //qDebug("selectionChanged %p", item ); } -void clicked( QListViewItem item ) +void clicked( TQListViewItem item ) { //qDebug("clicked %p", item ); } -void mySelectionChanged( QListViewItem item ) +void mySelectionChanged( TQListViewItem item ) { //qDebug("mySelectionChanged %p", item ); } @@ -818,7 +818,7 @@ void showProperties() String output = "Properties for class '" + qApp().focusWidget().className() + "'"; int i = 0; while( i < (int) qApp().focusWidget().metaObject().numProperties( true ) ) { - QMetaProperty p + TQMetaProperty p = qApp().focusWidget().metaObject().property( i, true ); String tmp = "\n " + (++i) + ": " + p.name() + " (read-" + (p.writable() ? "write" : "only") + ", " + p.type() + ")"; |