Commit 460f6750 authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark
Browse files

port WindowDefinitionDialog away from kdialog

parent 96174caa
...@@ -22,7 +22,9 @@ ...@@ -22,7 +22,9 @@
#include "qwindowdefs.h" #include "qwindowdefs.h"
#include <QWidget> #include <QWidget>
#include <KDialog> #include <QDialog>
#include <QDialogButtonBox>
#include <QVBoxLayout>
namespace Ui { namespace Ui {
...@@ -77,19 +79,31 @@ private: ...@@ -77,19 +79,31 @@ private:
}; };
class WindowDefinitionDialog : public KDialog class WindowDefinitionDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
WindowDefinitionDialog( KHotKeys::Windowdef_simple *windowdef, QWidget *parent=nullptr) WindowDefinitionDialog( KHotKeys::Windowdef_simple *windowdef, QWidget *parent=nullptr)
: KDialog(parent) : QDialog(parent)
,def(nullptr) ,def(nullptr)
{ {
setLayout(new QVBoxLayout);
def = new WindowDefinitionWidget(windowdef, this); def = new WindowDefinitionWidget(windowdef, this);
setMainWidget(def);
def->copyFromObject(); def->copyFromObject();
layout()->addWidget(def);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
| QDialogButtonBox::Cancel);
layout()->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accepted);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::rejected);
} }
...@@ -102,7 +116,7 @@ public: ...@@ -102,7 +116,7 @@ public:
void accept() Q_DECL_OVERRIDE void accept() Q_DECL_OVERRIDE
{ {
def->copyToObject(); def->copyToObject();
KDialog::accept(); QDialog::accept();
} }
private: private:
......
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