Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit add5f8de authored by Laurent Montel's avatar Laurent Montel 😁

Remove deprecated method

parent bc53ce23
......@@ -89,7 +89,7 @@ struct BrowseMainPagePrivate : public Ui_BrowseMainPage
void setupWidgets()
{
setupUi(q);
q->layout()->setMargin(0);
q->layout()->setContentsMargins(0, 0, 0, 0);
// mThumbnailView
mThumbnailView->setModel(mDirModel);
......@@ -105,7 +105,7 @@ struct BrowseMainPagePrivate : public Ui_BrowseMainPage
mUrlNavigatorContainer->setAutoFillBackground(true);
mUrlNavigatorContainer->setBackgroundRole(QPalette::Mid);
QVBoxLayout* layout = new QVBoxLayout(mUrlNavigatorContainer);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(mUrlNavigator);
QObject::connect(mUrlNavigator, SIGNAL(urlsDropped(QUrl,QDropEvent*)),
q, SLOT(slotUrlsDropped(QUrl,QDropEvent*)));
......
......@@ -38,7 +38,7 @@ QWidget* setupPage(Ui& ui)
{
QWidget* widget = new QWidget;
ui.setupUi(widget);
widget->layout()->setMargin(0);
widget->layout()->setContentsMargins(0, 0, 0, 0);
return widget;
}
......
......@@ -67,7 +67,7 @@ NameFilterWidget::NameFilterWidget(SortedDirModel* model)
mLineEdit = new QLineEdit;
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(2);
layout->addWidget(mModeComboBox);
layout->addWidget(mLineEdit);
......@@ -110,7 +110,7 @@ DateFilterWidget::DateFilterWidget(SortedDirModel* model)
mDateWidget = new DateWidget;
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(mModeComboBox);
layout->addWidget(mDateWidget);
......@@ -147,7 +147,7 @@ RatingFilterWidget::RatingFilterWidget(SortedDirModel* model)
mRatingWidget->setMaxRating(10);
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(mModeComboBox);
layout->addWidget(mRatingWidget);
......@@ -190,7 +190,7 @@ TagFilterWidget::TagFilterWidget(SortedDirModel* model)
mTagComboBox = new QComboBox;
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(mModeComboBox);
layout->addWidget(mTagComboBox);
......
......@@ -69,7 +69,7 @@ public:
{
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
mLayout->setSpacing(0);
mLayout->setMargin(0);
mLayout->setContentsMargins(0, 0, 0, 0);
}
void addAction(QAction* action)
......@@ -121,7 +121,7 @@ void FullScreenContent::init(KActionCollection* actionCollection, QWidget* autoH
mAutoHideContainer = new FullScreenBar(autoHideParentWidget);
mAutoHideContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
QVBoxLayout* layout = new QVBoxLayout(mAutoHideContainer);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
EventWatcher::install(autoHideParentWidget, QEvent::Resize, this, SLOT(adjustSize()));
......@@ -167,7 +167,7 @@ void FullScreenContent::init(KActionCollection* actionCollection, QWidget* autoH
mInformationContainer->setBackgroundRole(QPalette::Mid);
mInformationContainerShadow = new ShadowFilter(mInformationContainer);
QHBoxLayout* hLayout = new QHBoxLayout(mInformationContainer);
hLayout->setMargin(0);
hLayout->setContentsMargins(0, 0, 0, 0);
hLayout->addWidget(mInformationLabel);
hLayout->addWidget(mDocumentCountLabel);
......@@ -304,7 +304,7 @@ void FullScreenContent::updateLayout()
mRightToolBar->setDirection(QBoxLayout::TopToBottom);
QHBoxLayout* layout = new QHBoxLayout(mContent);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
QVBoxLayout* vLayout;
......@@ -348,7 +348,7 @@ void FullScreenContent::updateLayout()
mRightToolBar->setDirection(QBoxLayout::RightToLeft);
QHBoxLayout* layout = new QHBoxLayout(mContent);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(mToolBar);
layout->addWidget(mInformationContainer);
......
......@@ -62,7 +62,7 @@ KIPIImageCollectionSelector::KIPIImageCollectionSelector(KIPIInterface* interfac
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(d->mListWidget);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
}
KIPIImageCollectionSelector::~KIPIImageCollectionSelector()
......
......@@ -44,7 +44,7 @@ KIPIUploadWidget::KIPIUploadWidget(KIPIInterface* interface, QWidget* parent)
label->setWordWrap(true);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(label);
}
......
......@@ -242,7 +242,7 @@ struct MainWindow::Private
QVBoxLayout* layout = new QVBoxLayout(mContentWidget);
layout->addWidget(mSaveBar);
layout->addWidget(mViewStackedWidget);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
////
......@@ -560,7 +560,7 @@ struct MainWindow::Private
page = new SideBarPage(i18n("Folders"));
page->setObjectName(QLatin1String("folders"));
page->addWidget(folderViewItem->widget());
page->layout()->setMargin(0);
page->layout()->setContentsMargins(0, 0, 0, 0);
mSideBar->addPage(page);
page = new SideBarPage(i18n("Information"));
......
......@@ -90,7 +90,7 @@ struct SaveBarPrivate
// Layout
QHBoxLayout* layout = new QHBoxLayout(mTooManyChangesFrame);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(iconLabel);
layout->addWidget(textLabel);
layout->addWidget(mSaveAllFullScreenButton);
......@@ -258,7 +258,7 @@ SaveBar::SaveBar(QWidget* parent, KActionCollection* actionCollection)
rowLayout->addWidget(d->mSaveCurrentUrlButton);
rowLayout->addWidget(d->mSaveAsButton);
rowLayout->addWidget(d->mSaveAllButton);
rowLayout->setMargin(0);
rowLayout->setContentsMargins(0, 0, 0, 0);
// Setup bottom row
QHBoxLayout* bottomRowLayout = new QHBoxLayout;
......
......@@ -69,7 +69,7 @@ struct SemanticInfoDialog : public QDialog, public Ui_SemanticInfoDialog
QWidget* mainWidget = new QWidget;
layout()->addWidget(mainWidget);
setupUi(mainWidget);
mainWidget->layout()->setMargin(0);
mainWidget->layout()->setContentsMargins(0, 0, 0, 0);
setWindowTitle(mainWidget->windowTitle());
KWindowConfig::restoreWindowSize(windowHandle(), configGroup());
......@@ -177,7 +177,7 @@ struct SemanticInfoContextManagerItemPrivate : public Ui_SemanticInfoSideBarItem
QWidget* container = new QWidget;
setupUi(container);
container->layout()->setMargin(0);
container->layout()->setContentsMargins(0, 0, 0, 0);
mGroup->addWidget(container);
formLayout->setContentsMargins(DEFAULT_LAYOUT_MARGIN, 0, 0, 0);
......
......@@ -103,7 +103,7 @@ SideBarGroup::SideBarGroup(const QString& title, bool defaultContainerMarginEnab
d->mTitleLabel->setText(title);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(d->mTitleLabel);
......@@ -143,7 +143,7 @@ void SideBarGroup::clear()
d->mContainer = new QFrame(this);
QVBoxLayout* containerLayout = new QVBoxLayout(d->mContainer);
containerLayout->setMargin(0);
containerLayout->setContentsMargins(0, 0, 0, 0);
containerLayout->setSpacing(0);
layout()->addWidget(d->mContainer);
......@@ -182,7 +182,7 @@ SideBarPage::SideBarPage(const QString& title)
d->mTitle = title;
d->mLayout = new QVBoxLayout(this);
d->mLayout->setMargin(0);
d->mLayout->setContentsMargins(0, 0, 0, 0);
}
SideBarPage::~SideBarPage()
......
......@@ -215,7 +215,7 @@ struct ViewMainPagePrivate
mAdapterContainer = new QWidget;
QVBoxLayout* layout = new QVBoxLayout(mAdapterContainer);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
mDocumentViewContainer = new DocumentViewContainer;
mDocumentViewContainer->setAutoFillBackground(true);
......@@ -306,7 +306,7 @@ struct ViewMainPagePrivate
mDocumentCountLabel->setContentsMargins(labelMargins);
QHBoxLayout* layout = new QHBoxLayout(mStatusBarContainer);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(mToggleSideBarButton);
layout->addWidget(mToggleThumbnailBarButton);
......@@ -331,7 +331,7 @@ struct ViewMainPagePrivate
mThumbnailSplitter->setSizes(GwenviewConfig::thumbnailSplitterSizes());
QVBoxLayout* layout = new QVBoxLayout(q);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(mThumbnailSplitter);
}
......
......@@ -278,7 +278,7 @@ struct CropWidgetPrivate : public QWidget
{
QWidget* widget = new QWidget(parent);
QHBoxLayout* layout = new QHBoxLayout(widget);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(2);
return widget;
}
......
......@@ -96,7 +96,7 @@ DateWidget::DateWidget(QWidget* parent)
connect(d->mNextButton, &StatusBarToolButton::clicked, this, &DateWidget::goToNext);
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(d->mPreviousButton);
layout->addWidget(d->mDateButton);
......
......@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QByteArray>
#include <QImage>
#include <QImageWriter>
#include <QMatrix>
#include <QTransform>
#include <QDebug>
#include <QUrl>
......@@ -109,7 +109,7 @@ void DocumentLoadedImpl::setImage(const QImage& image)
void DocumentLoadedImpl::applyTransformation(Orientation orientation)
{
QImage image = document()->image();
QMatrix matrix = ImageUtils::transformMatrix(orientation);
QTransform matrix = ImageUtils::transformMatrix(orientation);
image = image.transformed(matrix);
setDocumentImage(image);
emit imageRectUpdated(image.rect());
......
......@@ -21,16 +21,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "imageutils.h"
// Qt
#include <QMatrix>
#include <QTransform>
namespace Gwenview
{
namespace ImageUtils
{
QMatrix transformMatrix(Orientation orientation)
QTransform transformMatrix(Orientation orientation)
{
QMatrix matrix;
QTransform matrix;
switch (orientation) {
case NOT_AVAILABLE:
case NORMAL:
......
......@@ -24,14 +24,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <lib/gwenviewlib_export.h>
#include <lib/orientation.h>
class QMatrix;
class QTransform;
namespace Gwenview
{
namespace ImageUtils
{
GWENVIEWLIB_EXPORT QMatrix transformMatrix(Orientation);
GWENVIEWLIB_EXPORT QTransform transformMatrix(Orientation);
} // namespace
} // namespace
......
......@@ -35,7 +35,7 @@ extern "C" {
#include <QFile>
#include <QImage>
#include <QImageWriter>
#include <QMatrix>
#include <QTransform>
#include <QDebug>
// KDE
......@@ -117,7 +117,7 @@ struct JpegContent::Private
QSize mSize;
QString mComment;
bool mPendingTransformation;
QMatrix mTransformMatrix;
QTransform mTransformMatrix;
Exiv2::ExifData mExifData;
QString mErrorString;
......@@ -345,16 +345,16 @@ void JpegContent::setComment(const QString& comment)
d->mComment = comment;
}
static QMatrix createRotMatrix(int angle)
static QTransform createRotMatrix(int angle)
{
QMatrix matrix;
QTransform matrix;
matrix.rotate(angle);
return matrix;
}
static QMatrix createScaleMatrix(int dx, int dy)
static QTransform createScaleMatrix(int dx, int dy)
{
QMatrix matrix;
QTransform matrix;
matrix.scale(dx, dy);
return matrix;
}
......@@ -366,12 +366,12 @@ struct OrientationInfo
, jxform(JXFORM_NONE)
{}
OrientationInfo(Orientation o, const QMatrix &m, JXFORM_CODE j)
OrientationInfo(Orientation o, const QTransform &m, JXFORM_CODE j)
: orientation(o), matrix(m), jxform(j)
{}
Orientation orientation;
QMatrix matrix;
QTransform matrix;
JXFORM_CODE jxform;
};
typedef QList<OrientationInfo> OrientationInfoList;
......@@ -380,13 +380,13 @@ static const OrientationInfoList& orientationInfoList()
{
static OrientationInfoList list;
if (list.size() == 0) {
QMatrix rot90 = createRotMatrix(90);
QMatrix hflip = createScaleMatrix(-1, 1);
QMatrix vflip = createScaleMatrix(1, -1);
QTransform rot90 = createRotMatrix(90);
QTransform hflip = createScaleMatrix(-1, 1);
QTransform vflip = createScaleMatrix(1, -1);
list
<< OrientationInfo()
<< OrientationInfo(NORMAL, QMatrix(), JXFORM_NONE)
<< OrientationInfo(NORMAL, QTransform(), JXFORM_NONE)
<< OrientationInfo(HFLIP, hflip, JXFORM_FLIP_H)
<< OrientationInfo(ROT_180, createRotMatrix(180), JXFORM_ROT_180)
<< OrientationInfo(VFLIP, vflip, JXFORM_FLIP_V)
......@@ -417,7 +417,7 @@ void JpegContent::transform(Orientation orientation)
}
#if 0
static void dumpMatrix(const QMatrix& matrix)
static void dumpMatrix(const QTransform& matrix)
{
qDebug() << "matrix | " << matrix.m11() << ", " << matrix.m12() << " |\n";
qDebug() << " | " << matrix.m21() << ", " << matrix.m22() << " |\n";
......@@ -425,7 +425,7 @@ static void dumpMatrix(const QMatrix& matrix)
}
#endif
static bool matricesAreSame(const QMatrix& m1, const QMatrix& m2, double tolerance)
static bool matricesAreSame(const QTransform& m1, const QTransform& m2, double tolerance)
{
return fabs(m1.m11() - m2.m11()) < tolerance
&& fabs(m1.m12() - m2.m12()) < tolerance
......@@ -435,7 +435,7 @@ static bool matricesAreSame(const QMatrix& m1, const QMatrix& m2, double toleran
&& fabs(m1.dy() - m2.dy()) < tolerance;
}
static JXFORM_CODE findJxform(const QMatrix& matrix)
static JXFORM_CODE findJxform(const QTransform& matrix)
{
OrientationInfoList::ConstIterator it(orientationInfoList().begin()), end(orientationInfoList().end());
for (; it != end; ++it) {
......@@ -638,7 +638,7 @@ void JpegContent::setImage(const QImage& image)
resetOrientation();
d->mPendingTransformation = false;
d->mTransformMatrix = QMatrix();
d->mTransformMatrix = QTransform();
}
} // namespace
......@@ -77,7 +77,7 @@ struct PrintOptionsPagePrivate : public Ui_PrintOptionsPage
);
QGridLayout* layout = new QGridLayout(mPositionFrame);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(1);
for (int row = 0; row < 3; ++row) {
for (int col = 0; col < 3; ++col) {
......
......@@ -64,7 +64,7 @@ ResizeImageDialog::ResizeImageDialog(QWidget* parent)
connect(buttonBox, &QDialogButtonBox::rejected, this, &ResizeImageDialog::reject);
mainLayout->addWidget(buttonBox);
content->layout()->setMargin(0);
content->layout()->setContentsMargins(0, 0, 0, 0);
KGuiItem::assign(okButton, KGuiItem(i18n("Resize"), QStringLiteral("transform-scale")));
setWindowTitle(content->windowTitle());
d->mWidthSpinBox->setFocus();
......
......@@ -155,7 +155,7 @@ struct TagWidgetPrivate
q, SLOT(addTagFromComboBox()));
QVBoxLayout* layout = new QVBoxLayout(q);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(mListView);
QHBoxLayout* hLayout = new QHBoxLayout;
......
......@@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// Qt
#include <QImageReader>
#include <QMatrix>
#include <QTransform>
#include <QBuffer>
namespace Gwenview
......@@ -128,7 +128,7 @@ bool ThumbnailContext::load(const QString &pixPath, int pixelSize)
if (qMax(thumbnail.width(), thumbnail.height()) >= pixelSize) {
mImage = thumbnail;
if (orientation != NORMAL && orientation != NOT_AVAILABLE) {
QMatrix matrix = ImageUtils::transformMatrix(orientation);
QTransform matrix = ImageUtils::transformMatrix(orientation);
mImage = mImage.transformed(matrix);
}
mOriginalWidth = content.size().width();
......
......@@ -75,7 +75,7 @@ ZoomSlider::ZoomSlider(QWidget* parent)
d->mSlider->setOrientation(Qt::Horizontal);
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(d->mZoomOutButton);
layout->addWidget(d->mSlider);
......
......@@ -120,7 +120,7 @@ ZoomWidget::ZoomWidget(QWidget* parent)
// Layout
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(d->mZoomToFitButton);
layout->addWidget(d->mZoomToFillButton);
......
......@@ -358,7 +358,7 @@ void DocumentTest::testLoadRotated()
QImage image;
bool ok = image.load(url.toLocalFile());
QVERIFY2(ok, "Could not load 'orient6.jpg'");
QMatrix matrix = ImageUtils::transformMatrix(ROT_90);
QTransform matrix = ImageUtils::transformMatrix(ROT_90);
image = image.transformed(matrix);
Document::Ptr doc = DocumentFactory::instance()->load(url);
......
......@@ -47,7 +47,7 @@ struct TestWindow : public QWidget
mMainWidget = new QTextEdit();
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setSpacing(0);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(mMainWidget);
layout->addWidget(mContainer);
}
......
......@@ -54,7 +54,7 @@ void TransformImageOperationTest::testRotate90()
bool ok = image.load(url.toLocalFile());
QVERIFY2(ok, "Could not load 'test.png'");
QMatrix matrix = ImageUtils::transformMatrix(ROT_90);
QTransform matrix = ImageUtils::transformMatrix(ROT_90);
image = image.transformed(matrix);
Document::Ptr doc = DocumentFactory::instance()->load(url);
......
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