当前位置: 首页>>代码示例>>C++>>正文


C++ QFileOpenEvent::file方法代码示例

本文整理汇总了C++中QFileOpenEvent::file方法的典型用法代码示例。如果您正苦于以下问题:C++ QFileOpenEvent::file方法的具体用法?C++ QFileOpenEvent::file怎么用?C++ QFileOpenEvent::file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QFileOpenEvent的用法示例。


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

示例1: event

bool TexmakerApp::event(QEvent * event) {
	if (event->type() == QEvent::FileOpen) {
		QFileOpenEvent *oe = static_cast<QFileOpenEvent *>(event);
		if (initialized) mw->load(oe->file());
		else delayedFileLoad = oe->file();
		event->accept();
		return true;
	}
	return QApplication::event(event);
}
开发者ID:svn2github,项目名称:texstudio-trunk,代码行数:10,代码来源:main.cpp

示例2: eventFilter

bool NPlayer::eventFilter(QObject *obj, QEvent *event)
{
	if (event->type() == QEvent::FileOpen) {
		QFileOpenEvent *fileEvent = static_cast<QFileOpenEvent *>(event);

		if (!fileEvent->file().isEmpty())
		m_playlistWidget->playFiles(QStringList() << fileEvent->file());

		return false;
	}

	return QObject::eventFilter(obj, event);
}
开发者ID:susnux,项目名称:nulloy,代码行数:13,代码来源:player.cpp

示例3: eventFilter

//
// OSX-specific way of handling bitcoin: URIs and PaymentRequest mime types.
// Also used by paymentservertests.cpp and when opening a payment request file
// via "Open URI..." menu entry.
//
bool PaymentServer::eventFilter(QObject *object, QEvent *event)
{
    if (event->type() == QEvent::FileOpen) {
        QFileOpenEvent *fileEvent = static_cast<QFileOpenEvent*>(event);
        if (!fileEvent->file().isEmpty())
            handleURIOrFile(fileEvent->file());
        else if (!fileEvent->url().isEmpty())
            handleURIOrFile(fileEvent->url().toString());

        return true;
    }

    return QObject::eventFilter(object, event);
}
开发者ID:TinyUlt,项目名称:bitcoin,代码行数:19,代码来源:paymentserver.cpp

示例4: event

bool MainApplication::event(QEvent* event)
{
	switch(event->type())
	{
		case QEvent::FileOpen:
		{
			QFileOpenEvent * fileEvent = static_cast<QFileOpenEvent *>(event);
			// Handle the project file
			m_queuedFile = fileEvent->file();
			if(Engine::getSong())
			{
				if(gui->mainWindow()->mayChangeProject(true))
				{
					qDebug() << "Loading file " << m_queuedFile;
					Engine::getSong()->loadProject(m_queuedFile);
				}
			}
			else
			{
				qDebug() << "Queuing file " << m_queuedFile;
			}
			return true;
		}
		default:
			return QApplication::event(event);
	}
}
开发者ID:liushuyu,项目名称:lmms,代码行数:27,代码来源:MainApplication.cpp

示例5: event

bool WiresharkApplication::event(QEvent *event)
{
    QString display_filter = NULL;
    if (event->type() == QEvent::FileOpen) {
        QFileOpenEvent *foe = static_cast<QFileOpenEvent *>(event);
        if (foe && foe->file().length() > 0) {
            QString cf_path(foe->file());
            if (initialized_) {
                emit openCaptureFile(cf_path, display_filter, WTAP_TYPE_AUTO);
            } else {
                pending_open_files_.append(cf_path);
            }
        }
        return true;
    }
    return QApplication::event(event);
}
开发者ID:linshimiao,项目名称:wireshark,代码行数:17,代码来源:wireshark_application.cpp

示例6: event

 bool event(QEvent *event) {
     if (event->type() == QEvent::FileOpen) {
         QFileOpenEvent *openEvent = static_cast<QFileOpenEvent*>(event);
         resourceArg = openEvent->file();
         return true;
     }
     else return QApplication::event(event);
 }
开发者ID:examyes,项目名称:shotcut,代码行数:8,代码来源:main.cpp

示例7: event

bool QtSingleApplication::event(QEvent *event)
{
    if (event->type() == QEvent::FileOpen) {
        QFileOpenEvent *foe = static_cast<QFileOpenEvent*>(event);
        emit fileOpenRequest(foe->file());
        return true;
    }
    return QApplication::event(event);
}
开发者ID:kych,项目名称:OrbitsWriter,代码行数:9,代码来源:qtsingleapplication.cpp

