Results 1 to 3 of 3

Thread: Script Debugger LocalsWidget does not show variables

  1. #1
    Join Date
    Mar 2011
    Posts
    21
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Script Debugger LocalsWidget does not show variables

    Hi,

    i have problems integrating debugger widgets in my project. Using standardWindow() everything works fine.
    When I integrate the widgets via widget() in my application all widgets are working except the LocalsWidget. This widget keeps empty.
    What am I doing wrong?

    Thanks for your help!

    Thomas

    (code attached)
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2011
    Posts
    21
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Script Debugger LocalsWidget does not show variables

    zip file was corrupted, sorry

    3 Files:

    Main.cpp:

    Qt Code:
    1. #include <QApplication>
    2. #include "Window.h"
    3.  
    4. int main(int argc, char *argv[]) {
    5. QApplication A(argc, argv);
    6.  
    7. Window W;
    8. W.show();
    9.  
    10. return A.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    Window.h:

    Qt Code:
    1. #include <QWidget>
    2.  
    3. class QTextEdit;
    4. class QScriptEngine;
    5. class QScriptEngineDebugger;
    6.  
    7. class Window: public QWidget {
    8. Q_OBJECT
    9. public:
    10. Window();
    11.  
    12. private slots:
    13. void runScript();
    14.  
    15. private:
    16. QTextEdit *mTE;
    17. QScriptEngine *mEngine;
    18. QScriptEngineDebugger *mDebugger;
    19. };
    To copy to clipboard, switch view to plain text mode 

    Window.cpp:

    Qt Code:
    1. #include <QAction>
    2. #include <QHBoxLayout>
    3. #include <QVBoxLayout>
    4. #include <QTextEdit>
    5. #include <QPushButton>
    6. #include <QScriptEngine>
    7. #include <QScriptEngineDebugger>
    8. #include "Window.h"
    9.  
    10. Window::Window() {
    11. QHBoxLayout *HBL = new QHBoxLayout(this);
    12. HBL->addLayout(VBL);
    13. mTE = new QTextEdit;
    14. mTE->setText("Sum = 0\nfor (i=1; i<=10; i++)\n Sum += i\n Sum");
    15. VBL->addWidget(mTE);
    16.  
    17. QPushButton *PB = new QPushButton("run");
    18. VBL->addWidget(PB);
    19. connect(PB, SIGNAL(clicked()), this, SLOT(runScript()));
    20.  
    21. mEngine = new QScriptEngine;
    22. mDebugger = new QScriptEngineDebugger;
    23. mDebugger->attachTo(mEngine);
    24. mDebugger->setAutoShowStandardWindow(false);
    25.  
    26. HBL->addWidget(mDebugger->widget(QScriptEngineDebugger::CodeWidget));
    27. HBL->addWidget(mDebugger->widget(QScriptEngineDebugger::ConsoleWidget));
    28. HBL->addWidget(mDebugger->widget(QScriptEngineDebugger::LocalsWidget));
    29. }
    30.  
    31. void Window::runScript() {
    32. mDebugger->action(QScriptEngineDebugger::InterruptAction)->trigger();
    33. mEngine->evaluate(mTE->toPlainText());
    34. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Apr 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Script Debugger LocalsWidget does not show variables

    Hi,

    I do have the same issue. Does anyone has a clue what is happening ?

    cheers

    Corsairr

Similar Threads

  1. Replies: 4
    Last Post: 3rd November 2011, 09:30
  2. Replies: 3
    Last Post: 12th July 2010, 14:12
  3. Can I include a script from script?
    By yycking in forum Qt Programming
    Replies: 1
    Last Post: 24th April 2009, 04:01
  4. QT IDE and Debugger
    By onefootswill in forum Newbie
    Replies: 16
    Last Post: 25th July 2008, 21:39
  5. Need Qt IDE with Debugger
    By rajeshs in forum General Discussion
    Replies: 3
    Last Post: 10th October 2007, 13:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.