• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ closeEditor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中closeEditor函数的典型用法代码示例。如果您正苦于以下问题:C++ closeEditor函数的具体用法?C++ closeEditor怎么用?C++ closeEditor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了closeEditor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: commitData

void NotifyItemDelegate::commitAndCloseEditor()
{
    QLineEdit* editor = qobject_cast<QLineEdit*>(sender());
    if (editor) {
        emit commitData(editor);
        emit closeEditor(editor);
    } else {
        QComboBox* editor = qobject_cast<QComboBox*>(sender());
        if (editor)
        {
            emit commitData(editor);
            emit closeEditor(editor);
        } else {
            QSpinBox* editor = qobject_cast<QSpinBox*>(sender());
            if (editor)
            {
                emit commitData(editor);
                emit closeEditor(editor);
            } else {
                QCheckBox* editor = qobject_cast<QCheckBox*>(sender());
                if (editor)
                {
                    emit commitData(editor);
                    emit closeEditor(editor);
                }
            }
        }
    }
}
开发者ID:1heinz,项目名称:TauLabs,代码行数:29,代码来源:notifyitemdelegate.cpp


示例2: GD_ASSERT

bool QPropertyDelegate::eventFilter(QObject *object, QEvent *event)
{
    QWidget *editor = ::qobject_cast<QWidget*>(object);

    if(!editor)
        return false;

    GD_ASSERT(editor == mActiveEditor);

    if(event->type() == QEvent::KeyPress) 
    {
        switch(static_cast<QKeyEvent *>(event)->key()) 
        {
        case Qt::Key_Tab:
            emit commitData(editor);
            emit closeEditor(editor, QAbstractItemDelegate::EditNextItem);
            mActiveEditor = 0;
            return true;
        case Qt::Key_Backtab:
            emit commitData(editor);
            emit closeEditor(editor, QAbstractItemDelegate::EditPreviousItem);
            mActiveEditor = 0;
            return true;
        case Qt::Key_Enter:
        case Qt::Key_Return:
            emit commitData(editor);
            emit closeEditor(editor, QAbstractItemDelegate::SubmitModelCache);
            mActiveEditor = 0;
            return true;
        case Qt::Key_Escape:
            // don't commit data
            emit closeEditor(editor, QAbstractItemDelegate::RevertModelCache);
            mActiveEditor = 0;
            return true;
        default:
            break;
        }
    } 
    else if(event->type() == QEvent::FocusOut && !editor->isActiveWindow()) 
    {
#ifndef QT_NO_DRAGANDDROP
        // The window may loose focus during an drag operation.
        // i.e when dragging involves the task bar on Windows.
        //if(QDragManager::self() && QDragManager::self()->object != 0)
        //    return false;
#endif
        if( QApplication::activeModalWidget() && QApplication::activeModalWidget()->parent() == editor )
            return true;

        emit commitData(editor);
        emit closeEditor(editor, NoHint);
        mActiveEditor = 0;
        return true;
    }

    return false;
}
开发者ID:SebastienLussier,项目名称:Gamedesk,代码行数:57,代码来源:PropertyList.cpp


示例3: commitData

void SqlDelegate::editor_closeEditor()
{
	SqlDelegateUi *ed = qobject_cast<SqlDelegateUi*>(sender());
	emit commitData(ed);
    emit dataChanged();
	emit closeEditor(ed);
}
开发者ID:ysalmon,项目名称:sqliteman,代码行数:7,代码来源:sqldelegate.cpp


示例4: QString

void SqlDelegateUi::nullButton_clicked(bool)
{
	lineEdit->setText(QString());
	m_sqlData = QString();
    emit textChanged();
	emit closeEditor();
}
开发者ID:ysalmon,项目名称:sqliteman,代码行数:7,代码来源:sqldelegate.cpp


示例5: updateProperty

