From 9d3de3499af4a03177b9c0bb211da763e5dcbb2d Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 20 Oct 2012 04:36:10 +0200 Subject: Make PictureViewer2 size configurable Several bug fixes on the way: * set fixed size policy for PictureViewer2 -> makes resizing much easier * don't set Y-offset when showing a pic. The scene takes care of it * don't deliver SIGNAL configChanged() twice to PictureViewer2 * center Widget on current screen when calling Helper::centerWidget --- shemov.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index e8dfeae..e282de9 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -56,6 +56,7 @@ #include "newpicsdialog.h" #include "pictureswidget.h" #include "pictureviewer2.h" +#include "helper.h" SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags), mOpenWithGroupFS(0), mOpenWithGroupAV(0) { //application icon @@ -89,6 +90,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla connect(mPicWidget->picView(), SIGNAL(newMappings(QString)), this, SLOT(statusbarMessage(QString))); connect(mPicWidget->picView(), SIGNAL(numSelected(int)), this, SLOT(updateSelectedCount(int))); connect(mPicWidget->picView(), SIGNAL(selectedSize(qint64)), this, SLOT(setSize(qint64))); + PictureViewer2 *picViewer = SmGlobals::instance()->pictureViewer(); //newmoviewizard + dbanalyzer mNewMovieWizard = new NewMovieWizard(this); @@ -117,8 +119,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla connect(mFSWidget->dirModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(setFsFree())); connect(this, SIGNAL(configChanged()), mFSWidget->fileView(), SLOT(readConfig())); connect(this, SIGNAL(configChanged()), mATree->seriesWidget(), SLOT(readSettings())); - connect(this, SIGNAL(configChanged()), SmGlobals::instance()->pictureViewer(), SLOT(readSettings())); - connect(this, SIGNAL(configChanged()), mPicWidget->picViewer2(), SLOT(readSettings())); + connect(this, SIGNAL(configChanged()), picViewer, SLOT(readSettings())); connect(mFSWidget, SIGNAL(mounted(bool)), this, SLOT(checkMount(bool))); QWidget *centralWidget = new QWidget; @@ -131,6 +132,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla readSettings(); mFSWidget->fileView()->setFocus(Qt::ActiveWindowFocusReason); mATree->filesWidget()->filesTree()->header()->resizeSections(QHeaderView::ResizeToContents); + Helper::centerWidget(picViewer); } void SheMov::closeEvent(QCloseEvent *event){ -- cgit v1.2.3-70-g09d2