G'day All,
Is there some trick to having Creator (1.1 on Linux, Qt 4.5.1) do code completion for Designer UI? Currently I get no useful completion after entering "m_ui->" with code straight from the Creator/Designer wizard (example below). I'm fairly sure this has worked in the past.
Cheers,
Chris
#ifndef ALARMVIEW_H
#define ALARMVIEW_H
#include <QtGui/QWidget>
namespace Ui {
class AlarmView;
}
Q_OBJECT
Q_DISABLE_COPY(AlarmView)
public:
explicit AlarmView
(QWidget *parent
= 0);
virtual ~AlarmView();
protected:
virtual void changeEvent
(QEvent *e
);
private:
Ui::AlarmView *m_ui;
};
#endif // ALARMVIEW_H
#ifndef ALARMVIEW_H
#define ALARMVIEW_H
#include <QtGui/QWidget>
namespace Ui {
class AlarmView;
}
class AlarmView : public QWidget {
Q_OBJECT
Q_DISABLE_COPY(AlarmView)
public:
explicit AlarmView(QWidget *parent = 0);
virtual ~AlarmView();
protected:
virtual void changeEvent(QEvent *e);
private:
Ui::AlarmView *m_ui;
};
#endif // ALARMVIEW_H
To copy to clipboard, switch view to plain text mode
#include "alarmview.h"
#include "ui_alarmview.h"
AlarmView
::AlarmView(QWidget *parent
) : m_ui(new Ui::AlarmView)
{
m_ui->setupUi(this);
m_ui-> // Completion fails here and only offers the class AlarmView and not the widgets
}
AlarmView::~AlarmView()
{
delete m_ui;
}
void AlarmView
::changeEvent(QEvent *e
) {
switch (e->type()) {
m_ui->retranslateUi(this);
break;
default:
break;
}
}
#include "alarmview.h"
#include "ui_alarmview.h"
AlarmView::AlarmView(QWidget *parent) :
QWidget(parent),
m_ui(new Ui::AlarmView)
{
m_ui->setupUi(this);
m_ui-> // Completion fails here and only offers the class AlarmView and not the widgets
}
AlarmView::~AlarmView()
{
delete m_ui;
}
void AlarmView::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks