On Thu, Sep 03, 2009 at 03:56:52PM -0400, Murphy, Sean M. wrote:
> I'm trying to debug class member variables, inside class member
> functions and I'm not having much luck.  I've attached a trivial sample
> program that illustrates the problem.
> 
> If this is my class:
>   class MainWindow : public QMainWindow
>   {
>       Q_OBJECT
> 
>   public:
>       MainWindow(QWidget *parent = 0);
>       ~MainWindow();
> 
>   public slots:
>       void updateValues();
>       void updateGui();
> 
>   private:
>       Ui::MainWindow *ui;
> 
>       unsigned int myUInt;
>       int myInt;
>       double myDouble;
>       float myFloat;
>       QTimer* timer;
>   };
> 
> And my updateValues() function looks like:
>   void MainWindow::updateValues()
>   {
>       myUInt += 1;
>       myInt += 2;
>       myDouble *= 2.0;
>       myFloat *= 0.5;
>       updateGui();
>   }
> 
> If I set a breakpoint at updateValues(), I'm unable to monitor the
> values of myUInt, myInt, myDouble, or myFloat in the "Locals and
> Watchers" tab as I step through the function. I think I understand
> while they don't show up under the Locals part, since they aren't local
> variables, except that the "this" object shows up in Locals, and I would
> have thought they would be part of that object.  I also don't seem to be
> able to find the right way to add them in the Watcher section.
> 
> I feel like there has to be something I'm missing to enable this!

Is this behaviour reproducible, i.e. do you always see the same subset
of variables?

In any case, please check out
http://qt.gitorious.org/qt-creator/pages/FrequentlyAskedQuestions

Andre'
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to