Commit ebb75223 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Image viewer should not have a frame

Looks blurry in combination with the one pixel splitters

Reviewed-by: Jens Bache-Wiig
parent 0c0b430f
...@@ -146,13 +146,14 @@ ImageViewer::ImageViewer(QObject *parent) ...@@ -146,13 +146,14 @@ ImageViewer::ImageViewer(QObject *parent)
m_scrollArea = new QScrollArea; m_scrollArea = new QScrollArea;
m_scrollArea->setWidgetResizable(true); m_scrollArea->setWidgetResizable(true);
m_imageview = new QWidget; m_scrollArea->setFrameStyle(QFrame::NoFrame);
QGridLayout *layout = new QGridLayout(); m_imageView = new QWidget;
QGridLayout *layout = new QGridLayout;
m_label = new QLabel; m_label = new QLabel;
m_label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); m_label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
m_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); m_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
layout->setMargin(0); layout->setMargin(0);
m_imageview->setLayout(layout); m_imageView->setLayout(layout);
layout->addWidget(m_label, 0, 0, 1, 1); layout->addWidget(m_label, 0, 0, 1, 1);
} }
...@@ -181,7 +182,7 @@ bool ImageViewer::createNew(const QString &contents) ...@@ -181,7 +182,7 @@ bool ImageViewer::createNew(const QString &contents)
bool ImageViewer::open(const QString &fileName) bool ImageViewer::open(const QString &fileName)
{ {
m_label->setPixmap(QPixmap(fileName)); m_label->setPixmap(QPixmap(fileName));
m_scrollArea->setWidget(m_imageview); m_scrollArea->setWidget(m_imageView);
setDisplayName(QFileInfo(fileName).fileName()); setDisplayName(QFileInfo(fileName).fileName());
m_file->setFileName(fileName); m_file->setFileName(fileName);
// m_file->setMimeType // m_file->setMimeType
......
...@@ -126,7 +126,7 @@ private: ...@@ -126,7 +126,7 @@ private:
QString m_displayName; QString m_displayName;
ImageViewerFile *m_file; ImageViewerFile *m_file;
QScrollArea *m_scrollArea; QScrollArea *m_scrollArea;
QWidget *m_imageview; QWidget *m_imageView;
QLabel *m_label; QLabel *m_label;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment