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


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

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


在下文中一共展示了QFileOpenEvent::url方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:galexcode,项目名称:Default-Web-Browser,代码行数:26,代码来源:Application.cpp

示例2: 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);
}
开发者ID:Sophira,项目名称:mumble,代码行数:12,代码来源:MumbleApplication.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 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);
}
开发者ID:martijns,项目名称:mumble,代码行数:14,代码来源:main.cpp

示例5: event

/**
 * 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);
}
开发者ID:ideallx,项目名称:Drawpile,代码行数:36,代码来源:main.cpp


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