[Kstars-devel] KDE/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Fri May 23 06:13:15 CEST 2008


SVN commit 811454 by harris:

Fix sizing of the Image Viewer.  I'm pretty sure this was working 
before, so maybe this is fallout from a recent change in KDialog or 
something.  Anyway, the fix was to get rid of the QFrame widget I had 
added to contain the image and the credit caption line in a QVBoxLayout.  
Now the layout belongs to the KDialog directly.

It's possible there are other windows that will need a similar fix.

CCMAIL: kstars-devel at kde.org



 M  +4 -7      imageviewer.cpp  
 M  +0 -2      imageviewer.h  


--- trunk/KDE/kdeedu/kstars/kstars/imageviewer.cpp #811453:811454
@@ -65,15 +65,13 @@
         downloadJob(0)
 {
     setModal( false );
-    MainFrame = new QFrame( this );
-    setMainWidget( MainFrame );
     setCaption( i18n("KStars image viewer")+QString(" : ")+url.fileName() );
     setButtons( KDialog::User1|KDialog::Close );
     KGuiItem saveButton( i18n("Save"), "document-save", i18n("Save the image to disk") );
     setButtonGuiItem( KDialog::User1, saveButton );
 
-    View = new ImageLabel( MainFrame );
-    Caption = new QLabel( MainFrame );
+    View = new ImageLabel( this );
+    Caption = new QLabel( this );
     View->setAutoFillBackground( true );
     Caption->setAutoFillBackground( true );
     Caption->setFrameShape( QFrame::StyledPanel );
@@ -90,7 +88,7 @@
     capFont.setPointSize( capFont.pointSize() - 2 );
     Caption->setFont( capFont );
 
-    vlay = new QVBoxLayout( MainFrame );
+    vlay = new QVBoxLayout( this );
     vlay->setSpacing( 0 );
     vlay->setMargin( 0 );
     vlay->addWidget( View );
@@ -117,7 +115,6 @@
 
     delete View;
     delete Caption;
-    delete MainFrame;
     if ( downloadJob ) delete downloadJob;
 }
 
@@ -205,7 +202,7 @@
     //If the caption is wider than the image, set the window size
     //to fit the caption
     if ( Caption->width() > w ) w = Caption->width();
-    MainFrame->setFixedSize( w, image.height() + Caption->height() );
+    setFixedSize( w, image.height() + Caption->height() );
 
     update();
 }
--- trunk/KDE/kdeedu/kstars/kstars/imageviewer.h #811453:811454
@@ -19,7 +19,6 @@
 #define IMAGEVIEWER_H_
 
 #include <QFile>
-#include <QFrame>
 #include <QLabel>
 #include <QVBoxLayout>
 #include <QImage>
@@ -115,7 +114,6 @@
 
     ImageLabel *View;
     QLabel *Caption;
-    QFrame *MainFrame;
     QVBoxLayout *vlay;
 
 private slots:


More information about the Kstars-devel mailing list