bool ToolBarEventFilter::handleDragEnterMoveEvent(QDragMoveEvent *event) { const ActionRepositoryMimeData *d = qobject_cast<const ActionRepositoryMimeData*>(event->mimeData()); if (!d) return false; if (d->actionList().isEmpty()) { event->ignore(); hideDragIndicator(); return true; } QAction *action = d->actionList().first(); if (!action || action->menu() || m_toolBar->actions().contains(action) || !Utils::isObjectAncestorOf(formWindow()->mainContainer(), action)) { event->ignore(); hideDragIndicator(); return true; } d->accept(event); adjustDragIndicator(event->pos()); return true; }
QDesignerPropertySheetExtension* QDesignerFormWindowCommand::propertySheet(QObject *object) const { return qt_extension<QDesignerPropertySheetExtension*>(formWindow()->core()->extensionManager(), object); }
void SourceEditor::setObject( QObject *o, Project *p ) { if ( sourceFile() ) sourceFile()->setEditor( 0 ); if ( formWindow() ) { formWindow()->formFile()->setCodeEdited( FALSE ); formWindow()->formFile()->setEditor( 0 ); } if ( ::qt_cast<FormWindow*>(o) ) ( (FormWindow*)o )->formFile()->setCodeEdited( TRUE ); save(); bool changed = FALSE; if ( &(*obj) != o ) { saveBreakPoints(); changed = TRUE; } obj = o; pro = p; if ( formWindow() ) { if ( formWindow()->isFake() ) setCaption( formWindow()->project()->objectForFakeForm( formWindow() )->name() ); else setCaption( obj->name() ); } else { setCaption( sourceFile()->fileName() ); } if ( sourceFile() ) sourceFile()->setEditor( this ); else if ( formWindow() ) formWindow()->formFile()->setEditor( this ); iFace->setText( sourceOfObject( obj, lang, iFace, lIface ) ); if ( pro && formWindow() ) { if ( formWindow()->isFake() ) iFace->setContext( pro->objectForFakeFormFile( formWindow()->formFile() ) ); else iFace->setContext( formWindow()->mainContainer() ); } else { iFace->setContext( 0 ); } if ( changed || sourceFile() ) iFace->setBreakPoints( MetaDataBase::breakPoints( o ) ); MainWindow::self->objectHierarchy()->showClasses( this ); }
** the names of its contributors may be used to endorse or promote ** products derived from this software without specific prior written ** permission. ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** $QT_END_LICENSE$ ** ****************************************************************************/ //! [0] QDesignerObjectInspectorInterface *objectInspector = 0; objectInspector = formEditor->objectInspector(); QDesignerFormWindowManagerInterface *manager = 0; manager = formEditor->formWindowManager(); objectInspector->setFormWindow(manager->formWindow(0)); //! [0]
void ButtonTaskMenu::removeFromGroup() { QDesignerFormWindowInterface *fw = formWindow(); if (QUndoCommand *cmd = createRemoveButtonsCommand(fw, buttonList(fw->cursor()))) fw->commandHistory()->push(cmd); }
QMainWindow *QDesignerDockWidget::findMainWindow() const { if (QDesignerFormWindowInterface *fw = formWindow()) return qobject_cast<QMainWindow*>(fw->mainContainer()); return 0; }