Пример #1
0
bool SFX::init()
{
  Log.p("SFX::init()").eol();
  if (m_player)
    m_player->init();
  scanFonts();
  if (m_player)
    m_player->mute(true); // nothing is happening; connect shutdown pin.
  return true;
}
Пример #2
0
PropertyWindow::PropertyWindow(QWidget *parent)
: QDockWidget(parent), mOpacitySliderMoved(false)
{
	setupUi(this);

	// загрузка иконок кнопок
	mLockTextureSizeIcon = QIcon(":/images/size_locked.png");
	mUnlockTextureSizeIcon = QIcon(":/images/size_unlocked.png");

	connect(mRotationAngleComboBox->lineEdit(), SIGNAL(editingFinished()), this, SLOT(onRotationAngleEditingFinished()));
	connect(mFontSizeComboBox->lineEdit(), SIGNAL(editingFinished()), this, SLOT(onFontSizeEditingFinished()));
	connect(mLineSpacingComboBox->lineEdit(), SIGNAL(editingFinished()), this, SLOT(onLineSpacingEditingFinished()));

	// для обработки сигнала щелчка по QFrame-ам
	mSpriteColorFrame->installEventFilter(this);
	mLabelColorFrame->installEventFilter(this);

	// для объединения кнопок в группы
	mHorzAlignmentButtonGroup = new QButtonGroup(this);
	mVertAlignmentButtonGroup = new QButtonGroup(this);
	mHorzAlignmentButtonGroup->addButton(mHorzAlignmentLeftPushButton);
	mHorzAlignmentButtonGroup->addButton(mHorzAlignmentCenterPushButton);
	mHorzAlignmentButtonGroup->addButton(mHorzAlignmentRightPushButton);
	mVertAlignmentButtonGroup->addButton(mVertAlignmentTopPushButton);
	mVertAlignmentButtonGroup->addButton(mVertAlignmentCenterPushButton);
	mVertAlignmentButtonGroup->addButton(mVertAlignmentBottomPushButton);
	connect(mHorzAlignmentButtonGroup, SIGNAL(buttonClicked(QAbstractButton *)), this, SLOT(onHorzAlignmentClicked(QAbstractButton *)));
	connect(mVertAlignmentButtonGroup, SIGNAL(buttonClicked(QAbstractButton *)), this, SLOT(onVertAlignmentClicked(QAbstractButton *)));

	// по умолчанию окно свойств пустое
	mScrollArea->setVisible(false);
	mNoSelectedObjectsLabel->setVisible(true);
	mLocalizationWidget->setVisible(false);

	// установка валидаторов
	mPositionXLineEdit->setValidator(new PropertyDoubleValidator(-1000000.0, 1000000.0, PRECISION, this, &PropertyWindow::getCurrentPositionX));
	mPositionYLineEdit->setValidator(new PropertyDoubleValidator(-1000000.0, 1000000.0, PRECISION, this, &PropertyWindow::getCurrentPositionY));
	mSizeWLineEdit->setValidator(new PropertyDoubleValidator(1.0, 1000000.0, PRECISION, this, &PropertyWindow::getCurrentSizeW));
	mSizeHLineEdit->setValidator(new PropertyDoubleValidator(1.0, 1000000.0, PRECISION, this, &PropertyWindow::getCurrentSizeH));
	mRotationAngleComboBox->setValidator(new PropertyDoubleValidator(0.0, 359.999999, PRECISION, this, &PropertyWindow::getCurrentRotationAngle));
	mRotationCenterXLineEdit->setValidator(new PropertyDoubleValidator(-1000000.0, 1000000.0, PRECISION, this, &PropertyWindow::getCurrentRotationCenterX));
	mRotationCenterYLineEdit->setValidator(new PropertyDoubleValidator(-1000000.0, 1000000.0, PRECISION, this, &PropertyWindow::getCurrentRotationCenterY));
	mFontSizeComboBox->setValidator(new PropertyIntValidator(1, 1000, this, &PropertyWindow::getCurrentFontSize));
	mLineSpacingComboBox->setValidator(new PropertyDoubleValidator(0.0, 10.0, PRECISION, this, &PropertyWindow::getCurrentLineSpacing));

	// настройка свойств
	mLabelFileNameComboBox->lineEdit()->setPlaceholderText("Разные значения");
	mLabelFileNameComboBox->lineEdit()->setReadOnly(true);
	mFontSizeComboBox->lineEdit()->setPlaceholderText("Разные значения");
	mLineSpacingComboBox->lineEdit()->setPlaceholderText("Разные значения");

	// загрузка и отображение списка доступных шрифтов в комбобоксе
	scanFonts();
}