summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-15 14:40:30 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-15 14:40:30 (GMT)
commit4ec60eff3d58f17c100b20c2f39ae90cc4287a76 (patch)
tree1125c29ec46b7ab29b1cf7b1ebc2743b19a02091
parentd3970cf40bf0cc4b26e3d5d1d89e66d378761f1d (diff)
Port away from KDialog::marginHint()
-rw-r--r--app/fullscreencontent.cpp2
-rw-r--r--app/imagemetainfodialog.cpp6
-rw-r--r--lib/crop/cropwidget.cpp2
-rw-r--r--lib/graphicswidgetfloater.cpp9
-rw-r--r--lib/thumbnailview/thumbnailbarview.cpp2
-rw-r--r--lib/widgetfloater.cpp9
6 files changed, 14 insertions, 16 deletions
diff --git a/app/fullscreencontent.cpp b/app/fullscreencontent.cpp
index d803087..b2e7363 100644
--- a/app/fullscreencontent.cpp
+++ b/app/fullscreencontent.cpp
@@ -81,7 +81,7 @@ public:
void addSeparator()
{
- mLayout->addSpacing(KDialog::spacingHint());
+ mLayout->addSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
}
void addStretch()
diff --git a/app/imagemetainfodialog.cpp b/app/imagemetainfodialog.cpp
index 6fa477a..a1e8d79 100644
--- a/app/imagemetainfodialog.cpp
+++ b/app/imagemetainfodialog.cpp
@@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "imagemetainfodialog.h"
// Qt
+#include <QApplication>
#include <QHeaderView>
#include <QPainter>
#include <QStyledItemDelegate>
@@ -49,7 +50,7 @@ public:
protected:
virtual void paint(QPainter* painter, const QStyleOptionViewItem& _option, const QModelIndex& index) const
{
- QStyleOptionViewItemV4 option = _option;
+ QStyleOptionViewItem option = _option;
if (!index.parent().isValid()) {
option.displayAlignment = Qt::AlignCenter | Qt::AlignBottom;
option.font.setBold(true);
@@ -144,7 +145,8 @@ void ImageMetaInfoDialog::setMetaInfo(ImageMetaInfoModel* model, const QStringLi
}
d->mTreeView->setModel(d->mModel.get());
- d->mTreeView->header()->resizeSection(0, sizeHint().width() / 2 - KDialog::marginHint() * 2);
+ const int marginSize = QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin);
+ d->mTreeView->header()->resizeSection(0, sizeHint().width() / 2 - marginSize * 2);
}
QSize ImageMetaInfoDialog::sizeHint() const
diff --git a/lib/crop/cropwidget.cpp b/lib/crop/cropwidget.cpp
index fa2a195..dd2d410 100644
--- a/lib/crop/cropwidget.cpp
+++ b/lib/crop/cropwidget.cpp
@@ -29,7 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QLineEdit>
// KDE
-#include <KDialog>
#include <KLocalizedString>
// Local
@@ -206,7 +205,6 @@ CropWidget::CropWidget(QWidget* parent, RasterImageView* imageView, CropTool* cr
d->mCropTool = cropTool;
d->setupUi(this);
setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
- layout()->setMargin(KDialog::marginHint());
layout()->setSizeConstraint(QLayout::SetFixedSize);
connect(d->advancedCheckBox, SIGNAL(toggled(bool)),
diff --git a/lib/graphicswidgetfloater.cpp b/lib/graphicswidgetfloater.cpp
index 5424ca8..d0a4b80 100644
--- a/lib/graphicswidgetfloater.cpp
+++ b/lib/graphicswidgetfloater.cpp
@@ -22,12 +22,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include "graphicswidgetfloater.h"
// Qt
+#include <QApplication>
#include <QEvent>
#include <QGraphicsWidget>
#include <QPointer>
-
-// KDE
-#include <KDialog>
+#include <QStyle>
// Local
@@ -101,8 +100,8 @@ GraphicsWidgetFloater::GraphicsWidgetFloater(QGraphicsWidget* parent)
d->mParent->installEventFilter(this);
d->mChild = 0;
d->mAlignment = Qt::AlignCenter;
- d->mHorizontalMargin = KDialog::marginHint();
- d->mVerticalMargin = KDialog::marginHint();
+ d->mHorizontalMargin = QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin);
+ d->mVerticalMargin = d->mHorizontalMargin;
d->mInsideUpdateChildGeometry = false;
}
diff --git a/lib/thumbnailview/thumbnailbarview.cpp b/lib/thumbnailview/thumbnailbarview.cpp
index bc17ad0..b7bb095 100644
--- a/lib/thumbnailview/thumbnailbarview.cpp
+++ b/lib/thumbnailview/thumbnailbarview.cpp
@@ -199,7 +199,7 @@ void ThumbnailBarItemDelegate::paint(QPainter * painter, const QStyleOptionViewI
QPixmap thumbnailPix = d->mView->thumbnailForIndex(index);
QRect rect = option.rect;
- QStyleOptionViewItemV4 opt = option;
+ QStyleOptionViewItem opt = option;
const QWidget* widget = opt.widget;
QStyle* style = widget ? widget->style() : QApplication::style();
if (isSelected && !isCurrent) {
diff --git a/lib/widgetfloater.cpp b/lib/widgetfloater.cpp
index 03efc87..e7516b4 100644
--- a/lib/widgetfloater.cpp
+++ b/lib/widgetfloater.cpp
@@ -22,13 +22,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include "widgetfloater.h"
// Qt
+#include <QApplication>
#include <QEvent>
#include <QPointer>
+#include <QStyle>
#include <QWidget>
-// KDE
-#include <KDialog>
-
// Local
namespace Gwenview
@@ -101,8 +100,8 @@ WidgetFloater::WidgetFloater(QWidget* parent)
d->mParent->installEventFilter(this);
d->mChild = 0;
d->mAlignment = Qt::AlignCenter;
- d->mHorizontalMargin = KDialog::marginHint();
- d->mVerticalMargin = KDialog::marginHint();
+ d->mHorizontalMargin = QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin);
+ d->mVerticalMargin = d->mHorizontalMargin;
d->mInsideUpdateChildGeometry = false;
}