void KexiReportFactory::editText() { QCString classname = m_widget->className(); QString text; if(classname == "Label") text = ((QLabel*)m_widget)->text(); if(editRichText(m_widget, text)) { changeProperty("textFormat", "RichText", m_container->form()); changeProperty("text", text, m_container->form()); } if(classname == "Label") m_widget->resize(m_widget->sizeHint()); }
LabelTaskMenu::LabelTaskMenu(QLabel *label, QObject *parent) : QDesignerTaskMenu(label, parent), m_label(label), m_editRichTextAction(new QAction(tr("Change rich text..."), this)), m_editPlainTextAction(new QAction(tr("Change plain text..."), this)) { LabelTaskMenuInlineEditor *editor = new LabelTaskMenuInlineEditor(label, this); connect(m_editPlainTextAction, SIGNAL(triggered()), editor, SLOT(editText())); m_taskActions.append(m_editPlainTextAction); connect(m_editRichTextAction, SIGNAL(triggered()), this, SLOT(editRichText())); m_taskActions.append(m_editRichTextAction); QAction *sep = new QAction(this); sep->setSeparator(true); m_taskActions.append(sep); }
void StdWidgetFactory::editText() { QCString classname = widget()->className(); QString text; if(classname == "KTextEdit") text = ((KTextEdit*)widget())->text(); else if(classname == "QLabel") text = ((QLabel*)widget())->text(); if(editRichText(widget(), text)) { changeProperty("textFormat", "RichText", m_container->form()); changeProperty("text", text, m_container->form()); } if(classname == "QLabel") widget()->resize(widget()->sizeHint()); }