Пример #1
0
void AreaSettingsDialog::loadFromLineEdits()
{
    qDebug() << "void AreaSettingsDialog::loadFromLineEdits()";
    QLineEdit *edit = qobject_cast<QLineEdit *>(sender());
    int position = 5;
    if(edit == ui->lineEdit_p1) position = 0;
    else if(edit == ui->lineEdit_p2) position = 1;
    else if(edit == ui->lineEdit_p3) position = 2;
    else if(edit == ui->lineEdit_p4) position = 3;
    else return;

    QRegExp rx("(\\d{1,3})[°dh,\\s]{1,}(\\d{1,3})['m,\\s]{1,}(\\d{1,3}.\\d{1,})[s,'' ]{1,2}[ x,]{1,}(\\d{1,3})[°dh,\\s]{1,}(\\d{1,3})['m,\\s]{1,}(\\d{1,3}.\\d{1,})[s,']{1,2}");
    rx.exactMatch(edit->text());
    QStringList captured = rx.capturedTexts();

    QPalette palette;

    if(captured.size() == 7 && rx.exactMatch(edit->text()))
    {
        qDebug() << "if(captured.size() == 7 && rx.exactMatch(edit->text())) true";
        DegMinSec longitude(captured.at(1).toInt(),captured.at(2).toInt(),captured.at(3).toFloat());
        DegMinSec latitude(captured.at(4).toInt(),captured.at(5).toInt(),captured.at(6).toFloat());
        qDebug() << "lat: " << latitude.toDMSString();
        qDebug() << "lon: " << longitude.toDMSString();

        points.at(position) = PointWorldCoord(longitude.toDecimalDegress(),latitude.toDecimalDegress());
        createPolygon();
        emit areaChanged(polygon);
        palette.setColor(QPalette::Foreground,Qt::black);;
    }

    else palette.setColor(QPalette::Foreground,Qt::red);
    edit->setPalette(palette);
}
Пример #2
0
/*!
    \deprecated
    \qmlproperty rectangle QtQuick::TouchPoint::area

    A rectangle covering the area of the touch point, centered on the current
    position of the touch point.

    It is deprecated because a touch point is more correctly modeled as an ellipse,
    whereas this rectangle represents the outer bounds of the ellipse after \l rotation.
*/
void QQuickTouchPoint::setArea(const QRectF &area)
{
    if (_area == area)
        return;
    _area = area;
    emit areaChanged();
}
Пример #3
0
/**
 * @param parent use another QGraphicsItem as a parent
 * @param scene the picture to which this layer belongs to
 */
