Ejemplo n.º 1
0
FMMatchRaster::FMMatchRaster ( QWidget * parent )
		:QDialog ( parent )
{
	setupUi ( this );
	QSettings settings;
	m_compsize = settings.value ( "MatchRaster/CompareSize", 120 ).toInt();
	m_matchLimit = settings.value ( "MatchRaster/Limit", 800.0 ).toDouble();
	m_minRefSize = settings.value ( "MatchRaster/ReferenceSize", 160 ).toInt();

	m_progressValue = 0;
	m_waitingForButton = false;
	waitingFont = 0;
	refCodepoint = 0;


	connect ( browseButton,SIGNAL ( clicked() ),this, SLOT ( browseImage() ) );
	connect ( grabZoom , SIGNAL ( valueChanged(int) ) ,this, SLOT ( zoomChanged(int)) );
	connect ( grabModeBox , SIGNAL ( toggled(bool) ) ,this, SLOT ( enterGrabMode(bool) ) );
	connect ( tweakRectBox, SIGNAL(toggled(bool)),this,SLOT(switchControlRect(bool)));
	connect ( letter,SIGNAL ( textChanged ( const QString & ) ),this,SLOT ( addImage ( const QString & ) ) );
	connect ( searchButton,SIGNAL ( clicked() ),this,SLOT ( search() ) );

	connect ( iView,SIGNAL ( rectChange ( QRect ) ),this,SLOT ( recordCurrentRect ( QRect ) ) );
	connect ( iView,SIGNAL ( selColorChanged ( QRgb ) ),this,SLOT ( recordCurrentColor ( QRgb ) ) );

	connect ( buttonBox,SIGNAL ( rejected() ),this,SLOT ( slotRefuseFont() ) );
	connect ( buttonBox,SIGNAL ( accepted() ),this,SLOT ( slotAcceptFont() ) );

	connect ( stopButton,SIGNAL ( clicked() ), this, SLOT ( slotStop() ) );
}
Ejemplo n.º 2
0
/** Creates the EffectsScrollArea object. Sets up GUI. */
EffectsScrollArea::EffectsScrollArea(QWidget *parent) : QScrollArea(parent) {
    setupUi(this);

    // create connections
    connect(filterColorRadioButton, SIGNAL(toggled(bool)),
            this, SLOT(filterToogled(bool)) );
    connect(filterTypeComboBox, SIGNAL(currentIndexChanged(int)),
            this, SLOT(filterTypeChanged(int)) );
    connect(filterGradientWidget, SIGNAL(gradientChanged()),
            filterBrushFrame, SLOT(changeGradient()) );
    connect(imagePathPushButton, SIGNAL(clicked()), this, SLOT(browseImage()));
    connect(textXComboBox, SIGNAL(currentIndexChanged(QString)),
            textXSpinBox, SLOT(posUnitChanged(QString)) );
    connect(textYComboBox, SIGNAL(currentIndexChanged(QString)),
            textYSpinBox, SLOT(posUnitChanged(QString)) );
    connect(imageXComboBox, SIGNAL(currentIndexChanged(QString)),
            imageXSpinBox, SLOT(posUnitChanged(QString)) );
    connect(imageYComboBox, SIGNAL(currentIndexChanged(QString)),
            imageYSpinBox, SLOT(posUnitChanged(QString)) );

    filterBrushFrame->setColorDialogOptions(0);
    filterBrushFrame->setGradientType(QGradient::LinearGradient);
    filterBrushFrame->setGradientStops(filterGradientWidget->gradientStops());
    filterTypeComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    textColorFrame->setColor(Qt::black);

    // set combo box models
    setupFilterModels();
    filterToogled(filterColorRadioButton->isChecked());
    QAbstractItemModel *posUnitModel = textXComboBox->model();
    textYComboBox->setModel(posUnitModel);
    imagePositionComboBox->setModel(textPositionComboBox->model());
    imageXComboBox->setModel(posUnitModel);
    imageYComboBox->setModel(posUnitModel);

    // set range
    const QPair<int, int> posRange(-20000, 20000);
    textXSpinBox->setRange(posRange.first, posRange.second);
    textYSpinBox->setRange(posRange.first, posRange.second);
    imageXSpinBox->setRange(posRange.first, posRange.second);
    imageYSpinBox->setRange(posRange.first, posRange.second);
    imageRotationSpinBox->setRange(textRotationSpinBox->minimum(),
                                   textRotationSpinBox->maximum());

    // set icons
    textBoldPushButton->setIcon(QIcon::fromTheme("format-text-bold"));
    textItalicPushButton->setIcon(QIcon::fromTheme("format-text-italic"));
    textUnderlinePushButton->setIcon(QIcon::fromTheme("format-text-underline"));
    textStrikeOutPushButton->setIcon(QIcon::fromTheme("format-text-strikethrough"));
}