All pastes #2070640 Raw Edit

Unnamed

public cpp v1 · immutable
#2070640 ·published 2011-05-27 22:57 UTC
rendered paste body
MyMainWindow.h====================#ifndef DASHBOARD_HPP#define DASHBOARD_HPP#include <QtGui>namespace Ui {    class Dashboard;}namespace MyNamespace{class MyMainWindow : public QMainWindow{    Q_OBJECTpublic:    explicit MyMainWindow(QWidget *parent = 0);    ~MyMainWindow();    void simpleMethod();private:    Ui::MyMainWindow *ui;    QComboBox *comboMy;};} // END namespace MyNamespace#endif // DASHBOARD_HPPMyMainWindow.cpp============================#include "MyMainWindow.hpp"#include "ui_MyMainWindow.h"#include <QtGui>namespace MyNamespace{MyMainWindow::MyMainWindow(QWidget *parent) :    QMainWindow(parent),    ui(new Ui::MyMainWindow){    ui->setupUi(this);    QComboBox *comboMy = new QComboBox;// 1 ************************************// Doing this in constructor works        comboMy->addItem("asdf");}MyMainWindow::~MyMainWindow(){    delete ui;}voidMyMainWindow::simpleMethod(){// 2 ***********************************// Bu this does not    this->comboMy->addItem("asdf");}} // END namespace MyNamespace