示例#1
0
ResultScene::ResultScene(SharedResultData *resultData, Plasma::RunnerManager *manager, QWidget *focusBase, QObject *parent)
    : QGraphicsScene(parent),
      m_runnerManager(manager),
      m_viewableHeight(0),
      m_currentIndex(0),
      m_focusBase(focusBase),
      m_resultData(resultData)
{
    setItemIndexMethod(NoIndex);

    connect(m_runnerManager, SIGNAL(matchesChanged(QList<Plasma::QueryMatch>)),
            this, SLOT(setQueryMatches(QList<Plasma::QueryMatch>)));

    m_clearTimer.setSingleShot(true);
    m_clearTimer.setInterval(200);
    connect(&m_clearTimer, SIGNAL(timeout()), this, SLOT(clearMatches()));

    m_arrangeTimer.setSingleShot(true);
    m_arrangeTimer.setInterval(50);
    connect(&m_arrangeTimer, SIGNAL(timeout()), this, SLOT(arrangeItems()));

    m_selectionBar = new SelectionBar(0);
    connect(m_selectionBar, SIGNAL(appearanceChanged()), this, SLOT(updateItemMargins()));
    connect(m_selectionBar, SIGNAL(targetItemReached(QGraphicsItem*)), this, SLOT(highlightItem(QGraphicsItem*)));
    m_selectionBar->hide();
    updateItemMargins();

    addItem(m_selectionBar);
}
示例#2
0
void QgsAnnotation::setFrameOffsetFromReferencePoint( QPointF offset )
{
  mOffsetFromReferencePoint = offset;
  updateBalloon();
  emit moved();
  emit appearanceChanged();
}
示例#3
0
void QgsAnnotation::setFrameSize( QSizeF size )
{
  QSizeF frameSize = minimumFrameSize().expandedTo( size ); //don't allow frame sizes below minimum
  mFrameSize = frameSize;
  updateBalloon();
  emit moved();
  emit appearanceChanged();
}
示例#4
0
void QgsAnnotation::setVisible( bool visible )
{
  if ( mVisible == visible )
    return;

  mVisible = visible;
  emit appearanceChanged();
}
示例#5
0
void Clock::init()
{
    ClockApplet::init();

    dataEngine("time")->connectSource(currentTimezone(), this, updateInterval(), intervalAlignment());
    connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(updateColors()));
    connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), SLOT(resetSize()));
    connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), SLOT(updateClock(int)));
}
示例#6
0
MyObject::MyObject()
    : QObject(0L, "testobj")
{
    connect(kapp, SIGNAL(kdisplayPaletteChanged()), SLOT(slotPaletteChanged()));
    connect(kapp, SIGNAL(kdisplayFontChanged()), SLOT(slotFontChanged()));
    connect(kapp, SIGNAL(kdisplayStyleChanged()), SLOT(slotStyleChanged()));
    connect(kapp, SIGNAL(backgroundChanged(int)), SLOT(slotBackgroundChanged(int)));
    connect(kapp, SIGNAL(appearanceChanged()), SLOT(slotAppearanceChanged()));
    connect(kapp, SIGNAL(kipcMessage(int,int)), SLOT(slotMessage(int,int)));
}
示例#7
0
K3b::ThemedLabel::ThemedLabel( K3b::Theme::PixmapType pix, QWidget* parent )
    : KSqueezedTextLabel( parent )
{
    setThemePixmap( pix );
    setTextElideMode( Qt::ElideRight );

    connect( k3bappcore->themeManager(), SIGNAL(themeChanged()),
             this, SLOT(slotThemeChanged()) );
    connect( KGlobalSettings::self(), SIGNAL(appearanceChanged()),
             this, SLOT(slotThemeChanged()) );
}
示例#8
0
void KGameProgress::initialize()
{
	format_ = "%p%";
	use_supplied_bar_color = false;
	bar_pixmap = 0;
	bar_style = Solid;
	text_enabled = TRUE;
	setBackgroundMode( PaletteBackground );
	connect(kapp, SIGNAL(appearanceChanged()), this, SLOT(paletteChange()));
	paletteChange();
}
示例#9
0
K3b::ThemedLabel::ThemedLabel( const QString& text, QWidget* parent )
    : KSqueezedTextLabel( text, parent ),
      m_themePixmapCode( -1 )
{
    slotThemeChanged();
    setTextElideMode( Qt::ElideRight );

    connect( k3bappcore->themeManager(), SIGNAL(themeChanged()),
             this, SLOT(slotThemeChanged()) );
    connect( KGlobalSettings::self(), SIGNAL(appearanceChanged()),
             this, SLOT(slotThemeChanged()) );
}
示例#10
0
void QgsFormAnnotation::setAssociatedFeature( const QgsFeature &feature )
{
  QgsAnnotation::setAssociatedFeature( feature );

  //create new embedded widget
  mDesignerWidget.reset( createDesignerWidget( mDesignerForm ) );
  if ( mDesignerWidget && fillSymbol() )
  {
    QgsFillSymbol *newFill = fillSymbol()->clone();
    newFill->setColor( mDesignerWidget->palette().color( QPalette::Window ) );
    setFillSymbol( newFill );
  }
  emit appearanceChanged();
}
示例#11
0
PrintDialog::PrintDialog(QWidget* parent, const char* name)
  : Inherited( parent, name )
{
  // ###########################################################################
  buttonOK->setDefault(true);
  buttonOK->setAutoDefault(true);
  buttonOK->setFocus();
  labelHeadline->setText(i18n("Headline text:"));
  labelRightFooter->setText(i18n("Right footer text:"));
  labelLeftFooter->setText(i18n("Left footer text:"));
  connect(kapp, SIGNAL(appearanceChanged()), SLOT(initializeGeometry()));
  initializeGeometry();
  // ###########################################################################
}
示例#12
0
bool Entity::removeEffect(StatusEffect::Kind kind)
{
    if (!effects[kind])
        return false;

    Stats stchg;
    effects[kind]->getChange(stchg);
    stats -= stchg;

    delete effects[kind];
    effects[kind] = 0;

    if (kind == StatusEffect::CONCEAL)
        appearanceChanged();

    return true;
}
示例#13
0
StatusEffect *Entity::addStatusEffect(int seid)
{
    BaseEffect *be = BaseEffect::getById(seid);
    if (!be || effects[be->kind]) //lolo effects be kind pls
        return 0;

    StatusEffect *res = effects[be->kind] = new StatusEffect(be);
    if (be->kind == StatusEffect::CONCEAL) {
        m->forEachNearby(this, [&](Entity *e) {
            if (this != e && res->getVal() > e->getSightLevel())
            e->unshowViewable(this);
        });
        appearanceChanged();
    }

    return res;
}
示例#14
0
void QgsHtmlAnnotation::setAssociatedFeature( const QgsFeature &feature )
{
  QgsAnnotation::setAssociatedFeature( feature );
  QString newText;
  QgsVectorLayer *vectorLayer = qobject_cast< QgsVectorLayer * >( mapLayer() );
  if ( feature.isValid() && vectorLayer )
  {
    QgsExpressionContext context( QgsExpressionContextUtils::globalProjectLayerScopes( vectorLayer ) );
    context.setFeature( feature );
    newText = QgsExpression::replaceExpressionText( mHtmlSource, &context );
  }
  else
  {
    newText = mHtmlSource;
  }
  mWebPage->mainFrame()->setHtml( newText );
  emit appearanceChanged();
}
示例#15
0
void QgsFormAnnotation::setDesignerForm( const QString &uiFile )
{
  mDesignerForm = uiFile;
  mDesignerWidget.reset( createDesignerWidget( uiFile ) );
  if ( mDesignerWidget )
  {
    mMinimumSize = mDesignerWidget->minimumSize();
    if ( fillSymbol() )
    {
      QgsFillSymbol *newFill = fillSymbol()->clone();
      newFill->setColor( mDesignerWidget->palette().color( QPalette::Window ) );
      setFillSymbol( newFill );
    }
    // convert from size in pixels at 96 dpi to mm
    setFrameSizeMm( preferredFrameSize() / 3.7795275 );
  }
  emit appearanceChanged();
}
示例#16
0
void QgsHtmlAnnotation::setSourceFile( const QString &htmlFile )
{
  QFile file( htmlFile );
  mHtmlFile = htmlFile;
  if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
  {
    mHtmlSource.clear();
  }
  else
  {
    QTextStream in( &file );
    in.setCodec( "UTF-8" );
    mHtmlSource = in.readAll();
  }

  file.close();
  setAssociatedFeature( associatedFeature() );
  emit appearanceChanged();
}
示例#17
0
void QgsAnnotation::setMarkerSymbol( QgsMarkerSymbol *symbol )
{
  mMarkerSymbol.reset( symbol );
  emit appearanceChanged();
}
示例#18
0
void QgsAnnotation::setContentsMargin( const QgsMargins &margins )
{
  mContentsMargins = margins;
  emit appearanceChanged();
}
示例#19
0
void QgsAnnotation::setFillSymbol( QgsFillSymbol *symbol )
{
  mFillSymbol.reset( symbol );
  emit appearanceChanged();
}
示例#20
0
void DateTimeGroup::init(){
	configChanged();
	dataEngine("datetimegroup")->connectSource(currentTimezone(), this, updateInterval(), intervalAlignment() );
	connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(updateColors()));
	connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), SLOT(resetSize()));
}