videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/metadatasignalspy.h
changeset 36 8aed59de29f9
equal deleted inserted replaced
35:3738fe97f027 36:8aed59de29f9
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   helper class to go around a bug in QSignalSpy.
       
    15 */
       
    16 
       
    17 #ifndef __METADATASIGNALSPY_H
       
    18 #define __METADATASIGNALSPY_H
       
    19 
       
    20 #include <qobject.h>
       
    21 #include <qvariant.h>
       
    22 
       
    23 class MetaDataSignalSpy : QObject 
       
    24 {
       
    25     Q_OBJECT
       
    26     
       
    27 public:
       
    28     MetaDataSignalSpy(QObject* testObject, const char *signal) 
       
    29     {
       
    30         count = 0;
       
    31         connect(testObject, signal, this, SLOT(detailsReady(QVariant&)));
       
    32     }
       
    33     
       
    34     virtual ~MetaDataSignalSpy() {}
       
    35     
       
    36     void clear()
       
    37     {
       
    38         arg = QVariant();
       
    39         count = 0;
       
    40     }
       
    41     
       
    42 private slots:
       
    43     void detailsReady(QVariant& arg)
       
    44     {
       
    45         count++;
       
    46         this->arg = arg;
       
    47     }
       
    48 
       
    49 public:    
       
    50     int count;
       
    51     QVariant arg;
       
    52 };
       
    53 
       
    54 
       
    55 #endif // __METADATASIGNALSPY_H