File indexing completed on 2024-05-19 09:39:50

0001 
0002 /***************************************************************************
0003  *   Copyright (C) 2005 by David Saxton                                    *
0004  *   david@bluehaze.org                                                    *
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  ***************************************************************************/
0011 
0012 #include "config.h"
0013 #ifndef NO_GPSIM
0014 
0015 #ifndef VARIABLELABEL_H
0016 #define VARIABLELABEL_H
0017 
0018 #include <QLabel>
0019 #include <QPointer>
0020 
0021 class TextView;
0022 
0023 /**
0024 Used for displaying the value of a variable when the user hovers his mouse over
0025 a variable while debugging.
0026 
0027 @author David Saxton
0028  */
0029 class VariableLabel : public QLabel
0030 {
0031     Q_OBJECT
0032 public:
0033     VariableLabel(TextView *parent);
0034     /**
0035      * Sets the register that this label is displaying the value of.
0036      */
0037     void setRegister(RegisterInfo *info, const QString &name);
0038     /**
0039      * Sets the value that this label is displaying. This is an alternative
0040      * to setRegister.
0041      */
0042     void setValue(unsigned value);
0043 
0044 protected slots:
0045     /**
0046      * Updates what is displayed from m_pRegisterInfo.
0047      */
0048     void updateText();
0049 
0050 protected:
0051     void disconnectRegisterInfo();
0052 
0053     QPointer<RegisterInfo> m_pRegisterInfo;
0054     QString m_registerName;
0055     int m_value;
0056 };
0057 
0058 #endif
0059 
0060 #endif // !NO_GPSIM