void WidgetDatabase::setupPlugins() { if ( plugins_set_up ) return; plugins_set_up = TRUE; QStringList widgets = widgetManager()->featureList(); for ( QStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { if ( hasWidget( *it ) ) continue; WidgetDatabaseRecord *r = new WidgetDatabaseRecord; WidgetInterface *iface = 0; widgetManager()->queryInterface( *it, &iface ); if ( !iface ) continue; #ifndef UIC QIconSet icon = iface->iconSet( *it ); if ( !icon.pixmap().isNull() ) r->icon = new QIconSet( icon ); #endif QString grp = iface->group( *it ); if ( grp.isEmpty() ) grp = "3rd party widgets"; r->group = widgetGroup( grp ); r->toolTip = iface->toolTip( *it ); r->whatsThis = iface->whatsThis( *it ); r->includeFile = iface->includeFile( *it ); r->isContainer = iface->isContainer( *it ); r->name = *it; r->isPlugin = TRUE; append( r ); iface->release(); } }
/** * Insert a new widget * @param widget :: An MdiSubWindow to add. * @param row :: A row index at which to place the new tile. * @param col :: A column index at which to place the new tile. */ void TiledWindow::insertWidget(MdiSubWindow *widget, int row, int col) { int index = calcFlatIndex( row, col ); int lastRow = rowCount() - 1; int lastCol = columnCount() - 1; // if the last tile has a widget append a row if ( getWidget( lastRow, lastCol ) != NULL ) { ++lastRow; Tile *tile = getOrAddTile( lastRow, lastCol ); (void) tile; } // shift widgets towards the bottom int lastIndex = calcFlatIndex( lastRow, lastCol ); int rowTo(0), colTo(0), rowFrom(0), colFrom(0); for(int i = lastIndex; i > index; --i) { calcTilePosition( i, rowTo, colTo ); calcTilePosition( i - 1, rowFrom, colFrom ); if ( hasWidget( rowFrom, colFrom ) ) { MdiSubWindow *w = removeTile( rowFrom, colFrom ); addWidget( w, rowTo, colTo ); } } addWidget( widget, row, col ); }
void SlidePanel::setWidget(QWidget *w) { if(!w) return; if(hasWidget()) mLayout.removeWidget(mWidget); mWidget = w; mWidget->setParent(this); mLayout.addWidget(mWidget, 0, 0); }
void KHTMLViewBar::addBarWidget (KHTMLViewBarWidget *newBarWidget) { if (hasWidget(newBarWidget)) { kDebug(6050) << "this bar widget is already added"; return; } // add new widget, invisible... newBarWidget->hide(); layout()->addWidget( newBarWidget ); connect(newBarWidget, SIGNAL(hideMe()), SLOT(hideCurrentBarWidget())); kDebug(6050) << "add barwidget " << newBarWidget; }
bool ContentDialog::hasGroupWidget(int groupId, GenericChatroomWidget *chatroomWidget) { return hasWidget(groupId, chatroomWidget, groupList); }
bool ContentDialog::hasFriendWidget(int friendId, GenericChatroomWidget* chatroomWidget) { return hasWidget(friendId, chatroomWidget, friendList); }
void ToolBar::mapWidget(ArenaWidget *w){ if (hasWidget(w)) tabbar->setCurrentIndex(map[w]); }