Ejemplo n.º 1
0
void KTLayer::cloneFrame(const int& index, int nClones)
{
	if ( nClones <= 0 || nClones >= 100 )
	{
		dDebug() << "Clones out of bound";
		return;
	}
	
	KTKeyFrame *clone = m_frames[index];
	
	if(clone)
	{
		
		for(int i = index+1; i <= (index)+nClones; i++)
		{
			if(i == m_frames.count() )
			{
				m_frames << clone;
				emit frameCreated( clone->frameName(), true );
			}
			else
			{
				emit frameCreated( clone->frameName(), false );
				m_frames.insert ( i, clone );
			}
		}
		clone->setClonesNumber( m_frames.count(clone)-1);
	}
}
Ejemplo n.º 2
0
KTKeyFrame *KTLayer::createFrame(const QString& name, bool addToEnd)
{
	KTKeyFrame *keyFrame = new KTKeyFrame(this);
	
	m_framesCount++;
	
	if(name.isNull())
	{
		keyFrame->setFrameName(tr("Drawing %1").arg(m_framesCount));
	}
	else
	{
		keyFrame->setFrameName( name);
	}
	if ( addToEnd )
	{
		m_frames << keyFrame;
	}
	else
	{
		m_frames.insert(m_frames.indexOf(m_currentFrame)+1, keyFrame);
	}
	
	m_currentFrame = keyFrame;

	emit frameCreated( keyFrame->frameName(), addToEnd );
	
	return keyFrame;
}
Ejemplo n.º 3
0
DisplayWidget::DisplayWidget(QWidget* parent) : QWebView(parent) {
    QWidget::setMinimumSize(0, 30);

    // Sections Information
    _currentSection = 0;
    _maxSections = 1;
    _currentCharacterCount = 0;
    _maxCharacterCount = 300000000;
    _scrollToBottom = true;

    // Create WebKit Display
    page()->mainFrame()->load(QUrl("qrc:/webkitdisplay/page.html"));

    // Connect Signals/Slots
    connect(this, SIGNAL(loadFinished(bool)), SLOT(finishLoading(bool)));
    connect(page(), SIGNAL(contentsChanged()), SLOT(scrollToBottom()));

    // TODO: Why aren't frames working?
    connect(page(), SIGNAL(frameCreated(QWebFrame *frame)),
	    SLOT(loadFrame(QWebFrame *frame)));

    page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
    page()->setContentEditable(false);

    /*
#ifdef USE_JQUERY
    QFile file;
    file.setFileName(":/webkitdisplay/jquery.min.js");
    file.open(QIODevice::ReadOnly);
    _jQuery = file.readAll();
    file.close();
#endif
    */
}
Ejemplo n.º 4
0
WebPage::WebPage(QObject* parent)
    : QWebPage(parent)
    , m_view(0)
    , m_fileWatcher(0)
    , m_runningLoop(0)
    , m_loadProgress(-1)
    , m_blockAlerts(false)
    , m_secureStatus(false)
    , m_adjustingScheduled(false)
{
    m_javaScriptEnabled = QWebSettings::globalSettings()->testAttribute(QWebSettings::JavascriptEnabled);

    m_networkProxy = new NetworkManagerProxy(this);
    m_networkProxy->setPrimaryNetworkAccessManager(mApp->networkManager());
    m_networkProxy->setPage(this);
    setNetworkAccessManager(m_networkProxy);

    setForwardUnsupportedContent(true);
    setPluginFactory(new WebPluginFactory(this));
    history()->setMaximumItemCount(20);

    connect(this, SIGNAL(unsupportedContent(QNetworkReply*)), this, SLOT(handleUnsupportedContent(QNetworkReply*)));
    connect(this, SIGNAL(loadProgress(int)), this, SLOT(progress(int)));
    connect(this, SIGNAL(loadFinished(bool)), this, SLOT(finished()));
    connect(this, SIGNAL(printRequested(QWebFrame*)), this, SLOT(printFrame(QWebFrame*)));
    connect(this, SIGNAL(downloadRequested(QNetworkRequest)), this, SLOT(downloadRequested(QNetworkRequest)));
    connect(this, SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested()));

    frameCreated(mainFrame());
    connect(this, SIGNAL(frameCreated(QWebFrame*)), this, SLOT(frameCreated(QWebFrame*)));

    connect(this, SIGNAL(databaseQuotaExceeded(QWebFrame*,QString)),
            this, SLOT(dbQuotaExceeded(QWebFrame*)));

    connect(mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJavaScriptObject()));

#if QTWEBKIT_FROM_2_2
    connect(this, SIGNAL(featurePermissionRequested(QWebFrame*,QWebPage::Feature)),
            this, SLOT(featurePermissionRequested(QWebFrame*,QWebPage::Feature)));
#endif

#if QTWEBKIT_FROM_2_3
    connect(this, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin*,quint64,quint64)),
            this, SLOT(appCacheQuotaExceeded(QWebSecurityOrigin*,quint64)));
#elif QTWEBKIT_FROM_2_2
    connect(this, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin*,quint64)),
            this, SLOT(appCacheQuotaExceeded(QWebSecurityOrigin*,quint64)));
#endif

    s_livingPages.append(this);
}