示例#1
0
void OBJ33(void) {
  OBJ33_Employee coder("Joe Smith");
  OBJ33_Employee typist("Bill Jones");
  OBJ33_Manager designer("Jane Doe", typist);

  coder = designer;  // slices Jane Doe!
  coder.print();
}
KReportDesignerItemCheckBox* KReportDesignerItemCheckBox::clone()
{
    QDomDocument d;
    QDomElement e = d.createElement(QLatin1String("clone"));
    QDomNode n;
    buildXML(&d, &e);
    n = e.firstChild();
    return new KReportDesignerItemCheckBox(n, designer(), 0);
}
KoReportDesignerItemText* KoReportDesignerItemText::clone()
{
    QDomDocument d;
    QDomElement e = d.createElement("clone");;
    QDomNode n;
    buildXML(d, e);
    n = e.firstChild();
    return new KoReportDesignerItemText(n, designer(), 0);
}
void RubySupportPart::slotCreateSubclass()
{
    QFileInfo fi(m_contextFileName);
    if (fi.extension(false) != "ui")
        return;
    QtDesignerRubyIntegration *des = dynamic_cast<QtDesignerRubyIntegration*>(designer(KInterfaceDesigner::QtDesigner));
    if (des)
        des->selectImplementation(m_contextFileName);
}
示例#5
0
ReportEntityCheck* ReportEntityCheck::clone()
{
    QDomDocument d;
    QDomElement e = d.createElement("clone");;
    QDomNode n;
    buildXML(d, e);
    n = e.firstChild();
    return new ReportEntityCheck(n, designer(), 0);
}
示例#6
0
void KReportDesignerItemLine::propertyChanged(KPropertySet &s, KProperty &p)
{
    Q_UNUSED(s);

    if (p.name() == "startposition" || p.name() == "endposition") {
        QPointF s = scenePosition(m_start->value().toPointF());
        QPointF e = scenePosition(m_end->value().toPointF());
        
        setLine ( s.x(), s.y(), e.x(), e.y() );
    }
    else if (p.name() == "name") {
        //For some reason p.oldValue returns an empty string
        if (!designer()->isEntityNameUnique(p.value().toString(), this)) {
            p.setValue(oldName());
        } else {
            setOldName(p.value().toString());
        }
    }
    if (designer())
        designer()->setModified(true);

    update();
}
示例#7
0
void PythonSupportPart::slotCreateSubclass()
{
    QFileInfo fi(m_contextFileName);
    kdDebug(9014) << k_funcinfo << " file: " << m_contextFileName << " ext: " << fi.extension(false) << endl;
    if (fi.extension(false) != "ui")
        return;
    QtDesignerPythonIntegration *des = dynamic_cast<QtDesignerPythonIntegration*>(designer(KInterfaceDesigner::QtDesigner));
    if (des)
    {
        kdDebug(9014) << "ok: " << des << endl;
        kdDebug(9014) << "have impl: " << des->selectImplementation(m_contextFileName);
    }
    kdDebug(9014) << "end: " << des << endl;
}
示例#8
0
void KReportDesignerItemLine::mousePressEvent(QGraphicsSceneMouseEvent * event)
{
    designer()->changeSet(propertySet());
    setSelected(true);
    QGraphicsLineItem::mousePressEvent(event);
}