Yes I used Q_OBJECT and yes the class is initialised. In the end I gave up and use QCoreApplication::translate("QLinearGradientCtrl", "text") as tr("text") wasn't working.
QLinearGradientCtrl::QLinearGradientCtrl(QWidget * parent, QColor start, QColor end) :
QWidget(parent),
m_Gradient(0, 0, 1, 0),
m_Width(GCW_AUTO),
selectedPeg(NONE),
lastSelectedPeg(NONE),
m_LastPos(0),
m_showToolTips(true),
m_Orientation(Orientation::Auto),
startPegStop(0),
m_LeftDownSide(true),
m_RightUpSide(false)
{
m_ToolTipFormat = "&SELPOS\nPosition: &SELPOS Colour: R &R G &G B &B\nColour: R &R G &G B &B\nColour: R &R G &G B &B\nDouble Click to Add a New Peg";
//m_Impl = new QLinearGradientCtrlImpl(this);
m_Gradient.setColorAt(0, start);
m_Gradient.setColorAt(0.001, start);
m_Gradient.setColorAt(0.999, end);
m_Gradient.setColorAt(1, end);
setFocusPolicy(Qt::StrongFocus); // Make sure we get key events.
stops = m_Gradient.stops(); // Grab the gradient stops
endPegStop = stops.size() - 1;
setToolTip(QCoreApplication::translate("QLinearGradientCtrl",
"You can use the Up-Arrow, Right-Arrow, Left-Arrow, Down-Arrow;\n"
"Page-Up and Page-Down keys to move a slider after you have selected it\n"
"with the mouse."));
}
Is how it now reads...