QPushButton, QLineEdit, QTextEdit and QComboBox -> K*
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=821270
This commit is contained in:
parent
e305b698b4
commit
2f2efc43df
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "combobox.h"
|
#include "combobox.h"
|
||||||
|
|
||||||
#include <QComboBox>
|
#include <KComboBox>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
#include <KMimeType>
|
#include <KMimeType>
|
||||||
@ -46,7 +46,7 @@ ComboBox::ComboBox(QGraphicsWidget *parent)
|
|||||||
: QGraphicsProxyWidget(parent),
|
: QGraphicsProxyWidget(parent),
|
||||||
d(new Private)
|
d(new Private)
|
||||||
{
|
{
|
||||||
QComboBox* native = new QComboBox;
|
KComboBox* native = new KComboBox;
|
||||||
connect(native, SIGNAL(activated(const QString &)), this, SIGNAL(activated(const QString &)));
|
connect(native, SIGNAL(activated(const QString &)), this, SIGNAL(activated(const QString &)));
|
||||||
setWidget(native);
|
setWidget(native);
|
||||||
native->setAttribute(Qt::WA_NoSystemBackground);
|
native->setAttribute(Qt::WA_NoSystemBackground);
|
||||||
@ -59,7 +59,7 @@ ComboBox::~ComboBox()
|
|||||||
|
|
||||||
QString ComboBox::text() const
|
QString ComboBox::text() const
|
||||||
{
|
{
|
||||||
return static_cast<QComboBox*>(widget())->currentText();
|
return static_cast<KComboBox*>(widget())->currentText();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBox::setStylesheet(const QString &stylesheet)
|
void ComboBox::setStylesheet(const QString &stylesheet)
|
||||||
@ -72,19 +72,19 @@ QString ComboBox::stylesheet()
|
|||||||
return widget()->styleSheet();
|
return widget()->styleSheet();
|
||||||
}
|
}
|
||||||
|
|
||||||
QComboBox* ComboBox::nativeWidget() const
|
KComboBox* ComboBox::nativeWidget() const
|
||||||
{
|
{
|
||||||
return static_cast<QComboBox*>(widget());
|
return static_cast<KComboBox*>(widget());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBox::addItem(const QString &text)
|
void ComboBox::addItem(const QString &text)
|
||||||
{
|
{
|
||||||
static_cast<QComboBox*>(widget())->addItem(text);
|
static_cast<KComboBox*>(widget())->addItem(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBox::clear()
|
void ComboBox::clear()
|
||||||
{
|
{
|
||||||
static_cast<QComboBox*>(widget())->clear();
|
static_cast<KComboBox*>(widget())->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBox::resizeEvent(QGraphicsSceneResizeEvent *event)
|
void ComboBox::resizeEvent(QGraphicsSceneResizeEvent *event)
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <QtGui/QGraphicsProxyWidget>
|
#include <QtGui/QGraphicsProxyWidget>
|
||||||
|
|
||||||
class QComboBox;
|
class KComboBox;
|
||||||
|
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ class PLASMA_EXPORT ComboBox : public QGraphicsProxyWidget
|
|||||||
Q_PROPERTY(QGraphicsWidget* parentWidget READ parentWidget)
|
Q_PROPERTY(QGraphicsWidget* parentWidget READ parentWidget)
|
||||||
Q_PROPERTY(QString text READ text)
|
Q_PROPERTY(QString text READ text)
|
||||||
Q_PROPERTY(QString stylesheet READ stylesheet WRITE setStylesheet)
|
Q_PROPERTY(QString stylesheet READ stylesheet WRITE setStylesheet)
|
||||||
Q_PROPERTY(QComboBox* nativeWidget READ nativeWidget)
|
Q_PROPERTY(KComboBox* nativeWidget READ nativeWidget)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ComboBox(QGraphicsWidget *parent = 0);
|
explicit ComboBox(QGraphicsWidget *parent = 0);
|
||||||
@ -63,7 +63,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @return the native widget wrapped by this ComboBox
|
* @return the native widget wrapped by this ComboBox
|
||||||
*/
|
*/
|
||||||
QComboBox* nativeWidget() const;
|
KComboBox* nativeWidget() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an item to the combobox with the given text. The
|
* Adds an item to the combobox with the given text. The
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "lineedit.h"
|
#include "lineedit.h"
|
||||||
|
|
||||||
#include <QLineEdit>
|
#include <KLineEdit>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
#include <KMimeType>
|
#include <KMimeType>
|
||||||
@ -46,7 +46,7 @@ LineEdit::LineEdit(QGraphicsWidget *parent)
|
|||||||
: QGraphicsProxyWidget(parent),
|
: QGraphicsProxyWidget(parent),
|
||||||
d(new Private)
|
d(new Private)
|
||||||
{
|
{
|
||||||
QLineEdit* native = new QLineEdit;
|
KLineEdit* native = new KLineEdit;
|
||||||
connect(native, SIGNAL(editingFinished()), this, SIGNAL(editingFinished()));
|
connect(native, SIGNAL(editingFinished()), this, SIGNAL(editingFinished()));
|
||||||
connect(native, SIGNAL(returnPressed()), this, SIGNAL(returnPressed()));
|
connect(native, SIGNAL(returnPressed()), this, SIGNAL(returnPressed()));
|
||||||
connect(native, SIGNAL(textEdited(const QString&)), this, SIGNAL(textEdited(const QString&)));
|
connect(native, SIGNAL(textEdited(const QString&)), this, SIGNAL(textEdited(const QString&)));
|
||||||
@ -61,12 +61,12 @@ LineEdit::~LineEdit()
|
|||||||
|
|
||||||
void LineEdit::setText(const QString &text)
|
void LineEdit::setText(const QString &text)
|
||||||
{
|
{
|
||||||
static_cast<QLineEdit*>(widget())->setText(text);
|
static_cast<KLineEdit*>(widget())->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString LineEdit::text() const
|
QString LineEdit::text() const
|
||||||
{
|
{
|
||||||
return static_cast<QLineEdit*>(widget())->text();
|
return static_cast<KLineEdit*>(widget())->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LineEdit::setStylesheet(const QString &stylesheet)
|
void LineEdit::setStylesheet(const QString &stylesheet)
|
||||||
@ -79,9 +79,9 @@ QString LineEdit::stylesheet()
|
|||||||
return widget()->styleSheet();
|
return widget()->styleSheet();
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineEdit* LineEdit::nativeWidget() const
|
KLineEdit* LineEdit::nativeWidget() const
|
||||||
{
|
{
|
||||||
return static_cast<QLineEdit*>(widget());
|
return static_cast<KLineEdit*>(widget());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Plasma
|
} // namespace Plasma
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <QtGui/QGraphicsProxyWidget>
|
#include <QtGui/QGraphicsProxyWidget>
|
||||||
|
|
||||||
class QLineEdit;
|
class KLineEdit;
|
||||||
|
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ class PLASMA_EXPORT LineEdit : public QGraphicsProxyWidget
|
|||||||
Q_PROPERTY(QGraphicsWidget* parentWidget READ parentWidget)
|
Q_PROPERTY(QGraphicsWidget* parentWidget READ parentWidget)
|
||||||
Q_PROPERTY(QString text READ text WRITE setText)
|
Q_PROPERTY(QString text READ text WRITE setText)
|
||||||
Q_PROPERTY(QString stylesheet READ stylesheet WRITE setStylesheet)
|
Q_PROPERTY(QString stylesheet READ stylesheet WRITE setStylesheet)
|
||||||
Q_PROPERTY(QLineEdit* nativeWidget READ nativeWidget)
|
Q_PROPERTY(KLineEdit* nativeWidget READ nativeWidget)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LineEdit(QGraphicsWidget *parent = 0);
|
explicit LineEdit(QGraphicsWidget *parent = 0);
|
||||||
@ -70,7 +70,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @return the native widget wrapped by this LineEdit
|
* @return the native widget wrapped by this LineEdit
|
||||||
*/
|
*/
|
||||||
QLineEdit* nativeWidget() const;
|
KLineEdit* nativeWidget() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void editingFinished();
|
void editingFinished();
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "pushbutton.h"
|
#include "pushbutton.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <KPushButton>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ public:
|
|||||||
pm = QPixmap(absImagePath);
|
pm = QPixmap(absImagePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
static_cast<QPushButton*>(q->widget())->setIcon(QIcon(pm));
|
static_cast<KPushButton*>(q->widget())->setIcon(QIcon(pm));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString imagePath;
|
QString imagePath;
|
||||||
@ -73,7 +73,7 @@ PushButton::PushButton(QGraphicsWidget *parent)
|
|||||||
: QGraphicsProxyWidget(parent),
|
: QGraphicsProxyWidget(parent),
|
||||||
d(new Private)
|
d(new Private)
|
||||||
{
|
{
|
||||||
QPushButton* native = new QPushButton;
|
KPushButton* native = new KPushButton;
|
||||||
connect(native, SIGNAL(clicked()), this, SIGNAL(clicked()));
|
connect(native, SIGNAL(clicked()), this, SIGNAL(clicked()));
|
||||||
setWidget(native);
|
setWidget(native);
|
||||||
native->setAttribute(Qt::WA_NoSystemBackground);
|
native->setAttribute(Qt::WA_NoSystemBackground);
|
||||||
@ -86,12 +86,12 @@ PushButton::~PushButton()
|
|||||||
|
|
||||||
void PushButton::setText(const QString &text)
|
void PushButton::setText(const QString &text)
|
||||||
{
|
{
|
||||||
static_cast<QPushButton*>(widget())->setText(text);
|
static_cast<KPushButton*>(widget())->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PushButton::text() const
|
QString PushButton::text() const
|
||||||
{
|
{
|
||||||
return static_cast<QPushButton*>(widget())->text();
|
return static_cast<KPushButton*>(widget())->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PushButton::setImage(const QString &path)
|
void PushButton::setImage(const QString &path)
|
||||||
@ -137,9 +137,9 @@ QString PushButton::stylesheet()
|
|||||||
return widget()->styleSheet();
|
return widget()->styleSheet();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPushButton* PushButton::nativeWidget() const
|
KPushButton* PushButton::nativeWidget() const
|
||||||
{
|
{
|
||||||
return static_cast<QPushButton*>(widget());
|
return static_cast<KPushButton*>(widget());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PushButton::resizeEvent(QGraphicsSceneResizeEvent *event)
|
void PushButton::resizeEvent(QGraphicsSceneResizeEvent *event)
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <QtGui/QGraphicsProxyWidget>
|
#include <QtGui/QGraphicsProxyWidget>
|
||||||
|
|
||||||
class QPushButton;
|
class KPushButton;
|
||||||
|
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ class PLASMA_EXPORT PushButton : public QGraphicsProxyWidget
|
|||||||
Q_PROPERTY(QString text READ text WRITE setText)
|
Q_PROPERTY(QString text READ text WRITE setText)
|
||||||
Q_PROPERTY(QString image READ image WRITE setImage)
|
Q_PROPERTY(QString image READ image WRITE setImage)
|
||||||
Q_PROPERTY(QString stylesheet READ stylesheet WRITE setStylesheet)
|
Q_PROPERTY(QString stylesheet READ stylesheet WRITE setStylesheet)
|
||||||
Q_PROPERTY(QPushButton* nativeWidget READ nativeWidget)
|
Q_PROPERTY(KPushButton* nativeWidget READ nativeWidget)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PushButton(QGraphicsWidget *parent = 0);
|
explicit PushButton(QGraphicsWidget *parent = 0);
|
||||||
@ -83,7 +83,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @return the native widget wrapped by this PushButton
|
* @return the native widget wrapped by this PushButton
|
||||||
*/
|
*/
|
||||||
QPushButton* nativeWidget() const;
|
KPushButton* nativeWidget() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void clicked();
|
void clicked();
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "textedit.h"
|
#include "textedit.h"
|
||||||
|
|
||||||
#include <QTextEdit>
|
#include <KTextEdit>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
#include <KMimeType>
|
#include <KMimeType>
|
||||||
@ -46,7 +46,7 @@ TextEdit::TextEdit(QGraphicsWidget *parent)
|
|||||||
: QGraphicsProxyWidget(parent),
|
: QGraphicsProxyWidget(parent),
|
||||||
d(new Private)
|
d(new Private)
|
||||||
{
|
{
|
||||||
QTextEdit* native = new QTextEdit;
|
KTextEdit* native = new KTextEdit;
|
||||||
connect(native, SIGNAL(textChanged()), this, SIGNAL(textChanged()));
|
connect(native, SIGNAL(textChanged()), this, SIGNAL(textChanged()));
|
||||||
setWidget(native);
|
setWidget(native);
|
||||||
native->setAttribute(Qt::WA_NoSystemBackground);
|
native->setAttribute(Qt::WA_NoSystemBackground);
|
||||||
@ -60,12 +60,12 @@ TextEdit::~TextEdit()
|
|||||||
void TextEdit::setText(const QString &text)
|
void TextEdit::setText(const QString &text)
|
||||||
{
|
{
|
||||||
//FIXME I'm not certain about using only the html methods. look at this again later.
|
//FIXME I'm not certain about using only the html methods. look at this again later.
|
||||||
static_cast<QTextEdit*>(widget())->setHtml(text);
|
static_cast<KTextEdit*>(widget())->setHtml(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TextEdit::text() const
|
QString TextEdit::text() const
|
||||||
{
|
{
|
||||||
return static_cast<QTextEdit*>(widget())->toHtml();
|
return static_cast<KTextEdit*>(widget())->toHtml();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEdit::setStylesheet(const QString &stylesheet)
|
void TextEdit::setStylesheet(const QString &stylesheet)
|
||||||
@ -78,9 +78,9 @@ QString TextEdit::stylesheet()
|
|||||||
return widget()->styleSheet();
|
return widget()->styleSheet();
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextEdit* TextEdit::nativeWidget() const
|
KTextEdit* TextEdit::nativeWidget() const
|
||||||
{
|
{
|
||||||
return static_cast<QTextEdit*>(widget());
|
return static_cast<KTextEdit*>(widget());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEdit::resizeEvent(QGraphicsSceneResizeEvent *event)
|
void TextEdit::resizeEvent(QGraphicsSceneResizeEvent *event)
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <QtGui/QGraphicsProxyWidget>
|
#include <QtGui/QGraphicsProxyWidget>
|
||||||
|
|
||||||
class QTextEdit;
|
class KTextEdit;
|
||||||
|
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ class PLASMA_EXPORT TextEdit : public QGraphicsProxyWidget
|
|||||||
Q_PROPERTY(QGraphicsWidget* parentWidget READ parentWidget)
|
Q_PROPERTY(QGraphicsWidget* parentWidget READ parentWidget)
|
||||||
Q_PROPERTY(QString text READ text WRITE setText)
|
Q_PROPERTY(QString text READ text WRITE setText)
|
||||||
Q_PROPERTY(QString stylesheet READ stylesheet WRITE setStylesheet)
|
Q_PROPERTY(QString stylesheet READ stylesheet WRITE setStylesheet)
|
||||||
Q_PROPERTY(QTextEdit* nativeWidget READ nativeWidget)
|
Q_PROPERTY(KTextEdit* nativeWidget READ nativeWidget)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TextEdit(QGraphicsWidget *parent = 0);
|
explicit TextEdit(QGraphicsWidget *parent = 0);
|
||||||
@ -70,7 +70,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @return the native widget wrapped by this TextEdit
|
* @return the native widget wrapped by this TextEdit
|
||||||
*/
|
*/
|
||||||
QTextEdit* nativeWidget() const;
|
KTextEdit* nativeWidget() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void textChanged();
|
void textChanged();
|
||||||
|
Loading…
Reference in New Issue
Block a user