bool DoubleDialogEditor::eventFilter(QObject *obj, QEvent *evt) {
  if (evt->type() == QEvent::FocusOut) {
    if (obj == m_editor) {
      if (!m_button->hasFocus()) {
        updateProperty();
        emit closeEditor();
      }
    } else if (obj == m_button) {
      if (!m_editor->hasFocus()) {
        updateProperty();
        emit closeEditor();
      }
    }
  }
  return QWidget::eventFilter(obj, evt);
}
开发者ID:liyulun,项目名称:mantid,代码行数:16,代码来源:DoubleDialogEditor.cpp


示例6: if

void QmitkPropertyDelegate::commitAndCloseEditor()
{
  QWidget* editor = 0;
  if(QPushButton *pushBtn = qobject_cast<QPushButton *>(sender()))
  {
/*
    QColor result = QColorDialog::getColor(pushBtn->palette().color(QPalette::Window));
    if(result.isValid())
    {
      QPalette palette = pushBtn->palette();
      palette.setColor(QPalette::Window, result);
      pushBtn->setPalette(palette);
    }*/

    editor = pushBtn;
  }


/*
  else if(QCheckBox *chkBox = qobject_cast<QCheckBox *>(sender()))
  {
    editor = chkBox;
  }*/


  if(editor)
  {
    emit commitData(editor);
    emit closeEditor(editor);
  }

}
开发者ID:beneon,项目名称:MITK,代码行数:32,代码来源:QmitkPropertyDelegate.cpp


示例7: Q_ASSERT

void ComInterfacesDelegate::commitAndCloseEditor() {
	QWidget* edit = qobject_cast<QWidget*>(sender());
	Q_ASSERT(edit);

	emit commitData(edit);
	emit closeEditor(edit);
}
开发者ID:kammoh,项目名称:kactus2,代码行数:7,代码来源:cominterfacesdelegate.cpp


示例8: commitData

// =============================================================================
void TableViewDelegate::commitAndCloseTimeEdit()
{

    QTimeEdit *editor = qobject_cast<QTimeEdit *>(sender());
    emit commitData(editor);
    emit closeEditor(editor);
}
开发者ID:2BlackCoffees,项目名称:EasyTimeTracker,代码行数:8,代码来源:tableviewdelegate.cpp


示例9: commitData

void TableViewMenuEditorDelegate::editingFinished()
{
	TableViewMenuEditor *editor = qobject_cast<TableViewMenuEditor *>(sender());

	emit commitData(editor);
	emit closeEditor(editor);
}
开发者ID:AlexanderLyNL,项目名称:jasp-desktop,代码行数:7,代码来源:tableviewmenueditordelegate.cpp


示例10: commitData

void KWQTableDelegate::commitAndCloseEditor()
{
  QWidget *editor = qobject_cast<QWidget *>(sender());

  emit commitData(editor);
  emit closeEditor(editor, QAbstractItemDelegate::NoHint);
}
开发者ID:phedlund,项目名称:kwordquiz,代码行数:7,代码来源:kwqtabledelegate.cpp


示例11: while

bool AeWindow::confirmCloseEditor(int tabindex) {
	AeEditor *e = (AeEditor*) m_tabs->widget(tabindex);

	if(e->dirty()) {
		QMessageBox confirm;
		confirm.setIcon(QMessageBox::Question);
		confirm.setText("The document `" + e->displayName() + "' has been modified");
		confirm.setInformativeText("Do you want to save your changes?");
		confirm.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
		QAbstractButton* diffButton = confirm.addButton("Show diff...", QMessageBox::ActionRole);

		int result = confirm.exec();
		while(confirm.clickedButton() == diffButton) {
			on_actionDiff_to_Saved_triggered();
			result = confirm.exec();
		}

		switch(result) {
		case QMessageBox::Save:
			if(!on_actionSave_triggered()) return false;
			break;
		case QMessageBox::Discard:
			break;
		case QMessageBox::Cancel:
			return false;
		default:
			ae_assert(false && "branch can't happen");
		}

	}

    return closeEditor(tabindex);
}
开发者ID:ohwgiles,项目名称:aristed,代码行数:33,代码来源:window.cpp


示例12: commitData

