mirror of https://github.com/qt/qtbase.git
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: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
37a55e8840
commit
4aedfcc4b9
|
@ -47,13 +47,12 @@
|
|||
|
||||
class Widget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Widget() { }
|
||||
|
||||
QList<QEvent::Type> events;
|
||||
|
||||
protected:
|
||||
bool event(QEvent *ev) {
|
||||
bool event(QEvent *ev) Q_DECL_OVERRIDE {
|
||||
events.append(ev->type());
|
||||
return QWidget::event(ev);
|
||||
}
|
||||
|
@ -64,17 +63,12 @@ class tst_QLabel : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
tst_QLabel();
|
||||
virtual ~tst_QLabel();
|
||||
|
||||
|
||||
public slots:
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void init();
|
||||
void cleanup();
|
||||
private slots:
|
||||
|
||||
void getSetCheck();
|
||||
void setText_data();
|
||||
void setText();
|
||||
|
@ -143,15 +137,6 @@ void tst_QLabel::getSetCheck()
|
|||
delete var3;
|
||||
}
|
||||
|
||||
|
||||
tst_QLabel::tst_QLabel(): test_box(0)
|
||||
{
|
||||
}
|
||||
|
||||
tst_QLabel::~tst_QLabel()
|
||||
{
|
||||
}
|
||||
|
||||
void tst_QLabel::initTestCase()
|
||||
{
|
||||
// Create the test class
|
||||
|
@ -164,7 +149,6 @@ void tst_QLabel::cleanupTestCase()
|
|||
{
|
||||
delete testWidget;
|
||||
testWidget = 0;
|
||||
if (test_box)
|
||||
delete test_box;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue