summaryrefslogtreecommitdiff
path: root/noncore/multimedia/camera/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/camera/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/camera/mainwindow.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/noncore/multimedia/camera/mainwindow.cpp b/noncore/multimedia/camera/mainwindow.cpp
index 4218232..8578bce 100644
--- a/noncore/multimedia/camera/mainwindow.cpp
+++ b/noncore/multimedia/camera/mainwindow.cpp
@@ -14,30 +14,28 @@
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "mainwindow.h" 16#include "mainwindow.h"
17#include "mainwindowbase.h"
17#include "zcameraio.h" 18#include "zcameraio.h"
18 19
19#include <qvbox.h> 20#include <qvbox.h>
21#include <qcombobox.h>
20#include <qpushbutton.h> 22#include <qpushbutton.h>
21#include <qlabel.h> 23#include <qlabel.h>
22
23#include <qdirectpainter_qws.h> 24#include <qdirectpainter_qws.h>
24
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <opie/ofiledialog.h> 26#include <opie/ofiledialog.h>
27 27
28#include <assert.h>
29
28CameraMainWindow::CameraMainWindow( QWidget * parent, const char * name, WFlags f ) 30CameraMainWindow::CameraMainWindow( QWidget * parent, const char * name, WFlags f )
29 :QMainWindow( parent, name, f ) 31 :QMainWindow( parent, name, f )
30{ 32{
31 QVBox* v = new QVBox( this ); 33 mw = new MainWindowBase( this, "main widget" );
32 l = new QLabel( v ); 34 ZCameraIO::instance()->setCaptureFrame( 240, 160, 256 );
33 l->setFixedSize( QSize( 240, 160 ) ); 35 setCentralWidget( mw );
34 QPushButton* p = new QPushButton( "Snapshot", v ); 36 mw->show();
35 connect( p, SIGNAL( clicked() ), this, SLOT( clickedSnapShot() ) );
36 v->show();
37 l->show();
38 p->show();
39 setCentralWidget( v );
40 37
38 connect( mw->zoom, SIGNAL( activated( int ) ), this, SLOT( changeZoom(int) ) );
41}; 39};
42 40
43 41
@@ -46,19 +44,17 @@ CameraMainWindow::~CameraMainWindow()
46} 44}
47 45
48 46
49void CameraMainWindow::clickedSnapShot() 47void CameraMainWindow::changeZoom( int zoom )
50{ 48{
51 QDirectPainter fb( l ); 49 int z;
52 ZCameraIO::instance()->snapshot( fb.frameBuffer() ); 50 switch ( zoom )
53
54 /*
55 QImage i;
56 QPixmap p;
57 if ( ZCameraIO::instance()->snapshot( &i ) )
58 { 51 {
59 p.convertFromImage( i ); 52 case 0: z = 128; break;
60 l->setPixmap( p ); 53 case 1: z = 256; break;
54 case 2: z = 512; break;
55 default: assert( 0 ); break;
61 } 56 }
62 */ 57
58 ZCameraIO::instance()->setCaptureFrame( 240, 160, z );
63} 59}
64 60