void ComboBoxDelegate::commitAndCloseEditor(int)
{
    // Emit the proper signals when editing has finished.
    QComboBox* const editor = qobject_cast<QComboBox*>(sender());
    emit commitData(editor);
    emit closeEditor(editor);
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:7,代码来源:comboboxdelegate.cpp


示例13: commitData

void RadioDelegate::commitMyData()
{
    QWidget *obj = qobject_cast<QWidget*>(sender());

    emit commitData(obj);
    emit closeEditor(obj);
}
开发者ID:doublebyte1,项目名称:app_solution,代码行数:7,代码来源:buttongroup.cpp


示例14: sender

//// Experimental ...
void MultiDelegate::closeEmittingEditor()
{
    QWidget*  ed = qobject_cast<QWidget*>( sender());
    Q_ASSERT(ed);
    // qDebug() << "Closing editor: type=" << ed->metaObject()->className();
    emit closeEditor( ed);
}
开发者ID:micwik,项目名称:ArnBrowser,代码行数:8,代码来源:MultiDelegate.cpp


示例15: Q_ASSERT

void SystemViewsDelegate::commitAndCloseEditor() {
	QWidget* edit = qobject_cast<QWidget*>(sender());
	Q_ASSERT(edit);

	emit commitData(edit);
	emit closeEditor(edit);
}
开发者ID:kammoh,项目名称:kactus2,代码行数:7,代码来源:SystemViewsDelegate.cpp


示例16: commitData

void BusPortsDelegate::commitAndCloseEditor() {
	// try to get pointer to editor in both cases
	QComboBox* combo = qobject_cast<QComboBox*>(sender());
	QLineEdit* lineEdit = qobject_cast<QLineEdit*>(sender());

	// if the editor was combo box
	if (combo) {
		emit commitData(combo);
		emit closeEditor(combo);
	}

	// if editor was line edit
	else if (lineEdit) {
		emit commitData(lineEdit);
		emit closeEditor(lineEdit);
	}
}
开发者ID:kammoh,项目名称:kactus2,代码行数:17,代码来源:busportsdelegate.cpp


示例17: commitData

void AntennaDelegate::commitAndCloseEditor()
{
	QDoubleSpinBox * editor = qobject_cast<QDoubleSpinBox *>(sender());
	// Commit data to the QTreeWidget
	emit commitData(editor);
	// Close the editor
	emit closeEditor(editor);
}
开发者ID:guitorri,项目名称:QAntenna,代码行数:8,代码来源:antennadelegate.cpp


示例18: Q_ASSERT

//-----------------------------------------------------------------------------
// Function: LineEditDelegate::commitAndCloseEditor()
//-----------------------------------------------------------------------------
void LineEditDelegate::commitAndCloseEditor()
{
	QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
	Q_ASSERT(edit);

	emit commitData(edit);
	emit closeEditor(edit);
}
开发者ID:kammoh,项目名称:kactus2,代码行数:11,代码来源:lineeditdelegate.cpp


示例19: commitData

void QmitkPropertyDelegate::ComboBoxCurrentIndexChanged( int  /*index*/ )
{
  if(QComboBox *comboBox = qobject_cast<QComboBox *>(sender()))
  {
    emit commitData(comboBox);
    emit closeEditor(comboBox);
  }
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:8,代码来源:QmitkPropertyDelegate.cpp


示例20: QDialog

MashEditor::MashEditor(QWidget* parent) : QDialog(parent), mashObs(0)
{
   setupUi(this);

   connect(pushButton_fromEquipment, SIGNAL(clicked()), this, SLOT(fromEquipment()) );
   connect(this, SIGNAL(accepted()), this, SLOT(saveAndClose()) );
   connect(this, SIGNAL(rejected()), this, SLOT(closeEditor()) );

}
开发者ID:EvansMike,项目名称:brewtarget,代码行数:9,代码来源:MashEditor.cpp



注:本文中的closeEditor函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ closeFile函数代码示例发布时间:2022-05-30
下一篇:
C++ closeDialog函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap