void ItemOrderList::clearItems() { ui->listWidgetItems->clear(); for (const auto &pair : m_items) deleteWidget(pair.widget); m_items.clear(); }
void RenderWidget::setWidget(Widget* widget) { if (widget != m_widget) { if (m_widget) { // removeFromParent is a no-op on Mac. m_widget->removeFromParent(); widgetRendererMap().remove(m_widget); deleteWidget(); } m_widget = widget; if (m_widget) { widgetRendererMap().add(m_widget, this); // if we've already received a layout, apply the calculated space to the // widget immediately, but we have to have really been full constructed (with a non-null // style pointer). if (!needsLayout() && style()) resizeWidget(m_widget, m_width - borderLeft() - borderRight() - paddingLeft() - paddingRight(), m_height - borderTop() - borderBottom() - paddingTop() - paddingBottom()); if (style()) { if (style()->visibility() != VISIBLE) m_widget->hide(); else m_widget->show(); } m_view->addChild(m_widget); } } }
void ItemOrderList::clearItems() { ui->listWidgetItems->clear(); foreach ( const ItemWidgetPair &pair, m_items.values() ) deleteWidget(pair.widget); m_items.clear(); }
void RenderWidget::setWidget(Widget* widget) { if (widget != m_widget) { if (m_widget) { m_widget->removeFromParent(); widgetRendererMap().remove(m_widget); deleteWidget(); } m_widget = widget; if (m_widget) { widgetRendererMap().add(m_widget, this); // if we've already received a layout, apply the calculated space to the // widget immediately, but we have to have really been full constructed (with a non-null // style pointer). if (style()) { if (!needsLayout()) setWidgetGeometry(absoluteContentBox()); if (style()->visibility() != VISIBLE) m_widget->hide(); else m_widget->show(); } m_view->addChild(m_widget); } } }
void MainWindow::acInfoWidget() { deleteWidget(); if(_InfoWidget == NULL) { _InfoWidget = new InfoWidget(this); } setCentralWidget(_InfoWidget); }
void Parametertuner::deleteWidget(QTreeWidgetItem* item) { QWidget* w = m_ui.parameter_root_widget->itemWidget(item, 1); m_ui.parameter_root_widget->removeItemWidget(item, 1); if(w) delete w; for(int i = 0; i < item->childCount(); ++i) deleteWidget(item->child(i)); }
void MainWindow::acProblemWidget() { deleteWidget(); if(_ProblemWidget == NULL) { _ProblemWidget = new ProblemWidget(this); _ProblemWidget->init(_DB); } setCentralWidget(_ProblemWidget); }
void MainWindow::acCompanyWidget() { deleteWidget(); if(_CompanyWidget == NULL) { _CompanyWidget = new CompanyWidget(this); _CompanyWidget->init(_DB); } setCentralWidget(_CompanyWidget); }
void MainWindow::acAreaDispo() { deleteWidget(); if(_AreaDispoWidget == NULL) { _AreaDispoWidget = new AreaDispoWidget(this); _AreaDispoWidget->init(_DB); } setCentralWidget(_AreaDispoWidget); }
void MainWindow::acSearch() { deleteWidget(); if(_SearchWidget == NULL) { _SearchWidget = new SearchWidget(this); _SearchWidget->init(_DB); } setCentralWidget(_SearchWidget); }
void MainWindow::acDefAreaPart() { deleteWidget(); if(_AreaPartWidget == NULL) { _AreaPartWidget = new AreaPartWidget(this); _AreaPartWidget->init(_DB); } setCentralWidget(_AreaPartWidget); }
void WebdavCalendar::initGui() { QBoxLayout *bottomLayout = new QHBoxLayout(); mDaysCheckBox = new QCheckBox( this ); mDaysCheckBox->setText( i18n( "Sync only events newer than" ) ); mDaysSpinBox = new QSpinBox( this ); mDaysSpinBox->setDisabled( true ); mDaysSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); connect( mDaysCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( toggleDays( bool ) ) ); bottomLayout->addWidget( mDaysCheckBox ); bottomLayout->addWidget( mDaysSpinBox ); bottomLayout->addWidget( new QLabel( i18n( "day(s)" ), this ) ); QGridLayout *webdavLayout = new QGridLayout(); mUrl = new KLineEdit( this ); mUsername = new KLineEdit( this ); mPassword = new KLineEdit( this ); mPassword->setEchoMode( KLineEdit::Password ); KPushButton *removeButton = new KPushButton( this ); removeButton->setText( i18n( "Remove" ) ); connect( removeButton, SIGNAL( clicked() ), this, SLOT( deleteWidget() ) ); mDefaultCheckBox = new QCheckBox( this ); mDefaultCheckBox->setText( i18n( "Set as Default" ) ); webdavLayout->addWidget( new QLabel( i18n( "Location:" ), this ), 0, 0 ); webdavLayout->addWidget( mUrl, 0, 1 ); webdavLayout->addItem( new QSpacerItem( 40, 20, QSizePolicy::Fixed ), 0, 2 ); webdavLayout->addWidget( removeButton, 0, 3 ); webdavLayout->addMultiCellLayout( bottomLayout, 1, 1, 0, 1 ); webdavLayout->addWidget( mDefaultCheckBox, 1, 3 ); QGridLayout *mainLayout = new QGridLayout( this ); mainLayout->addItem( new QSpacerItem( 40, 20, QSizePolicy::Fixed ), 0, 0 ); mainLayout->addMultiCellLayout( webdavLayout, 1, 1, 0, 4 ); mainLayout->addWidget( new QLabel( i18n( "Username:"******"Password:" ), this ), 2, 3 ); mainLayout->addWidget( mPassword, 2, 4 ); }
void Parametertuner::update() { deleteWidget(m_ui.parameter_root_widget->invisibleRootItem()); m_ui.parameter_root_widget->clear(); config_server::ParameterClient* client = config_server::ParameterClient::instance(); client->cork(); QMutexLocker locker (&m_mutex); for(size_t i = 0; i < m_list->parameters.size(); i++) { QString param = QString::fromStdString(m_list->parameters[i].name); insertParameter(param, 0, m_list->parameters[i]); } client->uncork(); }
/*! Releases the specified \a widget. Container widgets that support actions call this function when a widget action is removed. \sa requestWidget(), deleteWidget(), defaultWidget() */ void QWidgetAction::releaseWidget(QWidget *widget) { Q_D(QWidgetAction); if (widget == d->defaultWidget) { d->defaultWidget->hide(); d->defaultWidget->setParent(0); d->defaultWidgetInUse = false; return; } if (!d->createdWidgets.contains(widget)) return; disconnect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(_q_widgetDestroyed(QObject*))); d->createdWidgets.removeAll(widget); deleteWidget(widget); }
void LocalCalendar::initGui() { QBoxLayout *bottomLayout = new QHBoxLayout(); mDaysCheckBox = new QCheckBox( this ); mDaysCheckBox->setText( i18n( "Sync only events newer than" ) ); mDaysSpinBox = new QSpinBox( this ); mDaysSpinBox->setDisabled( true ); mDaysSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); connect( mDaysCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( toggleDays( bool ) ) ); bottomLayout->addWidget( mDaysCheckBox ); bottomLayout->addWidget( mDaysSpinBox ); bottomLayout->addWidget( new QLabel( i18n( "day(s)" ), this ) ); QGridLayout *localLayout = new QGridLayout( this ); mPathRequester = new KURLRequester( this ); KPushButton *removeButton = new KPushButton( this ); removeButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); removeButton->setText( i18n( "Remove" ) ); connect( removeButton, SIGNAL( clicked() ), this, SLOT( deleteWidget() ) ); mDefaultCheckBox = new QCheckBox( this ); mDefaultCheckBox->setText( i18n( "Set as Default" ) ); localLayout->addItem( new QSpacerItem( 40, 20, QSizePolicy::Expanding ), 0, 0 ); localLayout->addWidget( new QLabel( i18n( "Location:" ), this ), 1, 0 ); localLayout->addWidget( mPathRequester, 1, 1 ); localLayout->addItem( new QSpacerItem( 40, 20, QSizePolicy::Fixed ), 1, 2 ); localLayout->addWidget( removeButton, 1, 3 ); localLayout->addMultiCellLayout( bottomLayout, 2, 2, 0, 2 ); localLayout->addWidget( mDefaultCheckBox, 2, 3 ); }
RenderWidget::~RenderWidget() { ASSERT(m_refCount <= 0); deleteWidget(); }
KexiFormView::KexiFormView(QWidget *parent, bool dbAware) : KexiDataAwareView(parent) , d(new Private) { Q_UNUSED(dbAware); d->delayedFormContentsResizeOnShow = 0; //! @todo remove? setSortedProperties(true); d->scrollView = new KexiFormScrollView( // will be added to layout this, viewMode() == Kexi::DataViewMode); // in KexiDataAwareView::init() initForm(); if (viewMode() == Kexi::DesignViewMode) { connect(form(), SIGNAL(propertySetSwitched()), this, SLOT(slotPropertySetSwitched())); connect(form(), SIGNAL(modified(bool)), this, SLOT(setDirty(bool))); connect(d->scrollView, SIGNAL(resized()), this, SLOT(setFormModified())); connect(d->dbform, SIGNAL(handleDragMoveEvent(QDragMoveEvent*)), this, SLOT(slotHandleDragMoveEvent(QDragMoveEvent*))); connect(d->dbform, SIGNAL(handleDropEvent(QDropEvent*)), this, SLOT(slotHandleDropEvent(QDropEvent*))); // action stuff plugSharedAction("formpart_taborder", form(), SLOT(editTabOrder())); plugSharedAction("formpart_adjust_size", form(), SLOT(adjustWidgetSize())); //! @todo add formpart_pixmap_collection action //! @todo add formpart_connections action plugSharedAction("edit_copy", form(), SLOT(copyWidget())); plugSharedAction("edit_cut", form(), SLOT(cutWidget())); plugSharedAction("edit_paste", form(), SLOT(pasteWidget())); plugSharedAction("edit_delete", form(), SLOT(deleteWidget())); plugSharedAction("edit_select_all", form(), SLOT(selectAll())); plugSharedAction("formpart_clear_contents", form(), SLOT(clearWidgetContent())); plugSharedAction("edit_undo", form(), SLOT(undo())); plugSharedAction("edit_redo", form(), SLOT(redo())); //! @todo add formpart_layout_menu action plugSharedAction("formpart_layout_hbox", form(), SLOT(layoutHBox())); plugSharedAction("formpart_layout_vbox", form(), SLOT(layoutVBox())); plugSharedAction("formpart_layout_grid", form(), SLOT(layoutGrid())); #ifdef KEXI_SHOW_SPLITTER_WIDGET plugSharedAction("formpart_layout_hsplitter", form(), SLOT(layoutHSplitter())); plugSharedAction("formpart_layout_vsplitter", form(), SLOT(layoutVSplitter())); #endif plugSharedAction("formpart_break_layout", form(), SLOT(breakLayout())); plugSharedAction("formpart_format_raise", form(), SLOT(bringWidgetToFront())); plugSharedAction("formpart_format_lower", form(), SLOT(sendWidgetToBack())); plugSharedAction("other_widgets_menu", form(), 0); setAvailable("other_widgets_menu", true); plugSharedAction("formpart_align_menu", form(), 0); plugSharedAction("formpart_align_to_left", form(), SLOT(alignWidgetsToLeft())); plugSharedAction("formpart_align_to_right", form(), SLOT(alignWidgetsToRight())); plugSharedAction("formpart_align_to_top", form(), SLOT(alignWidgetsToTop())); plugSharedAction("formpart_align_to_bottom", form(), SLOT(alignWidgetsToBottom())); plugSharedAction("formpart_align_to_grid", form(), SLOT(alignWidgetsToGrid())); plugSharedAction("formpart_adjust_size_menu", form(), 0); plugSharedAction("formpart_adjust_to_fit", form(), SLOT(adjustWidgetSize())); plugSharedAction("formpart_adjust_size_grid", form(), SLOT(adjustSizeToGrid())); plugSharedAction("formpart_adjust_height_small", form(), SLOT(adjustHeightToSmall())); plugSharedAction("formpart_adjust_height_big", form(), SLOT(adjustHeightToBig())); plugSharedAction("formpart_adjust_width_small", form(), SLOT(adjustWidthToSmall())); plugSharedAction("formpart_adjust_width_big", form(), SLOT(adjustWidthToBig())); plugSharedAction("format_font", form(), SLOT(changeFont())); // - setup local actions QList<QAction*> viewActions; QAction* a; a = form()->action("edit_undo"); a->setProperty("iconOnly", true); viewActions << a; a = form()->action("edit_redo"); a->setProperty("iconOnly", true); viewActions << a; setViewActions(viewActions); }
void NimCodeStyleSettingsPage::finish() { deleteWidget(); }
void sipQWidgetAction::sipProtectVirt_deleteWidget(bool sipSelfWasArg,QWidget*a0) { (sipSelfWasArg ? QWidgetAction::deleteWidget(a0) : deleteWidget(a0)); }
void ItemOrderList::removeItem(QListWidgetItem *item) { ItemWidgetPair pair = m_items.take(item); deleteWidget(pair.widget); delete item; }
ConfigItem::~ConfigItem() { deleteWidget(); }
NimCodeStyleSettingsPage::~NimCodeStyleSettingsPage() { deleteWidget(); }