Commit 57ced240 authored by Christoph Feck's avatar Christoph Feck
Browse files

KDialog -> QDialog

parent 0a0080b8
......@@ -28,7 +28,6 @@
#include <kpEffectCommandBase.h>
#include <kdialog.h>
#include <klocale.h>
#include <kpDefs.h>
......
......@@ -28,7 +28,6 @@
#include <kpDocumentMetaInfoCommand.h>
#include <kdialog.h>
#include <klocale.h>
#include <kpDefs.h>
......
......@@ -32,8 +32,6 @@
#include <qpixmap.h>
#include <kdialog.h>
#include <kpColor.h>
#include <kpCommand.h>
#include <kpImage.h>
......
......@@ -32,6 +32,7 @@
#include <kpDocumentMetaInfoDialog.h>
#include <QAbstractItemView>
#include <QDialogButtonBox>
#include <QLabel>
#include <QGroupBox>
#include <QGridLayout>
......@@ -112,17 +113,23 @@ kpDocumentMetaInfoDialog::kpDocumentMetaInfoDialog (
const kpDocumentMetaInfo *docMetaInfo,
QWidget *parent)
: KDialog (parent),
: QDialog (parent),
d (new kpDocumentMetaInfoDialogPrivate ())
{
d->originalMetaInfoPtr = docMetaInfo;
setCaption (i18nc ("@title:window", "Document Properties"));
setButtons (KDialog::Ok | KDialog::Cancel);
setWindowTitle (i18nc ("@title:window", "Document Properties"));
QDialogButtonBox * buttons = new QDialogButtonBox (QDialogButtonBox::Ok |
QDialogButtonBox::Cancel, this);
connect (buttons, SIGNAL (accepted()), this, SLOT (accept()));
connect (buttons, SIGNAL (rejected()), this, SLOT (reject()));
QWidget *baseWidget = new QWidget (this);
setMainWidget (baseWidget);
QVBoxLayout *dialogLayout = new QVBoxLayout (this);
dialogLayout->addWidget (baseWidget);
dialogLayout->addWidget (buttons);
//
......@@ -776,7 +783,7 @@ void kpDocumentMetaInfoDialog::accept ()
return;
}
KDialog::accept ();
QDialog::accept ();
}
......
......@@ -30,7 +30,7 @@
#define kpDocumentMetaInfoDialog_H
#include <kdialog.h>
#include <QDialog>
class QTableWidgetItem;
......@@ -48,7 +48,7 @@ class kpDocumentMetaInfo;
// The Text Fields widget always keeps an empty key-value row at the bottom.
// If text is entered in this row, a new one is created. This allows users
// to add new rows without pressing any pushbuttons.
class kpDocumentMetaInfoDialog : public KDialog
class kpDocumentMetaInfoDialog : public QDialog
{
Q_OBJECT
......@@ -74,7 +74,7 @@ public:
// If all data in the UI is valid and <errorMessage> is set, an empty
// string will be returned through it.
//
// If KDialog::exec() succeeded, all data in the UI was valid so the
// If QDialog::exec() succeeded, all data in the UI was valid so the
// returned meta information will be complete and correct.
//
// This is a slow method as it recalculates the meta information each
......
......@@ -33,6 +33,7 @@
#include <qapplication.h>
#include <qboxlayout.h>
#include <qdialogbuttonbox.h>
#include <qgridlayout.h>
#include <qgroupbox.h>
#include <qlabel.h>
......@@ -58,7 +59,7 @@ kpTransformPreviewDialog::kpTransformPreviewDialog (Features features,
bool actOnSelection,
kpTransformDialogEnvironment *_env,
QWidget *parent)
: KDialog (parent),
: QDialog (parent),
m_afterActionText (afterActionText),
m_actOnSelection (actOnSelection),
m_dimensionsGroupBox (0),
......@@ -68,10 +69,18 @@ kpTransformPreviewDialog::kpTransformPreviewDialog (Features features,
m_gridLayout (0),
m_environ (_env)
{
setCaption (caption);
setButtons (KDialog::Ok | KDialog::Cancel);
setWindowTitle (caption);
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok |
QDialogButtonBox::Cancel, this);
connect (buttons, SIGNAL (accepted()), this, SLOT (accept()));
connect (buttons, SIGNAL (rejected()), this, SLOT (reject()));
QWidget *baseWidget = new QWidget (this);
setMainWidget (baseWidget);
m_mainWidget = baseWidget;
QVBoxLayout *dialogLayout = new QVBoxLayout (this);
dialogLayout->addWidget (baseWidget);
dialogLayout->addWidget (buttons);
if (document ())
......@@ -185,6 +194,11 @@ kpDocument *kpTransformPreviewDialog::document () const
return m_environ->document ();
}
// protected
QWidget *kpTransformPreviewDialog::mainWidget () const
{
return m_mainWidget;
}
// protected
void kpTransformPreviewDialog::addCustomWidgetToFront (QWidget *w)
......@@ -203,7 +217,7 @@ void kpTransformPreviewDialog::addCustomWidget (QWidget *w)
// public override [base QWidget]
void kpTransformPreviewDialog::setUpdatesEnabled (bool enable)
{
KDialog::setUpdatesEnabled (enable);
QDialog::setUpdatesEnabled (enable);
if (enable)
slotUpdateWithWaitCursor ();
......
......@@ -30,10 +30,9 @@
#define kpTransformPreviewDialog_H
#include <QDialog>
#include <qpixmap.h>
#include <kdialog.h>
class QLabel;
class QGridLayout;
......@@ -45,7 +44,7 @@ class kpResizeSignallingLabel;
class kpTransformDialogEnvironment;
class kpTransformPreviewDialog : public KDialog
class kpTransformPreviewDialog : public QDialog
{
Q_OBJECT
......@@ -78,6 +77,8 @@ public:
protected:
kpDocument *document () const;
QWidget *mainWidget () const;
// All widgets must have mainWidget() as their parent
void addCustomWidgetToFront (QWidget *w); // see <reserveTopRow> in ctor
void addCustomWidget (QWidget *w);
......@@ -126,6 +127,7 @@ protected:
int m_oldWidth, m_oldHeight;
QWidget *m_mainWidget;
QGroupBox *m_dimensionsGroupBox;
QLabel *m_afterTransformDimensionsLabel;
......
......@@ -36,6 +36,7 @@
#include <qboxlayout.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qdialogbuttonbox.h>
#include <qgridlayout.h>
#include <qgroupbox.h>
#include <qlabel.h>
......@@ -46,6 +47,7 @@
#include <kcombobox.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kdebug.h>
#include <kiconeffect.h>
#include <kiconloader.h>
......@@ -84,16 +86,22 @@
kpTransformResizeScaleDialog::kpTransformResizeScaleDialog (
kpTransformDialogEnvironment *_env, QWidget *parent)
: KDialog (parent),
: QDialog (parent),
m_environ (_env),
m_ignoreKeepAspectRatio (0),
m_lastType(kpTransformResizeScaleCommand::Resize)
{
setCaption( i18nc ("@title:window", "Resize / Scale") );
setButtons( KDialog::Ok | KDialog::Cancel);
setWindowTitle (i18nc ("@title:window", "Resize / Scale"));
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok |
QDialogButtonBox::Cancel, this);
connect (buttons, SIGNAL (accepted()), this, SLOT (accept()));
connect (buttons, SIGNAL (rejected()), this, SLOT (reject()));
QWidget *baseWidget = new QWidget (this);
setMainWidget (baseWidget);
QVBoxLayout *dialogLayout = new QVBoxLayout (this);
dialogLayout->addWidget (baseWidget);
dialogLayout->addWidget (buttons);
QWidget *actOnBox = createActOnBox(baseWidget);
QGroupBox *operationGroupBox = createOperationGroupBox(baseWidget);
......@@ -795,7 +803,7 @@ void kpTransformResizeScaleDialog::accept ()
continueButtonText,
this))
{
KDialog::accept ();
QDialog::accept ();
}
// store settings
......
......@@ -29,7 +29,7 @@
#ifndef kpTransformResizeScaleDialog_H
#define kpTransformResizeScaleDialog_H
#include <kdialog.h>
#include <QDialog>
#include <kpColor.h>
#include <kpTransformResizeScaleCommand.h>
......@@ -49,7 +49,7 @@ class kpTextSelection;
class kpTransformDialogEnvironment;
class kpTransformResizeScaleDialog : public KDialog
class kpTransformResizeScaleDialog : public QDialog
{
Q_OBJECT
......
......@@ -303,7 +303,7 @@ void kpTransformRotateDialog::accept ()
continueButtonText,
this))
{
KDialog::accept ();
QDialog::accept ();
}
}
......
......@@ -286,7 +286,7 @@ void kpTransformSkewDialog::accept ()
continueButtonText,
this))
{
KDialog::accept ();
QDialog::accept ();
}
}
......
......@@ -29,6 +29,7 @@
#include <kpColorSimilarityDialog.h>
#include <qboxlayout.h>
#include <qdialogbuttonbox.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlayout.h>
......@@ -42,13 +43,19 @@
kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
: KDialog (parent)
: QDialog (parent)
{
setCaption (i18nc ("@title:window", "Color Similarity"));
setButtons (KDialog::Ok | KDialog::Cancel);
setWindowTitle (i18nc ("@title:window", "Color Similarity"));
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok |
QDialogButtonBox::Cancel, this);
connect (buttons, SIGNAL (accepted()), this, SLOT (accept()));
connect (buttons, SIGNAL (rejected()), this, SLOT (reject()));
QWidget *baseWidget = new QWidget (this);
setMainWidget (baseWidget);
QVBoxLayout *dialogLayout = new QVBoxLayout (this);
dialogLayout->addWidget (baseWidget);
dialogLayout->addWidget (buttons);
QGroupBox *cubeGroupBox = new QGroupBox (i18n ("Preview"), baseWidget);
......
......@@ -30,7 +30,7 @@
#define KP_COLOR_SIMILARITY_DIALOG_H
#include <kdialog.h>
#include <QDialog>
class QLabel;
......@@ -42,7 +42,7 @@ class kpColorSimilarityFrame;
// LOTODO: Why doesn't this dialog automatically enforce a minimum size
// based on layout magic, like Image -> Resize / Scale?
class kpColorSimilarityDialog : public KDialog
class kpColorSimilarityDialog : public QDialog
{
Q_OBJECT
......
......@@ -38,7 +38,6 @@
#include <kconfig.h>
#include <kdebug.h>
#include <kdialog.h>
#include <klocale.h>
#include <kpCommandSize.h>
......@@ -56,11 +55,6 @@ const QSize kpDocumentSaveOptionsPreviewDialog::s_pixmapLabelMinimumSize (25, 25
kpDocumentSaveOptionsPreviewDialog::kpDocumentSaveOptionsPreviewDialog (
QWidget *parent )
: kpSubWindow (parent),
#if 0
KDialogBase (parent, name, false/*non-modal*/,
i18n ("Save Preview"),
0/*no buttons*/),
#endif
m_filePixmap (0),
m_fileSize (0)
{
......
......@@ -35,6 +35,8 @@
#include <qaction.h>
#include <qdatastream.h>
#include <QDesktopWidget>
#include <QDialog>
#include <QDialogButtonBox>
#include <qpainter.h>
#include <qpixmap.h>
#include <qsize.h>
......@@ -46,7 +48,6 @@
#include <QCheckBox>
#include <QVBoxLayout>
#include <kdialog.h>
#include <kactioncollection.h>
#include <kconfig.h>
#include <kconfiggroup.h>
......@@ -642,8 +643,11 @@ void kpMainWindow::slotScreenshot()
{
toolEndShape();
KDialog *dialog = new KDialog(this);
dialog->setButtons(KDialog::Ok | KDialog::Cancel);
QDialog *dialog = new QDialog(this);
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok |
QDialogButtonBox::Cancel, dialog);
connect (buttons, SIGNAL (accepted()), dialog, SLOT (accept()));
connect (buttons, SIGNAL (rejected()), dialog, SLOT (reject()));
QLabel *label = new QLabel(i18n("Snapshot Delay"));
KIntSpinBox *seconds = new KIntSpinBox;
......@@ -654,12 +658,13 @@ void kpMainWindow::slotScreenshot()
QCheckBox *hideWindow = new QCheckBox(i18n("Hide Main Window"));
hideWindow->setChecked(true);
QVBoxLayout *vbox = new QVBoxLayout(dialog->mainWidget());
QVBoxLayout *vbox = new QVBoxLayout(dialog);
vbox->addWidget(label);
vbox->addWidget(seconds);
vbox->addWidget(hideWindow);
vbox->addWidget(buttons);
if ( dialog->exec() == KDialog::Rejected )
if ( dialog->exec() == QDialog::Rejected )
{
delete dialog;
return;
......
......@@ -37,7 +37,6 @@
#include <kcolorbutton.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kdialog.h>
#include <kdebug.h>
#include <klocale.h>
......
......@@ -28,8 +28,6 @@
#include <kpEffectWidgetBase.h>
#include <KDialog>
kpEffectWidgetBase::kpEffectWidgetBase (bool actOnSelection,
QWidget *parent)
......
......@@ -44,7 +44,6 @@
#include <kcombobox.h>
#include <kconfig.h>
#include <kdebug.h>
#include <kdialog.h>
#include <kimageio.h>
#include <klocale.h>
#include <knuminput.h>
......
......@@ -37,7 +37,6 @@
#include <QPrinter>
#include <KDebug>
#include <KDialog>
#include <KLocale>
#include <kpDefs.h>
......
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