// Obsolete void KPopupMenu::setTitle(const QString &title) { KPopupTitle *titleItem = new KPopupTitle(); titleItem->setTitle(title); insertItem(titleItem); d->m_lastTitle = title; }
int KPopupMenu::insertTitle(const QPixmap &icon, const QString &text, int id, int index) { KPopupTitle *titleItem = new KPopupTitle(); titleItem->setTitle(text, &icon); return(insertItem(titleItem, id, index)); }
//static bool KexiContextMenuUtils::updateTitle(QPopupMenu *menu, const QString& objectName, const QString& objectTypeName, const QString& iconName) { if (!menu || objectName.isEmpty() || objectTypeName.isEmpty()) return false; const int id = menu->idAt(0); QMenuItem *item = menu->findItem(id); if (!item) return false; KPopupTitle *title = dynamic_cast<KPopupTitle *>(item->widget()); if (!title) return false; /*! @todo look at makeFirstCharacterUpperCaseInCaptions setting [bool] (see doc/dev/settings.txt) */ QString realTitle( i18n("Object name : Object type", "%1 : %2") .arg( objectName[0].upper() + objectName.mid(1) ) .arg( objectTypeName )); if (iconName.isEmpty()) title->setTitle(realTitle); else { QPixmap pixmap(SmallIcon( iconName )); title->setTitle(realTitle, &pixmap); } return true; }
void KasTaskItem::showPropertiesDialog() { // // Create Dialog // QDialog *dlg = new QDialog( /*kasbar()*/0L, "task_props", false ); // // Title // KPopupTitle *title = new KPopupTitle( dlg, "title" ); dlg->setCaption( i18n("Task Properties") ); title->setText( i18n("Task Properties") ); title->setIcon( icon() ); // // Tabbed View // QTabWidget *tabs = new QTabWidget( dlg ); tabs->addTab( createX11Props( tabs ), i18n("General") ); tabs->addTab( createTaskProps( task_, tabs ), i18n("Task") ); tabs->addTab( createTaskProps( this, tabs ), i18n("Item") ); tabs->addTab( createTaskProps( kasbar(), tabs, false ), i18n("Bar") ); #if 0 tabs->addTab( createNETProps( tabs ), i18n("NET") ); #endif // // Layout Dialog // QVBoxLayout *vbl = new QVBoxLayout( dlg, KDialog::marginHint(), KDialog::spacingHint() ); vbl->addWidget( title ); vbl->addWidget( tabs ); dlg->resize( 470, 500 ); dlg->show(); }