diff --git a/source/ImageInterface.cpp b/source/ImageInterface.cpp index 722d186..7e097b9 100644 --- a/source/ImageInterface.cpp +++ b/source/ImageInterface.cpp @@ -32,8 +32,10 @@ namespace plaYUVer { -ImageInterface::ImageInterface() +ImageInterface::ImageInterface( QWidget * parent ) +: QScrollArea( parent ) { + setParent( parent ); setAttribute( Qt::WA_DeleteOnClose ); isUntitled = true; @@ -48,7 +50,7 @@ ImageInterface::ImageInterface() setWidgetResizable( true ); setAttribute( Qt::WA_DeleteOnClose ); - setMinimumSize( 150, 150 ); + setMinimumSize( 200, 200 ); setBackgroundRole( QPalette::Dark ); setWidget( m_cViewArea ); @@ -63,11 +65,11 @@ ImageInterface::~ImageInterface() delete m_cViewArea; } -bool ImageInterface::loadFile( const QString &fileName, UInt width, UInt height ) +bool ImageInterface::loadFile( const QString &fileName ) { QApplication::setOverrideCursor( Qt::WaitCursor ); - m_currStream.init( fileName, width, height ); + m_currStream.init( fileName, 1024, 768 ); m_currStream.readFrame(); if( m_currStream.checkErrors( READING ) ) @@ -87,8 +89,6 @@ bool ImageInterface::loadFile( const QString &fileName, UInt width, UInt height m_cCurrFileName = fileName; - sizeHint(); - return true; } @@ -204,7 +204,7 @@ static bool sanityCheck( const QList &widgets, const int index, const return true; } -QSize ImageInterface::sizeHint() +QSize ImageInterface::sizeHint () const { QSize maxSize; // The size of the parent (viewport widget // of the QMdiArea). @@ -215,7 +215,7 @@ QSize ImageInterface::sizeHint() maxSize = p->size(); } - QSize isize = QSize( m_currStream.getWidth() + 50, m_currStream.getHeight() + 50 ); + QSize isize = QSize( m_currStream.getWidth() + 500, m_currStream.getHeight() + 500 ); // If the ImageInterface needs more space that the avaiable, we'll give // to the subwindow a reasonable size preserving the image aspect ratio. diff --git a/source/ImageInterface.h b/source/ImageInterface.h index 5ec4526..fa9667f 100644 --- a/source/ImageInterface.h +++ b/source/ImageInterface.h @@ -61,10 +61,10 @@ private: Bool m_firsTime; public: - ImageInterface(); + ImageInterface( QWidget * parent = 0 ); ~ImageInterface(); - bool loadFile( const QString &fileName, UInt width, UInt height ); + bool loadFile( const QString &fileName ); bool save(); bool saveAs(); bool saveFile( const QString &fileName ); @@ -104,7 +104,7 @@ public: return m_dScaleFactor; } - QSize sizeHint(); + QSize sizeHint() const; /** * Arranges all the listed widgets (normaly QMdiImageInterface) in a cascade