Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: testalucida on December 17, 2006, 03:00:21 pm

Title: Breakpoint is ignored
Post by: testalucida on December 17, 2006, 03:00:21 pm
Hi,
I'm using the Code::Blocks build Dec 13, 2006 and the MinGW-Compiler.
I set a breakpoint, but it is always ignored. This is my code (breakpoint is in line "slider->setValue(0);" ):

Code
#include <QApplication>
#include <QWidget>
#include <QFont>
#include <QLCDNumber>
#include <QPushButton>
#include <QSlider>
#include <QVBoxLayout>


class MyWidget : public QWidget
{
    public:
        MyWidget(QWidget *parent = 0 );
    protected:
    private:
};

MyWidget::MyWidget(QWidget *parent)
     : QWidget(parent)
 {
     QPushButton *quit = new QPushButton(tr("Quit"));
     quit->setFont(QFont("Times", 18, QFont::Bold));

     QLCDNumber *lcd = new QLCDNumber(2);
     lcd->setSegmentStyle(QLCDNumber::Filled);

     QSlider *slider = new QSlider(Qt::Horizontal);
     slider->setRange(0, 99);

     slider->setValue(0);                 //the line with the breakpoint

     connect(quit, SIGNAL(clicked()), qApp, SLOT(quit()));   
     connect(slider, SIGNAL(valueChanged(int)),
             lcd, SLOT(display(int)));

     QVBoxLayout *layout = new QVBoxLayout;
     layout->addWidget(quit);
     layout->addWidget(lcd);
     layout->addWidget(slider);
     setLayout(layout);
 }

 int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
     MyWidget widget;
     widget.show();
     return app.exec();
 }


Why is that??
The build option "Produce debugging symbols" is set.

Thanks in advance
testalucida
Title: Re: Breakpoint is ignored
Post by: Pecan on December 17, 2006, 04:36:51 pm
   //-- Wiki Index
       CodeBlocks Wiki Index (http://wiki.codeblocks.org/index.php?title=Special:Allpages)
   //-- Wiki Main Page
     CodeBlocks Wiki Main Page (http://wiki.codeblocks.org/index.php?title=Main_Page)

  Debugging with CodeBlocks (http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks)

See the workaround for breakpoints in constructors/destructors at the bottom of the wiki entry.
Title: Re: Breakpoint is ignored
Post by: testalucida on December 17, 2006, 05:41:08 pm
Hi Pecan,
thanks a lot - works fine now.

Have a nice day
testalucida