示例8: event

bool QxApplication::event(QEvent* event)
{
	if (event->type() == QEvent::FileOpen) {
		QFileOpenEvent* foe = static_cast<QFileOpenEvent*>(event);
		#ifdef Q_WS_MAC
		#ifndef QT_MAC_USE_COCOA
		if (foe->file() == QString()) {
			if (qxApp->mainWindow())
				qxApp->mainWindow()->reopen();
		}
		else
		#endif
		#endif
		emit fileOpen(foe->file());
		return true;
	}
	
	return QApplication::event(event);
}
开发者ID:corelon,项目名称:paco,代码行数:19,代码来源:QxApplication.cpp

示例9: eventFilter

/** \brief Event filter created to catch the FileOpenEvent from MacOS X */
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
{
    if(event->type() == QEvent::FileOpen) {
        QFileOpenEvent *fe = static_cast<QFileOpenEvent *>(event);
        if (fe) {
            readFile(fe->file());
        }
        return true;
    }
    return QObject::eventFilter(obj, event);
}
开发者ID:eads77m,项目名称:freemedforms,代码行数:12,代码来源:mainwindow.cpp

示例10: event

bool Application::event(QEvent* _event)
{
	bool result = true;
	if (_event->type() == QEvent::FileOpen
		&& m_applicationManager != 0) {
		QFileOpenEvent* fileOpenEvent = static_cast<QFileOpenEvent*>(_event);
		m_applicationManager->openFile(::preparePath(fileOpenEvent->file()));
	} else {
		result = QApplication::event(_event);
	}

	return result;
}
开发者ID:Roger-Waters,项目名称:KITScenarist,代码行数:13,代码来源:Application.cpp

示例11: eventFilter

bool cwOpenFileEventHandler::eventFilter(QObject *obj, QEvent *event)
{
    if(event->type() == QEvent::FileOpen) {
        Q_ASSERT(dynamic_cast<QApplication*>(obj) != NULL);
        Q_ASSERT(dynamic_cast<QFileOpenEvent*>(event) != NULL);
        QFileOpenEvent* fileOpenEvent = static_cast<QFileOpenEvent*>(event);
        if(project() != NULL) {
            project()->loadFile(fileOpenEvent->file());\
            event->accept();
            return true;
        }
    }

    return false;
}
开发者ID:balister,项目名称:cavewhere,代码行数:15,代码来源:cwOpenFileEventHandler.cpp

示例12: event

bool Application::event(QEvent *event)
{
	if (event->type() == QEvent::FileOpen)
	{
		QFileOpenEvent *openEvent = static_cast<QFileOpenEvent*>(event);
		QString file = openEvent->file();
		_mainWindow->open(file);

		return true;
	}
	else
	{
		return QApplication::event(event);
	}
}
开发者ID:lvanderlinden,项目名称:jasp-desktop,代码行数:15,代码来源:application.cpp

示例13: event

bool QcApplication::event( QEvent *event )
{
    switch (event->type()) {
    case QEvent::FileOpen: {
        // open the file dragged onto the application icon on Mac
        QFileOpenEvent *fe = static_cast<QFileOpenEvent*>(event);
        interpret( QString("Document.open(\"%1\")").arg(fe->file()), false );
        event->accept();
        return true;
    }
    default:
        break;
    }

    return QApplication::event( event );
}
开发者ID:acamari,项目名称:supercollider,代码行数:16,代码来源:QcApplication.cpp

示例14: event

bool QcApplication::event( QEvent *e )
{
  if( e->type() == QEvent::FileOpen ) {

    // open the file dragged onto the application icon on Mac

    QFileOpenEvent *fe = static_cast<QFileOpenEvent*>(e);

    QtCollider::lockLang();
    gMainVMGlobals->canCallOS = true;

    QString cmdLine = QString("Document.open(\"%1\")").arg(fe->file());
    char *method = strdup( "interpretPrintCmdLine" );
    interpretCmdLine( cmdLine.toStdString().c_str(), cmdLine.size(), method );
    free(method);

    gMainVMGlobals->canCallOS = false;
    QtCollider::unlockLang();

    return true;
  }

  return QApplication::event( e );
}
开发者ID:iani,项目名称:SC_SourceCode_Study,代码行数:24,代码来源:QcApplication.cpp


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