diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
commit | 479f5f799523bffbcc83dff581a2299c047c6fff (patch) | |
tree | 186aae707ed02aac6c7cab2fb14e97f72aca5e36 /qtsharp/src/examples/samples/mandelbrot2.cs | |
parent | f1dbff6145c98324ff82e34448b7483727e8ace4 (diff) | |
download | tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.tar.gz tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'qtsharp/src/examples/samples/mandelbrot2.cs')
-rw-r--r-- | qtsharp/src/examples/samples/mandelbrot2.cs | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/qtsharp/src/examples/samples/mandelbrot2.cs b/qtsharp/src/examples/samples/mandelbrot2.cs index bcb0a360..2b83579e 100644 --- a/qtsharp/src/examples/samples/mandelbrot2.cs +++ b/qtsharp/src/examples/samples/mandelbrot2.cs @@ -108,7 +108,7 @@ public class Mandelbrot public static void Main (string[] args) { - QApplication app = new QApplication (args); + TQApplication app = new TQApplication (args); dialog = new ImageDialog (null, "Mandelbrot", false, 0); dialog.SetGeometry(0, 0, 550, 300 ); @@ -122,11 +122,11 @@ public class Mandelbrot public class PicLabel: QFrame { - QPixmap newPixmap; + TQPixmap newPixmap; int newWidth = 400; int newHeight = 300; - public PicLabel( QWidget parent, string name, WidgetFlags flags ): + public PicLabel( TQWidget parent, string name, WidgetFlags flags ): base( parent, name, flags ) { SetBackgroundMode (Qt.BackgroundMode.NoBackground); @@ -135,7 +135,7 @@ public class PicLabel: QFrame } - protected void PerformResize (QResizeEvent e) + protected void PerformResize (TQResizeEvent e) { Console.WriteLine("Resizing to {0} by {1}", e.Size().Width(), e.Size().Height() ); @@ -146,12 +146,12 @@ public class PicLabel: QFrame } - protected void PerformPaint(QPaintEvent e ) + protected void PerformPaint(TQPaintEvent e ) { Console.WriteLine("Making a new image {0} by {1}", newWidth, newHeight ); - QImage image = Mandelbrot.dialog.MandelbrotImage( newWidth, newHeight ); - newPixmap = new QPixmap( image ); + TQImage image = Mandelbrot.dialog.MandelbrotImage( newWidth, newHeight ); + newPixmap = new TQPixmap( image ); BitBlt(this, 0, 0, newPixmap, 0, 0, -1, -1, RasterOp.CopyROP, false); @@ -161,123 +161,123 @@ public class PicLabel: QFrame -public class ImageDialog : QDialog { +public class ImageDialog : TQDialog { const double DefaultPlotXMin = -2.0; const double DefaultPlotXMax = 2.0; const double DefaultPlotYMin = -1.5; const double DefaultPlotYMax = 1.5; - QHBoxLayout dialogLayout; - QGridLayout gridLayout; - QVBoxLayout leftLayout; - QHBoxLayout buttonLayout; - QPushButton redrawButton; + TQHBoxLayout dialogLayout; + TQGridLayout gridLayout; + TQVBoxLayout leftLayout; + TQHBoxLayout buttonLayout; + TQPushButton redrawButton; public PicLabel pixmapLabel; - QSizePolicy fixedSizePolicy; + TQSizePolicy fixedSizePolicy; - QLabel XMinLabel, XMaxLabel, YMinLabel, YMaxLabel; - QLineEdit editXMin, editXMax, editYMin, editYMax; + TQLabel XMinLabel, XMaxLabel, YMinLabel, YMaxLabel; + TQLineEdit editXMin, editXMax, editYMin, editYMax; - public ImageDialog (QWidget parent, string name, bool modal, WidgetFlags fl): + public ImageDialog (TQWidget parent, string name, bool modal, WidgetFlags fl): base (parent, name, modal, fl) { if (name == string.Empty) SetName ("imageDialog"); SetCaption ("Mandelbrot Image"); - dialogLayout = new QHBoxLayout (this, 11, 6); - gridLayout = new QGridLayout (null, 1, 1, 0, 6, "gridLayout"); - leftLayout = new QVBoxLayout (null, 0, 6, "leftLayout"); + dialogLayout = new TQHBoxLayout (this, 11, 6); + gridLayout = new TQGridLayout (null, 1, 1, 0, 6, "gridLayout"); + leftLayout = new TQVBoxLayout (null, 0, 6, "leftLayout"); - fixedSizePolicy = new QSizePolicy ( QSizePolicy.SizeType.Fixed, - QSizePolicy.SizeType.Fixed, false ); + fixedSizePolicy = new TQSizePolicy ( TQSizePolicy.SizeType.Fixed, + TQSizePolicy.SizeType.Fixed, false ); - XMinLabel = new QLabel ("Xmin", this); + XMinLabel = new TQLabel ("Xmin", this); XMinLabel.SetSizePolicy (fixedSizePolicy); gridLayout.AddWidget (XMinLabel, 0, 0); - XMaxLabel = new QLabel ("Xmax", this); + XMaxLabel = new TQLabel ("Xmax", this); XMaxLabel.SetSizePolicy(fixedSizePolicy); gridLayout.AddWidget (XMaxLabel, 1, 0); - YMinLabel = new QLabel ("Ymin", this); + YMinLabel = new TQLabel ("Ymin", this); YMinLabel.SetSizePolicy (fixedSizePolicy); gridLayout.AddWidget (YMinLabel, 2, 0); - YMaxLabel = new QLabel ("Ymax", this); + YMaxLabel = new TQLabel ("Ymax", this); YMaxLabel.SetSizePolicy (fixedSizePolicy); gridLayout.AddWidget (YMaxLabel, 3, 0); - QDoubleValidator validator = new QDoubleValidator (this); + TQDoubleValidator validator = new TQDoubleValidator (this); - editXMin = new QLineEdit (this, "editXMin"); + editXMin = new TQLineEdit (this, "editXMin"); editXMin.SetSizePolicy( fixedSizePolicy ); editXMin.SetText (Convert.ToString (DefaultPlotXMin)); editXMin.SetValidator (validator); gridLayout.AddWidget (editXMin, 0, 1); - editXMax = new QLineEdit (this, "editXMax"); + editXMax = new TQLineEdit (this, "editXMax"); editXMax.SetSizePolicy( fixedSizePolicy ); editXMax.SetText (Convert.ToString(DefaultPlotXMax)); editXMax.SetValidator (validator); gridLayout.AddWidget (editXMax, 1, 1); - editYMin = new QLineEdit (this, "editYMin"); + editYMin = new TQLineEdit (this, "editYMin"); editYMin.SetSizePolicy( fixedSizePolicy ); editYMin.SetText (Convert.ToString(DefaultPlotYMin)); editYMin.SetValidator (validator); gridLayout.AddWidget (editYMin, 2, 1); - editYMax = new QLineEdit (this, "editYMax"); + editYMax = new TQLineEdit (this, "editYMax"); editYMax.SetSizePolicy( fixedSizePolicy ); editYMax.SetText (Convert.ToString(DefaultPlotYMax)); editYMax.SetValidator (validator); gridLayout.AddWidget (editYMax, 3, 1); leftLayout.AddLayout (gridLayout); - QSpacerItem spacer1 = new QSpacerItem (0, 0, 0, 0); + TQSpacerItem spacer1 = new TQSpacerItem (0, 0, 0, 0); leftLayout.AddItem (spacer1); - buttonLayout = new QHBoxLayout (null, 0, 6, "buttonLayout"); - QSpacerItem spacer2 = new QSpacerItem (0, 0, 0, 0); + buttonLayout = new TQHBoxLayout (null, 0, 6, "buttonLayout"); + TQSpacerItem spacer2 = new TQSpacerItem (0, 0, 0, 0); buttonLayout.AddItem (spacer2); - redrawButton = new QPushButton ("Redraw", this); + redrawButton = new TQPushButton ("Redraw", this); redrawButton.SetSizePolicy ( fixedSizePolicy ); redrawButton.SetDefault (true); buttonLayout.AddWidget (redrawButton); - QSpacerItem spacer3 = new QSpacerItem (0, 0, 0, 0); + TQSpacerItem spacer3 = new TQSpacerItem (0, 0, 0, 0); buttonLayout.AddItem (spacer3); leftLayout.AddLayout (buttonLayout); dialogLayout.AddLayout (leftLayout); - QSpacerItem spacer4 = new QSpacerItem (0, 0, 0, 0); + TQSpacerItem spacer4 = new TQSpacerItem (0, 0, 0, 0); dialogLayout.AddItem (spacer4); pixmapLabel = new PicLabel (this, "pixmapLabel", 0); //pixmapLabel.SetScaledContents (true); - pixmapLabel.SetSizePolicy( QSizePolicy.SizeType.Minimum, - QSizePolicy.SizeType.Minimum, false ); + pixmapLabel.SetSizePolicy( TQSizePolicy.SizeType.Minimum, + TQSizePolicy.SizeType.Minimum, false ); pixmapLabel.SetGeometry( 0, 0, 400, 300 ); pixmapLabel.Show(); pixmapLabel.Resize(400,300); dialogLayout.AddWidget (pixmapLabel); - //QImage image = MandelbrotImage( 400, 300 ); - //pixmapLabel.SetPixmap( new QPixmap( image ) ); + //TQImage image = MandelbrotImage( 400, 300 ); + //pixmapLabel.SetPixmap( new TQPixmap( image ) ); - QObject.Connect (redrawButton, SIGNAL ("clicked()"), pixmapLabel, SLOT ("Repaint()")); + TQObject.Connect (redrawButton, TQT_SIGNAL ("clicked()"), pixmapLabel, TQT_SLOT ("Repaint()")); //Redraw (); } - public QImage MandelbrotImage ( int width, int height) + public TQImage MandelbrotImage ( int width, int height) { int depth; double real, imag; @@ -290,7 +290,7 @@ public class ImageDialog : QDialog { int ImageXMax = width; int ImageYMax = height; - QImage image = new QImage (ImageXMax, ImageYMax, 32, 0); + TQImage image = new TQImage (ImageXMax, ImageYMax, 32, 0); for (int x = 0; x <= ImageXMax - 1; x+=1) { for (int y = 0; y <= ImageYMax - 1; y+=1) { |