Пример #1
0
void QDeclarativeWebView::init()
{
    d = new QDeclarativeWebViewPrivate(this);

    if (QWebSettings::iconDatabasePath().isNull() &&
        QWebSettings::globalSettings()->localStoragePath().isNull() &&
        QWebSettings::offlineStoragePath().isNull() &&
        QWebSettings::offlineWebApplicationCachePath().isNull())
        QWebSettings::enablePersistentStorage();

    setAcceptedMouseButtons(Qt::LeftButton);
    setFlag(QGraphicsItem::ItemHasNoContents, true);
    setFlag(QGraphicsItem::ItemIsFocusScope, true);
    setClip(true);

    d->view = new GraphicsWebView(this);
    d->view->setResizesToContents(true);
    d->view->setFocus();
    QWebPage* wp = new QDeclarativeWebPage(this);
    setPage(wp);
    if (!preferredWidth())
        setPreferredWidth(d->view->preferredWidth());
    if (!preferredHeight())
        setPreferredHeight(d->view->preferredHeight());
    connect(d->view, SIGNAL(geometryChanged()), this, SLOT(updateDeclarativeWebViewSize()));
    connect(d->view, SIGNAL(doubleClick(int,int)), this, SIGNAL(doubleClick(int,int)));
    connect(d->view, SIGNAL(scaleChanged()), this, SIGNAL(contentsScaleChanged()));
}
void TimelineGraphicsLayout::setWidth(int width)
{
    m_rulerItem->setSizeHints(width);
    m_placeholder1->setMinimumWidth(width);
    m_placeholder2->setMinimumWidth(width);
    setPreferredWidth(width);
    setMaximumWidth(width);
}
Пример #3
0
void
QDeclarativeMozView::init()
{
    setAcceptedMouseButtons(Qt::LeftButton);
    setFlag(QGraphicsItem::ItemHasNoContents, true);
    setFlag(QGraphicsItem::ItemIsFocusScope, true);
    setClip(true);

    d->view = new GraphicsMozView(this);
    d->view->setFocus();
    if (!preferredWidth())
        setPreferredWidth(d->view->preferredWidth());
    if (!preferredHeight())
        setPreferredHeight(d->view->preferredHeight());
}
void MImWordTracker::setCandidate(const QString &string)
{
    mCandidate = string;
    if (isVisible()
        && showHideTimeline.state() == QTimeLine::Running
        && showHideTimeline.direction() == QTimeLine::Backward) {
        // don't update during hiding animation
        return;
    }
    candidateItem->setTitle(string);

    mIdealWidth = candidateItem->idealWidth();;
    // not less than minimum width
    if (mIdealWidth < minimumSize().width())
        mIdealWidth = minimumSize().width();

    mIdealWidth += style()->paddingLeft() + style()->paddingRight()
                   + style()->marginLeft() + style()->marginRight();
    setPreferredWidth(mIdealWidth);
}
Пример #5
0
void Embellishment::updateBoundingRect()
{
    int gracesCnt = m_pitches.count();
    qreal width = gracesCnt * m_graceWidth + (gracesCnt - 1) * m_graceSpace;
    int numberOfLines = 0;  //Number of gracenotes with line through head
    foreach(qreal pitch, m_pitches){
        if(hasLineThroughHead(pitch)){
            width += m_spaceForLine;
            numberOfLines++;
        }
    }
    if( width <= 0 ) { width = 1; };
    m_rect = QRectF(0, m_pitchList->baseLine()-4.1*m_pitchList->lineHeight(),
                    width, 7.6*m_pitchList->lineHeight());
    if(gracesCnt == 1){
        m_rect.adjust(0.0, 0.0, m_flagRect.width(), 0.0);
    }
    setMinimumWidth(m_rect.width());
    setPreferredWidth(m_rect.width());
    setMaximumWidth(m_rect.width());
}
Пример #6
0
void JobViewServer::readConfiguration() {
  setMinimumWidth(JobViewConfig::minimumWidth());
  setPreferredWidth(JobViewConfig::preferredWidth());
}
Пример #7
0
void KWidget::setFixWidth( qreal w )
{
    setMinimumWidth(w);
    setPreferredWidth(w);
    setMaximumWidth(w);
}
Пример #8
0
void KWidget::setWidthToChild(bool on)
{
    setPreferredWidth(-1);
    setMaximumWidth(-1);
    setMinimumWidth(-1);
}