Author Topic: Breakpoint is ignored  (Read 3200 times)

Offline testalucida

  • Multiple posting newcomer
  • *
  • Posts: 14
Breakpoint is ignored
« 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

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Breakpoint is ignored
« Reply #1 on: December 17, 2006, 04:36:51 pm »
   //-- Wiki Index
       CodeBlocks Wiki Index
   //-- Wiki Main Page
    CodeBlocks Wiki Main Page

  Debugging with CodeBlocks

See the workaround for breakpoints in constructors/destructors at the bottom of the wiki entry.
« Last Edit: December 17, 2006, 04:40:54 pm by Pecan »

Offline testalucida

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Breakpoint is ignored
« Reply #2 on: December 17, 2006, 05:41:08 pm »
Hi Pecan,
thanks a lot - works fine now.

Have a nice day
testalucida