本文整理汇总了C++中QFileOpenEvent类的典型用法代码示例。如果您正苦于以下问题:C++ QFileOpenEvent类的具体用法?C++ QFileOpenEvent怎么用?C++ QFileOpenEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QFileOpenEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: event
bool Application::event(QEvent* event)
{
bool eaten = false;
if (event->type() == QEvent::FileOpen)
{
QFileOpenEvent* fileOpenEvent = static_cast<QFileOpenEvent*>(event);
if (mMainWindow)
{
mMainWindow->openUrl(fileOpenEvent->url());
}
else
{
mUrl = fileOpenEvent->url();
}
eaten = true;
}
else
{
eaten = QApplication::event(event);
}
return eaten;
}
示例2: switch
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);
}
}
示例3: QT_VERSION_CHECK
/**
* Handle tablet proximity events. When the eraser is brought near
* the tablet surface, switch to eraser tool on all windows.
* When the tip leaves the surface, switch back to whatever tool
* we were using before.
*
* Also, on MacOS we must also handle the Open File event.
*/
bool DrawpileApp::event(QEvent *e) {
if(e->type() == QEvent::TabletEnterProximity || e->type() == QEvent::TabletLeaveProximity) {
QTabletEvent *te = static_cast<QTabletEvent*>(e);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
if(te->pointerType()==QTabletEvent::Eraser)
emit eraserNear(e->type() == QEvent::TabletEnterProximity);
#else
if(e->type() == QEvent::TabletEnterProximity) {
if(te->pointerType()==QTabletEvent::Eraser)
emit eraserNear(true);
else
emit eraserNear(false);
}
#endif
return true;
} else if(e->type() == QEvent::FileOpen) {
QFileOpenEvent *fe = static_cast<QFileOpenEvent*>(e);
// Note. This is currently broken in Qt 5.3.1:
// https://bugreports.qt-project.org/browse/QTBUG-39972
openUrl(fe->url());
return true;
}
return QApplication::event(e);
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
示例7: 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);
}
示例8: event
bool MumbleApplication::event(QEvent *e) {
if (e->type() == QEvent::FileOpen) {
QFileOpenEvent *foe = static_cast<QFileOpenEvent *>(e);
if (! g.mw) {
this->quLaunchURL = foe->url();
} else {
g.mw->openUrl(foe->url());
}
return true;
}
return QApplication::event(e);
}
示例9: 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);
}
示例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;
}
示例11: 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);
}
示例12: event
bool QAppMumble::event(QEvent *e) {
#if QT_VERSION >= 0x040600
if (e->type() == QEvent::FileOpen) {
QFileOpenEvent *foe = static_cast<QFileOpenEvent *>(e);
if (! g.mw) {
this->quLaunchURL = foe->url();
} else {
g.mw->openUrl(foe->url());
}
return true;
}
#endif
return QApplication::event(e);
}
示例13: Q_ASSERT
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;
}
示例14: 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);
}
}
示例15: switch
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 );
}