summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koller <[email protected]>2015-02-08 23:43:20 +0100
committerMartin Koller <[email protected]>2015-02-08 23:43:20 +0100
commit8ee1df94b0091d01f7e87759017fa97ffe6f8869 (patch)
treefc637ef6803cb76d4921c37479ef1f97d9a064ad
parent35a5fdf0177fea6d2fc46437ca5816fac22c846a (diff)
more KF5 changes
-rw-r--r--dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp45
-rw-r--r--dialogs/imagelib/transforms/kpTransformResizeScaleDialog.h11
-rw-r--r--dialogs/imagelib/transforms/kpTransformSkewDialog.cpp20
-rw-r--r--dialogs/imagelib/transforms/kpTransformSkewDialog.h11
-rw-r--r--dialogs/kpColorSimilarityDialog.cpp14
-rw-r--r--document/kpDocument_Save.cpp1
-rw-r--r--mainWindow/kpMainWindow_File.cpp10
-rw-r--r--widgets/imagelib/effects/kpEffectBalanceWidget.cpp1
-rw-r--r--widgets/imagelib/effects/kpEffectEmbossWidget.h2
9 files changed, 49 insertions, 66 deletions
diff --git a/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp b/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp
index 4bab872..465ad3c 100644
--- a/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp
+++ b/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp
@@ -45,6 +45,8 @@
#include <qpixmap.h>
#include <qsize.h>
#include <qtoolbutton.h>
+#include <QSpinBox>
+#include <QDoubleSpinBox>
#include <kconfig.h>
#include <kconfiggroup.h>
@@ -52,7 +54,6 @@
#include <kiconeffect.h>
#include <kiconloader.h>
#include <klocale.h>
-#include <knuminput.h>
#include <kpAbstractSelection.h>
#include <kpDefs.h>
@@ -121,7 +122,7 @@ kpTransformResizeScaleDialog::kpTransformResizeScaleDialog (
slotActOnChanged ();
- m_newWidthInput->setEditFocus ();
+ m_newWidthInput->setFocus ();
//enableButtonOk (!isNoOp ());
}
@@ -286,33 +287,33 @@ QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseW
heightLabel->setAlignment (heightLabel->alignment () | Qt::AlignHCenter);
QLabel *originalLabel = new QLabel (i18n ("Original:"), dimensionsGroupBox);
- m_originalWidthInput = new KIntNumInput (
- document ()->width ((bool) selection ()),
- dimensionsGroupBox);
+ m_originalWidthInput = new QSpinBox;
+ m_originalWidthInput->setValue(document()->width((bool)selection()));
QLabel *xLabel0 = new QLabel (i18n ("x"), dimensionsGroupBox);
- m_originalHeightInput = new KIntNumInput (
- document ()->height ((bool) selection ()),
- dimensionsGroupBox);
+ m_originalHeightInput = new QSpinBox;
+ m_originalHeightInput->setValue(document()->height((bool)selection()));
QLabel *newLabel = new QLabel (i18n ("&New:"), dimensionsGroupBox);
- m_newWidthInput = new KIntNumInput (dimensionsGroupBox);
+ m_newWidthInput = new QSpinBox;
QLabel *xLabel1 = new QLabel (i18n ("x"), dimensionsGroupBox);
- m_newHeightInput = new KIntNumInput (dimensionsGroupBox);
+ m_newHeightInput = new QSpinBox;
QLabel *percentLabel = new QLabel (i18n ("&Percent:"), dimensionsGroupBox);
- m_percentWidthInput = new KDoubleNumInput (0.01/*lower*/, 1000000/*upper*/,
- 100/*value*/,
- dimensionsGroupBox,
- 1/*step*/,
- 2/*precision*/);
- m_percentWidthInput->setSuffix (i18n ("%"));
+ m_percentWidthInput = new QDoubleSpinBox;
+ m_percentWidthInput->setRange(0.01, 1000000);
+ m_percentWidthInput->setValue(100);
+ m_percentWidthInput->setSingleStep(1);
+ m_percentWidthInput->setDecimals(2);
+ m_percentWidthInput->setSuffix(i18n("%"));
+
QLabel *xLabel2 = new QLabel (i18n ("x"), dimensionsGroupBox);
- m_percentHeightInput = new KDoubleNumInput (0.01/*lower*/, 1000000/*upper*/,
- 100/*value*/,
- dimensionsGroupBox,
- 1/*step*/,
- 2/*precision*/);
- m_percentHeightInput->setSuffix (i18n ("%"));
+
+ m_percentHeightInput = new QDoubleSpinBox;
+ m_percentHeightInput->setRange(0.01, 1000000);
+ m_percentHeightInput->setValue(100);
+ m_percentHeightInput->setSingleStep(1);
+ m_percentHeightInput->setDecimals(2);
+ m_percentHeightInput->setSuffix(i18n("%"));
m_keepAspectRatioCheckBox = new QCheckBox (i18n ("Keep &aspect ratio"),
dimensionsGroupBox);
diff --git a/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.h b/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.h
index 6543384..c9ab419 100644
--- a/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.h
+++ b/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.h
@@ -39,9 +39,8 @@ class QCheckBox;
class QComboBox;
class QGroupBox;
class QToolButton;
-
-class KDoubleNumInput;
-class KIntNumInput;
+class QSpinBox;
+class QDoubleSpinBox;
class kpAbstractSelection;
class kpDocument;
@@ -109,9 +108,9 @@ Q_OBJECT
*m_scaleButton,
*m_smoothScaleButton;
- KIntNumInput *m_originalWidthInput, *m_originalHeightInput,
- *m_newWidthInput, *m_newHeightInput;
- KDoubleNumInput *m_percentWidthInput, *m_percentHeightInput;
+ QSpinBox *m_originalWidthInput, *m_originalHeightInput,
+ *m_newWidthInput, *m_newHeightInput;
+ QDoubleSpinBox *m_percentWidthInput, *m_percentHeightInput;
QCheckBox *m_keepAspectRatioCheckBox;
int m_ignoreKeepAspectRatio;
diff --git a/dialogs/imagelib/transforms/kpTransformSkewDialog.cpp b/dialogs/imagelib/transforms/kpTransformSkewDialog.cpp
index 53a2dd7..d8718e0 100644
--- a/dialogs/imagelib/transforms/kpTransformSkewDialog.cpp
+++ b/dialogs/imagelib/transforms/kpTransformSkewDialog.cpp
@@ -1,4 +1,3 @@
-
/*
Copyright (c) 2003-2007 Clarence Dang <[email protected]>
All rights reserved.
@@ -40,12 +39,11 @@
#include <qpushbutton.h>
#include <qmatrix.h>
#include <QImage>
-#include <qpolygon.h>
+#include <QSpinBox>
#include <kdebug.h>
#include <kiconloader.h>
#include <klocale.h>
-#include <knuminput.h>
#include <kpDefs.h>
#include <kpDocument.h>
@@ -86,7 +84,7 @@ kpTransformSkewDialog::kpTransformSkewDialog (bool actOnSelection,
slotUpdate ();
- m_horizontalSkewInput->setEditFocus ();
+ m_horizontalSkewInput->setFocus ();
}
kpTransformSkewDialog::~kpTransformSkewDialog ()
@@ -106,9 +104,10 @@ void kpTransformSkewDialog::createAngleGroupBox ()
horizontalSkewPixmapLabel->setPixmap (UserIcon ("image_skew_horizontal"));
QLabel *horizontalSkewLabel = new QLabel (i18n ("&Horizontal:"), angleGroupBox);
- m_horizontalSkewInput = new KIntNumInput (s_lastHorizontalAngle, angleGroupBox);
- m_horizontalSkewInput->setMinimum (-89);
- m_horizontalSkewInput->setMaximum (+89);
+ m_horizontalSkewInput = new QSpinBox;
+ m_horizontalSkewInput->setValue(s_lastHorizontalAngle);
+ m_horizontalSkewInput->setMinimum(-89);
+ m_horizontalSkewInput->setMaximum(+89);
QLabel *horizontalSkewDegreesLabel = new QLabel (i18n ("degrees"), angleGroupBox);
@@ -117,9 +116,10 @@ void kpTransformSkewDialog::createAngleGroupBox ()
verticalSkewPixmapLabel->setPixmap (UserIcon ("image_skew_vertical"));
QLabel *verticalSkewLabel = new QLabel (i18n ("&Vertical:"), angleGroupBox);
- m_verticalSkewInput = new KIntNumInput (s_lastVerticalAngle, angleGroupBox);
- m_verticalSkewInput->setMinimum (-89);
- m_verticalSkewInput->setMaximum (+89);
+ m_verticalSkewInput = new QSpinBox;
+ m_verticalSkewInput->setValue(s_lastVerticalAngle);
+ m_verticalSkewInput->setMinimum(-89);
+ m_verticalSkewInput->setMaximum(+89);
QLabel *verticalSkewDegreesLabel = new QLabel (i18n ("degrees"), angleGroupBox);
diff --git a/dialogs/imagelib/transforms/kpTransformSkewDialog.h b/dialogs/imagelib/transforms/kpTransformSkewDialog.h
index 7c78897..6a385d0 100644
--- a/dialogs/imagelib/transforms/kpTransformSkewDialog.h
+++ b/dialogs/imagelib/transforms/kpTransformSkewDialog.h
@@ -1,4 +1,3 @@
-
/*
Copyright (c) 2003-2007 Clarence Dang <[email protected]>
All rights reserved.
@@ -29,16 +28,10 @@
#ifndef kpTransformSkewDialog_H
#define kpTransformSkewDialog_H
-
-#include <qpixmap.h>
-
#include <kpColor.h>
#include <kpTransformPreviewDialog.h>
-
-class QPixmap;
-
-class KIntNumInput;
+class QSpinBox;
class kpTransformSkewDialog : public kpTransformPreviewDialog
@@ -83,7 +76,7 @@ private slots:
virtual void accept ();
private:
- KIntNumInput *m_horizontalSkewInput, *m_verticalSkewInput;
+ QSpinBox *m_horizontalSkewInput, *m_verticalSkewInput;
};
diff --git a/dialogs/kpColorSimilarityDialog.cpp b/dialogs/kpColorSimilarityDialog.cpp
index 2d52ab1..22b259e 100644
--- a/dialogs/kpColorSimilarityDialog.cpp
+++ b/dialogs/kpColorSimilarityDialog.cpp
@@ -141,17 +141,5 @@ void kpColorSimilarityDialog::slotColorSimilarityValueChanged ()
// private slot
void kpColorSimilarityDialog::slotWhatIsLabelClicked ()
{
- QWhatsThis::showText (QCursor::pos (), m_colorSimilarityFrame->whatsThis (),
- this);
-
- // LOTODO: It looks weird with the focus rectangle.
- // It's also very hard for the user to make it lose focus for some reason
- // (you must click on the label - nowhere else will work).
- //
- // This doesn't work - I don't know why:
- // m_whatIsLabel->clearFocus ();
- //
- // Maybe it's a weird kind of focus?
+ QWhatsThis::showText(QCursor::pos(), m_colorSimilarityFrame->whatsThis(), this);
}
-
-
diff --git a/document/kpDocument_Save.cpp b/document/kpDocument_Save.cpp
index a767d11..345ce43 100644
--- a/document/kpDocument_Save.cpp
+++ b/document/kpDocument_Save.cpp
@@ -1,4 +1,3 @@
-
/*
Copyright (c) 2003-2007 Clarence Dang <[email protected]>
All rights reserved.
diff --git a/mainWindow/kpMainWindow_File.cpp b/mainWindow/kpMainWindow_File.cpp
index 529f13e..2d6a32e 100644
--- a/mainWindow/kpMainWindow_File.cpp
+++ b/mainWindow/kpMainWindow_File.cpp
@@ -54,7 +54,7 @@
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kdebug.h>
-#include <KIntSpinBox>
+#include <KPluralHandlingSpinBox>
#include <kfiledialog.h>
#include <kiconloader.h>
#include <kio/netaccess.h>
@@ -444,7 +444,11 @@ QList<QUrl> kpMainWindow::askForOpenURLs(const QString &caption, bool allowMulti
filter += glob;
- filterList << mime.comment() + QStringLiteral(" (") + glob + QLatin1Char(')');
+ // I want to show the mime comment AND the file glob pattern,
+ // but to avoid that the "All Supported Files" entry shows ALL glob patterns,
+ // I must add the pattern here a second time so that QFileDialog::HideNameFilterDetails
+ // can hide the first pattern and I still see the second one
+ filterList << mime.comment() + QString(" (%1)(%2)").arg(glob).arg(glob);
}
}
@@ -661,7 +665,7 @@ void kpMainWindow::slotScreenshot()
connect (buttons, SIGNAL (rejected()), dialog, SLOT (reject()));
QLabel *label = new QLabel(i18n("Snapshot Delay"));
- KIntSpinBox *seconds = new KIntSpinBox;
+ KPluralHandlingSpinBox *seconds = new KPluralHandlingSpinBox;
seconds->setRange(0, 99);
seconds->setSuffix(ki18np(" second", " seconds"));
seconds->setSpecialValueText(i18n("No delay"));
diff --git a/widgets/imagelib/effects/kpEffectBalanceWidget.cpp b/widgets/imagelib/effects/kpEffectBalanceWidget.cpp
index d24f736..017fa97 100644
--- a/widgets/imagelib/effects/kpEffectBalanceWidget.cpp
+++ b/widgets/imagelib/effects/kpEffectBalanceWidget.cpp
@@ -1,4 +1,3 @@
-
/*
Copyright (c) 2003-2007 Clarence Dang <[email protected]>
All rights reserved.
diff --git a/widgets/imagelib/effects/kpEffectEmbossWidget.h b/widgets/imagelib/effects/kpEffectEmbossWidget.h
index 08314b8..f53db28 100644
--- a/widgets/imagelib/effects/kpEffectEmbossWidget.h
+++ b/widgets/imagelib/effects/kpEffectEmbossWidget.h
@@ -36,7 +36,7 @@
class QCheckBox;
-class KIntNumInput;
+//class KIntNumInput;
class kpEffectEmbossWidget : public kpEffectWidgetBase