Fix bug after the modification of ImageInterface into QMdiSubWindow
This commit is contained in:
1 parent
d0f52cdf9b
commit
1b61426d1d
3 files changed
+7
-15
No files matched your search
@@ -49,7 +49,6 @@ ImageInterface::ImageInterface( QWidget * parent ) :
|
||||
|
||||
// Create a new interface to show images
|
||||
m_cViewArea = new ViewArea( m_cScrollArea );
|
||||
//m_cViewArea = new QLabel( this );
|
||||
|
||||
// Define the cViewArea as the widget inside the scroll area
|
||||
m_cScrollArea->setWidget( m_cViewArea );
|
||||
@@ -86,8 +85,6 @@ bool ImageInterface::loadFile( const QString &fileName )
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
//QImage image( fileName );
|
||||
//m_cViewArea->setPixmap( QPixmap::fromImage( m_currStream.getFrameQImage() ) );
|
||||
m_cViewArea->setImage( QPixmap::fromImage( m_currStream.getFrameQImage() ) );
|
||||
|
||||
normalSize();
|
||||
@@ -139,9 +136,8 @@ Void ImageInterface::zoomToFit()
|
||||
|
||||
Void ImageInterface::scaleView( Double factor )
|
||||
{
|
||||
//Q_ASSERT( m_cViewArea->pixmap() );
|
||||
Q_ASSERT( m_cViewArea->image() );
|
||||
m_dScaleFactor *= factor;
|
||||
//m_cViewArea->resize( m_dScaleFactor * m_cViewArea->pixmap()->size() );
|
||||
m_cViewArea->setZoomFactor( m_dScaleFactor );
|
||||
adjustScrollBar( m_dScaleFactor );
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ Q_OBJECT
|
||||
private:
|
||||
|
||||
QScrollArea* m_cScrollArea;
|
||||
//QLabel* m_cViewArea;
|
||||
ViewArea* m_cViewArea;
|
||||
InputStream m_currStream;
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
* \brief Main definition of the plaYUVerApp app
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <QtWidgets>
|
||||
#include <QMdiArea>
|
||||
#include <QtDebug>
|
||||
@@ -84,7 +82,7 @@ void plaYUVerApp::open()
|
||||
QString formats = InputStream::supportedReadFormats();
|
||||
formats.prepend( " (" );
|
||||
formats.append( ")" );
|
||||
supported.append( formats ); // supported=="Supported Files (*.pbm *.jpg...)"
|
||||
supported.append( formats ); // supported=="Supported Files (*.pbm *.jpg...)"
|
||||
|
||||
QStringList filter;
|
||||
filter << supported << InputStream::supportedReadFormatsList() << tr( "All Files (*)" );
|
||||
@@ -102,8 +100,7 @@ void plaYUVerApp::open()
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ImageInterface *interfaceChild = new ImageInterface(this); //createImageInterface();
|
||||
ImageInterface *interfaceChild = new ImageInterface( this ); //createImageInterface();
|
||||
if( interfaceChild->loadFile( fileName ) )
|
||||
{
|
||||
addImageInterface( interfaceChild );
|
||||
@@ -199,7 +196,7 @@ void plaYUVerApp::updateWindowMenu()
|
||||
|
||||
for( Int i = 0; i < windows.size(); ++i )
|
||||
{
|
||||
ImageInterface *child = qobject_cast<ImageInterface *>( windows.at( i )->widget() );
|
||||
ImageInterface *child = qobject_cast<ImageInterface *>( windows.at( i ) );
|
||||
|
||||
QString text;
|
||||
if( i < 9 )
|
||||
@@ -390,7 +387,7 @@ Void plaYUVerApp::writeSettings()
|
||||
ImageInterface *plaYUVerApp::activeImageInterface()
|
||||
{
|
||||
if( QMdiSubWindow *activeImageInterface = mdiArea->activeSubWindow() )
|
||||
return qobject_cast<ImageInterface *>( activeImageInterface->widget() );
|
||||
return qobject_cast<ImageInterface *>( activeImageInterface );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -399,7 +396,7 @@ QMdiSubWindow *plaYUVerApp::findImageInterface( const QString &fileName )
|
||||
QString canonicalFilePath = QFileInfo( fileName ).canonicalFilePath();
|
||||
|
||||
foreach( QMdiSubWindow * window, mdiArea->subWindowList() ){
|
||||
ImageInterface *mdiChild = qobject_cast<ImageInterface *>( window->widget() );
|
||||
ImageInterface *mdiChild = qobject_cast<ImageInterface *>( window);
|
||||
if( mdiChild->currentFile() == canonicalFilePath )
|
||||
return window;
|
||||
}
|
||||
@@ -413,4 +410,4 @@ void plaYUVerApp::setActiveImageInterface( QWidget *window )
|
||||
mdiArea->setActiveSubWindow( qobject_cast<QMdiSubWindow *>( window ) );
|
||||
}
|
||||
|
||||
} // NAMESPACE
|
||||
} // NAMESPACE
|
||||
Reference in new issue
Block a user