CanvasItem::CanvasItem(QGraphicsItem *parent)
	: QGraphicsObject(parent)
{
	_image = new paintcore::LayerStack(this);
	connect(_image, SIGNAL(areaChanged(QRect)), this, SLOT(refreshImage(QRect)));
	connect(_image, SIGNAL(resized(int, int)), this, SLOT(canvasResize()));
}
Пример #4
0
void AreaSettingsDialog::onPointSelected(PointWorldCoord point)
{
    if(!PointToSelectOnMap) return;
    points.at(PointToSelectOnMap-1) = point;
    PointToSelectOnMap = 0;
    createPolygon();
    fillLineEdits();
    show();
    emit areaChanged(polygon);
}
Пример #5
0
void AreaItem::updateMainDiagram(const QRectF& rect)
{
    QPointF oldPos = pos();
    QSizeF oldSize = _rect.size();

    prepareGeometryChange();
    _rect = QRectF(QPointF(0, 0), rect.size());
    setPos(rect.topLeft());
    computeResizingGrips();
    update();

    emit areaChanged(this, oldPos, oldSize, pos(), _rect.size());
}
Пример #6
0
QgsUserInputDockWidget::QgsUserInputDockWidget( QWidget *parent )
    : QgsDockWidget( tr( "User Input Panel" ), parent )
    , mLayoutHorizontal( true )
{
  QWidget* w = new QWidget( nullptr );
  mLayout = new QBoxLayout( QBoxLayout::LeftToRight );
  mLayout->setAlignment( Qt::AlignLeft | Qt::AlignTop );
  w->setLayout( mLayout );
  setWidget( w );

  connect( this, SIGNAL( dockLocationChanged( Qt::DockWidgetArea ) ), this, SLOT( areaChanged( Qt::DockWidgetArea ) ) );
  connect( this, SIGNAL( topLevelChanged( bool ) ), this, SLOT( floatingChanged( bool ) ) );
  hide();
}
Пример #7
0
void AreaSettingsDialog::restore()
{
    points.clear();
    points.push_back(PointWorldCoord( 20.4617, 50.7831));
    points.push_back(PointWorldCoord( 20.4627, 50.7828));
    points.push_back(PointWorldCoord( 20.4614, 50.782));
    points.push_back(PointWorldCoord( 20.4603, 50.7824));

    ui->lineEdit_p1->setText(DegMinSec(points.at(0).longitude()).toDMSString() + " x " + DegMinSec(points.at(0).latitude()).toDMSString());
    ui->lineEdit_p2->setText(DegMinSec(points.at(1).longitude()).toDMSString() + " x " + DegMinSec(points.at(1).latitude()).toDMSString());
    ui->lineEdit_p3->setText(DegMinSec(points.at(2).longitude()).toDMSString() + " x " + DegMinSec(points.at(2).latitude()).toDMSString());
    ui->lineEdit_p4->setText(DegMinSec(points.at(3).longitude()).toDMSString() + " x " + DegMinSec(points.at(3).latitude()).toDMSString());
    createPolygon();
    emit areaChanged(polygon);
}
Пример #8
0
TabBarWidget::TabBarWidget(QWidget *parent) : QTabBar(parent),
	m_previewWidget(NULL),
	m_tabSize(0),
	m_maximumTabSize(40),
	m_minimumTabSize(250),
	m_pinnedTabsAmount(0),
	m_clickedTab(-1),
	m_hoveredTab(-1),
	m_previewTimer(0),
	m_showCloseButton(true),
	m_showUrlIcon(true),
	m_enablePreviews(true)
{
	qRegisterMetaType<WindowLoadingState>("WindowLoadingState");
	setDrawBase(false);
	setExpanding(false);
	setMovable(true);
	setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab);
	setElideMode(Qt::ElideRight);
	setMouseTracking(true);
	setDocumentMode(true);
	setMaximumSize(0, 0);
	setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
	setStyle(new TabBarStyle());

	m_closeButtonPosition = static_cast<QTabBar::ButtonPosition>(QApplication::style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition));
	m_iconButtonPosition = ((m_closeButtonPosition == QTabBar::RightSide) ? QTabBar::LeftSide : QTabBar::RightSide);

	optionChanged(QLatin1String("TabBar/ShowCloseButton"), SettingsManager::getValue(QLatin1String("TabBar/ShowCloseButton")));
	optionChanged(QLatin1String("TabBar/ShowUrlIcon"), SettingsManager::getValue(QLatin1String("TabBar/ShowUrlIcon")));
	optionChanged(QLatin1String("TabBar/EnablePreviews"), SettingsManager::getValue(QLatin1String("TabBar/EnablePreviews")));
	optionChanged(QLatin1String("TabBar/MaximumTabSize"), SettingsManager::getValue(QLatin1String("TabBar/MaximumTabSize")));
	optionChanged(QLatin1String("TabBar/MinimumTabSize"), SettingsManager::getValue(QLatin1String("TabBar/MinimumTabSize")));

	ToolBarWidget *toolBar = qobject_cast<ToolBarWidget*>(parent);

	if (toolBar)
	{
		setArea(toolBar->getArea());

		connect(toolBar, SIGNAL(areaChanged(Qt::ToolBarArea)), this, SLOT(setArea(Qt::ToolBarArea)));
	}

	connect(SettingsManager::getInstance(), SIGNAL(valueChanged(QString,QVariant)), this, SLOT(optionChanged(QString,QVariant)));
	connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
}
Пример #9
0
QgsUserInputDockWidget::QgsUserInputDockWidget( QWidget *parent )
    : QDockWidget( tr( "User input" ), parent )
    , mLayoutHorizontal( true )
{
  QWidget* w = new QWidget( 0 );
  mLayout = new QBoxLayout( QBoxLayout::LeftToRight );
  mLayout->setAlignment( Qt::AlignLeft | Qt::AlignTop );
  w->setLayout( mLayout );
  setWidget( w );

  QPalette pal = palette();
  pal.setColor( QPalette::Background, QColor( 231, 245, 254 ) );
  setPalette( pal );
  setAutoFillBackground( true );

  connect( this, SIGNAL( dockLocationChanged( Qt::DockWidgetArea ) ), this, SLOT( areaChanged( Qt::DockWidgetArea ) ) );
  connect( this, SIGNAL( topLevelChanged( bool ) ), this, SLOT( floatingChanged( bool ) ) );
  hide();
}
Пример #10
0
QVariant AreaItem::itemChange(GraphicsItemChange change, const QVariant &value)
{
    if (change == ItemSelectedHasChanged)
    {
        setResizingGripsVisible(value.toBool());
    }
    else if (change == ItemPositionChange && scene())
    {
        prepareGeometryChange();
        computeResizingGrips();

        // value is the new position.
        QPointF newPos = value.toPointF();
        QPointF oldPos = scenePos();

        //_rect.setTopLeft(newPos);

        emit areaChanged(this, oldPos, _rect.size(), newPos, _rect.size());

    }
    return QGraphicsItem::itemChange(change, value);
}
Пример #11
0
ProjectionManagement::ProjectionManagement(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ProjectionManagement)
{
    ui->setupUi(this);
    ui->hintLabel->setText(tr("Please set all parameters below in order to create your projecttion"));

    QVBoxLayout *scrollLayout = new QVBoxLayout();

    //limit the start year and the area
    QGroupBox *yearAndAreaBox = new QGroupBox(tr("select the year and area"));

    QLabel *yearLabel = new QLabel(tr("start year"));
    yearLabel->setMaximumWidth(120);

    QComboBox *yearBox = new QComboBox();
    YearItemModel *yearItems = new YearItemModel(this);
    yearBox->setModel(yearItems);
    this->year = yearBox->itemText(0).toInt();

    QLabel *areaLabel = new QLabel(tr("study area"));
    areaLabel->setMaximumWidth(120);

    QComboBox *areaBox = new QComboBox();
    AreaItemModel *areaItems = new AreaItemModel(this);
    areaBox->setModel(areaItems);
    this->area = areaBox->itemText(0);

    QHBoxLayout *yearAndAreaLayout = new QHBoxLayout();
    yearAndAreaLayout->addWidget(yearLabel);
    yearAndAreaLayout->addWidget(yearBox);
    yearAndAreaLayout->addWidget(areaLabel);
    yearAndAreaLayout->addWidget(areaBox);

    yearAndAreaBox->setLayout(yearAndAreaLayout);

    scrollLayout->addWidget(yearAndAreaBox);

    //select the name and the path
    QGroupBox *nameAndPathBox = new QGroupBox(tr("name and path"));

    QHBoxLayout *nameAndPathLayout = new QHBoxLayout();

    QPushButton *nameAndPathButton = new QPushButton(tr("projection name"));
    nameAndPathLayout->addWidget(nameAndPathButton);

    filePathLabel = new QLabel();
    nameAndPathLayout->addWidget(filePathLabel);
    this->reloadData();

    nameAndPathBox->setLayout(nameAndPathLayout);

    scrollLayout->addWidget(nameAndPathBox);

    //if anything more

    ui->scrollAreaWidgetContents->setLayout(scrollLayout);

    //actionss
    connect(nameAndPathButton, SIGNAL(clicked()), this, SLOT(saveProjection()));
    connect(yearBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(yearChanged(QString)));
    connect(areaBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(areaChanged(QString)));

}
Пример #12
0
void LayerStackObserver::canvasWriteSequenceDone()
{
	areaChanged(m_dirtyrect);
	m_dirtyrect = QRect();
}
Пример #13
0
void CPetRooms::resetHighlight() {
	_glyphItem.setRoomFlags(getRoomFlags());
	_glyphs.resetHighlight();
	_glyphItem.updateTooltip();
	areaChanged(PET_ROOMS);
}