コード例 #1
0
bool AudioProcessor::Bus::enable (bool shouldEnable)
{
    if (isEnabled() == shouldEnable)
        return true;

    return setCurrentLayout (shouldEnable ? lastLayout : AudioChannelSet::disabled());
}
コード例 #2
0
void KeyboardApplet::drawCurrentLayout(QString layout)
{
    if(layout.isEmpty())
    {
        layout = Keyboard::getCurrentLayout();
    }

    if(layout.isEmpty() || (m_current_layout != layout))
    {
        // Set layout to current layout
        setCurrentLayout(m_current_layout);
    }

    if(!layout.isEmpty())
    {
        qDebug() << layout;
        QImage img(30, 16, QImage::Format_RGB888);

        QPainter p(&img);
        p.fillRect(0,0,30,16, Qt::white);
        p.setPen(QPen(Qt::black));
        p.drawText(img.rect(), Qt::AlignCenter, layout);
        m_textItem->setImage(img);
    }
}
コード例 #3
0
bool KeyboardApplet::init()
{
    setInteractive(true);

    setCurrentLayout(m_current_layout);

    return true;
}
コード例 #4
0
QgsLayoutItemComboBox::QgsLayoutItemComboBox( QWidget *parent, QgsLayout *layout )
  : QComboBox( parent )
{
  setCurrentLayout( layout );

  setModelColumn( QgsLayoutModel::ItemId );
  connect( this, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutItemComboBox::indexChanged );
}
コード例 #5
0
EmoticonSelectorPage::EmoticonSelectorPage(EmoticonSelector* parent, QStringList set, bool isFav)
	: QWidget(parent), m_set(set), m_isFav(isFav)
{
	m_parentSelector = parent;
	setCurrentLayout();

	setFixedSize(sizeHint());
}
コード例 #6
0
void EmoticonSelectorPage::setupFavouriteEmoticons()
{
	FavouriteEmoticonsDialog dlg;
	connect (&dlg, SIGNAL(doubleClicked(QString)), m_parentSelector, SLOT(slotClicked(QString)));
	if (dlg.exec() == QDialog::Accepted)
	{
		delete this->layout();
		delete emotions;

		setCurrentLayout();
		correctSize();
	}
}
コード例 #7
0
void KeyboardApplet::changeBackword()
{
    if(m_supported_layouts.count() < 2)
        return;

    int pos = m_supported_layouts.indexOf(m_current_layout);

    if(pos <= 0)
    {
        m_current_layout = m_supported_layouts.at(m_supported_layouts.count() -1);
    }
    else
    {
        m_current_layout = m_supported_layouts.at(pos-1);
    }
    setCurrentLayout(m_current_layout);
}
コード例 #8
0
void KeyboardApplet::changeForward()
{
    if(m_supported_layouts.count() < 2)
        return;

    int pos = m_supported_layouts.indexOf(m_current_layout);

    if(pos >= (m_supported_layouts.count() - 1))
    {
        m_current_layout = m_supported_layouts.at(0);
    }
    else
    {
        m_current_layout = m_supported_layouts.at(pos+1);
    }
    setCurrentLayout(m_current_layout);
}
コード例 #9
0
bool AudioProcessor::Bus::setCurrentLayoutWithoutEnabling (const AudioChannelSet& set)
{
    if (! set.isDisabled())
    {
        if (isEnabled())
            return setCurrentLayout (set);

        if (isLayoutSupported (set))
        {
            lastLayout = set;
            return true;
        }

        return false;
    }

    return isLayoutSupported (set);
}
コード例 #10
0
QS60StylePrivate::QS60StylePrivate()
{
    setCurrentLayout(0);
}