Commit 4aedfcc4 authored by Marc Mutz's avatar Marc Mutz
Browse files

Clean up tst_qlabel


Remove unused ctors and dtor, add Q_OBJECT, indent,
privatize slots, don't check for nullptr before
delete'ing a pointer, and add one override keyword.

Setting test_box (a QPointer) to nullptr is already
done by the variable's default ctor.

Change-Id: I13f06dc8104ef1c0ac08a25c960641c076f10499
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Showing with 6 additions and 22 deletions
...@@ -47,13 +47,12 @@ ...@@ -47,13 +47,12 @@
class Widget : public QWidget class Widget : public QWidget
{ {
Q_OBJECT
public: public:
Widget() { }
QList<QEvent::Type> events; QList<QEvent::Type> events;
protected: protected:
bool event(QEvent *ev) { bool event(QEvent *ev) Q_DECL_OVERRIDE {
events.append(ev->type()); events.append(ev->type());
return QWidget::event(ev); return QWidget::event(ev);
} }
...@@ -62,19 +61,14 @@ protected: ...@@ -62,19 +61,14 @@ protected:
class tst_QLabel : public QObject class tst_QLabel : public QObject
{ {
Q_OBJECT Q_OBJECT
public:
tst_QLabel();
virtual ~tst_QLabel();
public slots: private Q_SLOTS:
void initTestCase(); void initTestCase();
void cleanupTestCase(); void cleanupTestCase();
void init(); void init();
void cleanup(); void cleanup();
private slots:
void getSetCheck(); void getSetCheck();
void setText_data(); void setText_data();
void setText(); void setText();
...@@ -143,15 +137,6 @@ void tst_QLabel::getSetCheck() ...@@ -143,15 +137,6 @@ void tst_QLabel::getSetCheck()
delete var3; delete var3;
} }
tst_QLabel::tst_QLabel(): test_box(0)
{
}
tst_QLabel::~tst_QLabel()
{
}
void tst_QLabel::initTestCase() void tst_QLabel::initTestCase()
{ {
// Create the test class // Create the test class
...@@ -164,8 +149,7 @@ void tst_QLabel::cleanupTestCase() ...@@ -164,8 +149,7 @@ void tst_QLabel::cleanupTestCase()
{ {
delete testWidget; delete testWidget;
testWidget = 0; testWidget = 0;
if (test_box) delete test_box;
delete test_box;
} }
void tst_QLabel::init() void tst_QLabel::init()
......
Supports Markdown
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