CModuleChooserButton* CModuleChooserBar::addButton( CSwordModuleInfo* const module )
{
	CModuleChooserButton* b = new CModuleChooserButton(module, m_moduleType, ++m_idCounter, this);
	QAction* a = addWidget(b);
	m_buttonList.append(b);
	connect( b, SIGNAL(sigAddButton()), this, SLOT(addButton()) );
	connect( b, SIGNAL(sigRemoveButton(const int)), this, SLOT(removeButton(const int)) );
	connect( b, SIGNAL(sigChanged()), SIGNAL(sigChanged()) );
	connect( b, SIGNAL(sigChanged()), SLOT(updateMenuItems()) );
	a->setVisible(true);
	updateMenuItems(); //make sure the items are up to date with the newest module list
	return b;
}
Exemplo n.º 2
0
void COverlayText::mousePressEvent(QMouseEvent * e)
{
    if(rectMove.contains(e->pos()))
    {
        doMove = true;
    }
    else if(rectSize.contains(e->pos()))
    {
        doSize = true;
    }
    else if(rectEdit.contains(e->pos()))
    {
        CDlgEditText dlg(comment, theMainWindow->getCanvas());
        dlg.exec();
        doc->setHtml(comment);
        theMainWindow->getCanvas()->update();
        emit sigChanged();
    }
    else if(rectDel.contains(e->pos()))
    {
        QStringList keys(getKey());
        COverlayDB::self().delOverlays(keys);
        QApplication::restoreOverrideCursor();
        doSpecialCursor = false;
        theMainWindow->getCanvas()->setMouseMode(CCanvas::eMouseMoveArea);
    }
}
Exemplo n.º 3
0
void COverlayText::mouseReleaseEvent(QMouseEvent * e)
{
    if(doSize || doMove)
    {
        emit sigChanged();
    }
    doSize = doMove = false;
}
Exemplo n.º 4
0
void Konfigurator::newPage(KonfiguratorPage *page, const QString &name, const QString &desc, const QIcon &icon)
{
    KPageWidgetItem *item = new KPageWidgetItem(page, name);
    item->setIcon(icon);
    item->setHeader(desc);
    addPage(item);

    kgPages.append(item);
    connect(page, SIGNAL(sigChanged()), this, SLOT(slotApplyEnable()));
}
Exemplo n.º 5
0
ValueWidget::ValueWidget(QWidget* parent) : QWidget(parent)
{
    m_Layout = new QHBoxLayout(this);
    m_label = new QLabel("Label");
    m_value = new QLCDNumber( 3 );

    m_Layout->addWidget(m_label);
    m_Layout->addWidget(m_value);

    connect( &gData, SIGNAL(sigChanged()), this, SLOT(onValueChanged()) );
}
Exemplo n.º 6
0
CTrackToolWidget::CTrackToolWidget(QTabWidget * parent)
: QWidget(parent)
, originator(false)
{
    setupUi(this);
    setObjectName("Tracks");
    parent->addTab(this,QIcon(":/icons/iconTrack16x16.png"),"");
    parent->setTabToolTip(parent->indexOf(this), tr("Tracks"));

    connect(&CTrackDB::self(), SIGNAL(sigModified(const QString&)), this, SLOT(slotDBChanged()));
    connect(&CTrackDB::self(), SIGNAL(sigNeedUpdate(const QString&)), this, SLOT(slotDBChanged()));
    connect(&CTrackDB::self(), SIGNAL(sigChanged()), this, SLOT(slotDBChanged()));

    connect(listTracks,SIGNAL(itemClicked(QListWidgetItem*) ),this,SLOT(slotItemClicked(QListWidgetItem*)));
    connect(listTracks,SIGNAL(itemDoubleClicked(QListWidgetItem*) ),this,SLOT(slotItemDoubleClicked(QListWidgetItem*)));
    connect(listTracks,SIGNAL(itemSelectionChanged()),this,SLOT(slotSelectionChanged()));

    contextMenu     = new QMenu(this);
    actEdit         = contextMenu->addAction(QPixmap(":/icons/iconEdit16x16.png"),tr("Edit..."),this,SLOT(slotEdit()));
    actRevert       = contextMenu->addAction(QPixmap(":/icons/iconReload16x16.png"),tr("Revert"),this,SLOT(slotRevert()));
    contextMenu->addSeparator();
    actDistance     = contextMenu->addAction(QPixmap(":/icons/iconDistance16x16.png"),tr("Make Overlay"),this,SLOT(slotToOverlay()));
    contextMenu->addSeparator();
    actHide         = contextMenu->addAction(tr("Show"),this,SLOT(slotShow()));
    actShowBullets  = contextMenu->addAction(tr("Show Bullets"),this,SLOT(slotShowBullets()));
    actShowMinMax   = contextMenu->addAction(tr("Show Min/Max"),this,SLOT(slotShowMinMax()));
    contextMenu->addSeparator();
    actZoomToFit    = contextMenu->addAction(QPixmap(":/icons/iconZoomArea16x16.png"),tr("Zoom to fit"),this,SLOT(slotZoomToFit()));
    actDel          = contextMenu->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDelete()));

    actHide->setCheckable(true);
    actShowBullets->setCheckable(true);
    actShowBullets->setChecked(CTrackDB::self().getShowBullets());
    actShowMinMax->setCheckable(true);
    actShowMinMax->setChecked(CTrackDB::self().getShowMinMax());

    connect(listTracks,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenu(const QPoint&)));

    QFontMetrics fm(listTracks->font());
    listTracks->setIconSize(QSize(15,N_LINES*fm.height()));

    connect(toolSortAlpha, SIGNAL(clicked()), this, SLOT(slotDBChanged()));
    connect(toolSortTime, SIGNAL(clicked()), this, SLOT(slotDBChanged()));

    toolSortAlpha->setIcon(QPixmap(":/icons/iconDec16x16.png"));
    toolSortTime->setIcon(QPixmap(":/icons/iconTime16x16.png"));

    SETTINGS;
    toolSortAlpha->setChecked(cfg.value("track/sortAlpha", true).toBool());
    toolSortTime->setChecked(cfg.value("track/sortTime", true).toBool());

    listTracks->installEventFilter(this);
}
/** Removes a button from the toolbar */
void CModuleChooserBar::removeButton( const int ID ) {
	QMutableListIterator<CModuleChooserButton*> it(m_buttonList);
	while (it.hasNext()) {
		CModuleChooserButton* b = it.next();
		if (b->getId() == ID) { //found the right button to remove
			it.remove();
			b->deleteLater();
			break;
		}
	}
	emit sigChanged();
	updateMenuItems(); //make sure the items are up to date with the newest module list
}
Exemplo n.º 8
0
CWptDB::CWptDB(QTabWidget * tb, QObject * parent)
: IDB(IDB::eTypeWpt, tb, parent)
, showNames(true)
{
    SETTINGS;
    showNames   = cfg.value("waypoint/showNames", showNames).toBool();

    m_self      = this;
    toolview    = new CWptToolWidget(tb);

    CQlb qlb(this);
    qlb.load(QDir::home().filePath(CONFIGDIR "sticky.qlb"));
    loadQLB(qlb, false);

#ifdef HAS_EXIF
#ifdef WIN32
    f_exif_content_foreach_entry    = (exif_content_foreach_entry_t)QLibrary::resolve("libexif-12", "exif_content_foreach_entry");
    f_exif_data_unref               = (exif_data_unref_t)QLibrary::resolve("libexif-12", "exif_data_unref");
    f_exif_data_new_from_file       = (exif_data_new_from_file_t)QLibrary::resolve("libexif-12", "exif_data_new_from_file");
    f_exif_data_foreach_content     = (exif_data_foreach_content_t)QLibrary::resolve("libexif-12", "exif_data_foreach_content");
    f_exif_content_get_ifd          = (exif_content_get_ifd_t)QLibrary::resolve("libexif-12", "exif_content_get_ifd");
    f_exif_get_rational             = (exif_get_rational_t)QLibrary::resolve("libexif-12", "exif_get_rational");
    f_exif_data_get_byte_order      = (exif_data_get_byte_order_t)QLibrary::resolve("libexif-12", "exif_data_get_byte_order");
#else
    f_exif_content_foreach_entry    = exif_content_foreach_entry;
    f_exif_data_unref               = exif_data_unref;
    f_exif_data_new_from_file       = exif_data_new_from_file;
    f_exif_data_foreach_content     = exif_data_foreach_content;
    f_exif_content_get_ifd          = exif_content_get_ifd;
    f_exif_get_rational             = exif_get_rational;
    f_exif_data_get_byte_order      = exif_data_get_byte_order;
#endif
#endif

    connect(toolview, SIGNAL(sigChanged()), SIGNAL(sigChanged()));
}
Exemplo n.º 9
0
CMapToolWidget::CMapToolWidget(QTabWidget * parent)
    : QWidget(parent)
    , path("./")
{
    setupUi(this);
    setObjectName("Maps");
    parent->addTab(this,QIcon(":/icons/iconMap16x16.png"),"");
    parent->setTabToolTip(parent->indexOf(this), tr("Maps"));

    connect(&CMapDB::self(), SIGNAL(sigChanged()), this, SLOT(slotDBChanged()));

    contextMenuKnownMaps = new QMenu(this);
    actReload = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconReload16x16.png"),tr("Reload map..."),this,SLOT(slotReload()));
    actAddDEM = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconDEM16x16.png"),tr("Add DEM..."),this,SLOT(slotAddDEM()));
    actDelDEM = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconNoDEM16x16.png"),tr("Del. DEM..."),this,SLOT(slotDelDEM()));
    actCfgMap = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconInfo16x16.png"),tr("Info/Config"),this,SLOT(slotCfgMap()));
    actDelMap = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDeleteKnownMap()));
    actAddTMS = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconAdd16x16.png"),tr("Add TMS map..."),this,SLOT(slotAddTmsMap()));;

    connect(treeKnownMapsStream,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenuKnownMaps(const QPoint&)));
    connect(treeKnownMapsStream,SIGNAL(itemClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapClicked(QTreeWidgetItem*, int)));
    connect(treeKnownMapsStream,SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapDoubleClicked(QTreeWidgetItem*, int)));

    connect(treeKnownMapsRaster,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenuKnownMaps(const QPoint&)));
    connect(treeKnownMapsRaster,SIGNAL(itemClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapClicked(QTreeWidgetItem*, int)));
    connect(treeKnownMapsRaster,SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapDoubleClicked(QTreeWidgetItem*, int)));

    connect(treeKnownMapsVector,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenuKnownMaps(const QPoint&)));
    connect(treeKnownMapsVector,SIGNAL(itemClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapClicked(QTreeWidgetItem*, int)));
    connect(treeKnownMapsVector,SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapDoubleClicked(QTreeWidgetItem*, int)));

    contextMenuSelectedMaps = new QMenu(this);
    contextMenuSelectedMaps->addAction(QPixmap(":/icons/iconFileSave16x16.png"),tr("Export"),this,SLOT(slotExportMap()));
    contextMenuSelectedMaps->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDeleteSelectedMap()));
    connect(listSelectedMaps,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenuSelectedMaps(const QPoint&)));
    connect(listSelectedMaps,SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(slotSelectedMapClicked(QListWidgetItem*)));
    connect(listSelectedMaps,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(slotSelectMap(QListWidgetItem*)));

    connect(pushExportMap, SIGNAL(clicked()), this, SLOT(slotExportMap()));

    tabWidget->setTabIcon(eTabStream, QIcon(":/icons/iconStream22x22.png"));
    tabWidget->setTabText(eTabStream,tr("Stream"));
    tabWidget->setTabIcon(eTabRaster, QIcon(":/icons/iconRaster22x22.png"));
    tabWidget->setTabText(eTabRaster,tr("Raster"));
    tabWidget->setTabIcon(eTabVector, QIcon(":/icons/iconVector22x22.png"));
    tabWidget->setTabText(eTabVector,tr("Vector"));

}
Exemplo n.º 10
0
void CMapToolWidget::slotKnownMapClicked(QTreeWidgetItem* item, int c)
{
    if(c == eMode)
    {
        QString key = item->data(eName, Qt::UserRole).toString();

        if(item->data(eMode, Qt::UserRole).toInt() == eOverlay)
        {
            CMapDB::self().getMap().addOverlayMap(key);
        }
        else if(item->data(eMode, Qt::UserRole).toInt() == eOverlayActive)
        {
            CMapDB::self().getMap().delOverlayMap(key);
        }

        emit sigChanged();
    }
}
Exemplo n.º 11
0
void iqrfe::ClsMemberWidget::setValueChanged(const QString & qstrValue) {
//    cout << "ClsMemberWidget::setValueChanged(QString)" << qstrValue.toStdString() << endl;
    strValue = qstrValue.toStdString();
    bValueChanged = true;

/*
    cout << "strValue.size(): " << strValue.size() << endl;
    cout << "qlblValue->text().length(): " << qlblValue->text().length() << endl;
*/

    if(qlblValue->text().length()>0){
	qpb->setEnabled(true);
    } else {
	qpb->setEnabled(false);
    }

    emit sigChanged();
}
Exemplo n.º 12
0
void BtDisplaySettingsButton::slotOptionToggled(QAction *action) {
    bool checked = action->isChecked();

    if (action == m_lineBreakAction) {
        m_displayOptions.lineBreaks = checked;
        emit sigDisplayOptionsChanged(m_displayOptions);
    } else if (action == m_verseNumbersAction) {
        m_displayOptions.verseNumbers = checked;
        emit sigDisplayOptionsChanged(m_displayOptions);
    } else if (action == m_variantAction) {
        m_filterOptions.textualVariants = checked;
        emit sigFilterOptionsChanged(m_filterOptions);
    } else if (action == m_hebrewPointsAction) {
        m_filterOptions.hebrewPoints = checked;
        emit sigFilterOptionsChanged(m_filterOptions);
    } else if (action == m_greekAccentsAction) {
        m_filterOptions.greekAccents = checked;
        emit sigFilterOptionsChanged(m_filterOptions);
    } else if (action == m_hebrewCantillationAction) {
        m_filterOptions.hebrewCantillation = checked;
        emit sigFilterOptionsChanged(m_filterOptions);
    } else if (action == m_headingsAction) {
        m_filterOptions.headings = checked;
        emit sigFilterOptionsChanged(m_filterOptions);
    } else if (action == m_morphSegmentationAction) {
        m_filterOptions.morphSegmentation = checked;
        emit sigFilterOptionsChanged(m_filterOptions);
    } else if (action == m_scriptureReferencesAction) {
        m_filterOptions.scriptureReferences = checked;
        emit sigFilterOptionsChanged(m_filterOptions);
    } else if (action == m_footnotesAction) {
        m_filterOptions.footnotes = checked;
        emit sigFilterOptionsChanged(m_filterOptions);
    } else if (action == m_redWordsAction) {
        m_filterOptions.redLetterWords = checked;
        emit sigFilterOptionsChanged(m_filterOptions);
    } else {
        Q_ASSERT(false);
        return;
    }

    emit sigChanged();
}
Exemplo n.º 13
0
void CMapRmap::move(const QPoint& old, const QPoint& next)
{
    if(pjsrc == 0) return;
    needsRedraw     = true;
    needsRedrawOvl  = true;

    double xx = x, yy = y;
    convertM2Pt(xx, yy);

    // move top left point by difference
    xx += old.x() - next.x();
    yy += old.y() - next.y();

    convertPt2M(xx,yy);
    x = xx;
    y = yy;
    emit sigChanged();

    setAngleNorth();
}
Exemplo n.º 14
0
void COverlayDistance::keyPressEvent(QKeyEvent * e)
{
    if (e->key() == Qt::Key_Backspace)
    {
        if (!doFuncWheel && addType != eNone && thePoint && points.size() > 1)
        {
            int idx;
            switch (addType)
            {
                case eBefore:
                    idx = points.indexOf(*thePoint);
                    if (idx < points.size())
                    {
                        points.removeAt(idx+1);
                        thePointAfter = (idx+1 < points.size()) ? &(points[idx+1]) : 0;
                    }
                    break;
                case eAfter:
                    idx = points.indexOf(*thePoint);
                    if (idx > 0)
                    {
                        points.removeAt(idx-1);
                        thePointBefor = (idx > 1) ? &(points[idx-2]) : 0;
                    }
                    break;
                case eAtEnd:
                    points.removeLast();
                    thePointBefor = (points.size() > 1) ? &(*(points.end() - 2)) : 0;
                    thePoint      = &points.last();
                    break;
                default:
                    break;
            }
            calcDistance();
            emit sigChanged();
            QPoint pos = theMainWindow->getCanvas()->mapFromGlobal(QCursor::pos());
            QMouseEvent * ev = new QMouseEvent(QEvent::MouseMove, pos, Qt::NoButton, QApplication::mouseButtons(), QApplication::keyboardModifiers());
            QCoreApplication::postEvent(theMainWindow->getCanvas(), ev);
        }
    }
}
Exemplo n.º 15
0
CSearchToolWidget::CSearchToolWidget(QTabWidget * parent)
: QWidget(parent)
{
    setupUi(this);
    setObjectName("Search");

    connect(lineInput, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed()));
    connect(&CSearchDB::self(), SIGNAL(sigStatus(const QString&)), labelStatus, SLOT(setText(const QString&)));
    connect(&CSearchDB::self(), SIGNAL(sigFinished()), this, SLOT(slotQueryFinished()));
    connect(&CSearchDB::self(), SIGNAL(sigChanged()), this, SLOT(slotDBChanged()));

    connect(listResults,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(slotItemClicked(QListWidgetItem*)));

    parent->insertTab(0,this,QIcon(":/icons/iconSearch16x16.png"),"");
    parent->setTabToolTip(parent->indexOf(this), tr("Search"));

    contextMenu = new QMenu(this);
    contextMenu->addAction(QPixmap(":/icons/iconClipboard16x16.png"),tr("Copy Position"),this,SLOT(slotCopyPosition()),Qt::CTRL + Qt::Key_C);
    contextMenu->addAction(QPixmap(":/icons/iconAdd16x16.png"),tr("Add Waypoint ..."),this,SLOT(slotAdd()));
    contextMenu->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDelete()),Qt::Key_Delete);

    connect(listResults,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenu(const QPoint&)));

    comboHost->addItem(tr("OpenRouteService"), CSearchDB::eOpenRouteService);
    //    comboHost->addItem(tr("MapQuest"), CSearchDB::eMapQuest);
    comboHost->addItem(tr("Google"), CSearchDB::eGoogle);

    SETTINGS;
    cfg.beginGroup("search");
    int idx = comboHost->findData(cfg.value("host", CSearchDB::eOpenRouteService));
    if(idx != -1)
    {
        comboHost->setCurrentIndex(idx);
    }

    cfg.endGroup();

    connect(comboHost, SIGNAL(currentIndexChanged(int)), this, SLOT(slotHostChanged(int)));
}
Exemplo n.º 16
0
/**
 * @brief Sets if some of the concerts info has changed. Emits the sigChanged signal
 * @param changed Infos have changed
 * @see Concert::hasChanged
 */
void Concert::setChanged(bool changed)
{
    m_hasChanged = changed;
    emit sigChanged(this);
}
Exemplo n.º 17
0
void COverlayDistance::mousePressEvent(QMouseEvent * e)
{
    if(thePoint == 0) return;
    IMap& map   = CMapDB::self().getMap();

    if(e->button() == Qt::LeftButton)
    {
        if(doMove)
        {
            if(*thePoint == points.last() && addType == eAtEnd)
            {
                const int size = subline.size();
                if(size < 2)
                {
                    pt_t pt;
                    pt.u    = e->pos().x();
                    pt.v    = e->pos().y();
                    map.convertPt2Rad(pt.u, pt.v);

                    points.push_back(pt);
                }
                else
                {
                    pt_t pt;
                    pt.u = subline[1].x();
                    pt.v = subline[1].y();
                    map.convertPt2Rad(pt.u, pt.v);

                    *thePoint = pt;

                    for(int i = 2; i < size; i++)
                    {
                        pt.u = subline[i].x();
                        pt.v = subline[i].y();
                        map.convertPt2Rad(pt.u, pt.v);

                        points.push_back(pt);
                    }

                    points.push_back(pt);

                }
                thePointBefor   = &(*(points.end() - 2));
                thePoint        = &points.last();
                thePointAfter   = 0;
            }
            else if(*thePoint == points.first() && addType == eAtEnd)
            {
                const int size = subline.size();
                if(size < 2)
                {

                    pt_t pt;
                    pt.u = e->pos().x();
                    pt.v = e->pos().y();
                    map.convertPt2Rad(pt.u, pt.v);

                    points.push_front(pt);
                }
                else
                {
                    pt_t pt;
                    pt.u = subline[1].x();
                    pt.v = subline[1].y();
                    map.convertPt2Rad(pt.u, pt.v);

                    *thePoint = pt;

                    for(int i = 2; i < size; i++)
                    {
                        pt.u = subline[i].x();
                        pt.v = subline[i].y();
                        map.convertPt2Rad(pt.u, pt.v);

                        points.push_front(pt);
                    }

                    points.push_front(pt);
                }
                thePointBefor   = 0;
                thePoint        = &points.first();
                thePointAfter   = &(*(points.begin() + 1));
            }
            else if(addType != eNone)
            {
                pt_t pt;
                const int size = subline.size();
                int idx = points.indexOf(*thePoint);

                if(size > 2)
                {
                    if(addType == eAfter)
                    {
                        pt.u = subline[0].x();
                        pt.v = subline[0].y();
                        map.convertPt2Rad(pt.u, pt.v);

                        points[idx - 1] = pt;

                        pt.u = subline[size - 1].x();
                        pt.v = subline[size - 1].y();
                        map.convertPt2Rad(pt.u, pt.v);

                        points[idx] = pt;

                        for(int i = 1; i < size - 1; i++)
                        {
                            pt.u = subline[i].x();
                            pt.v = subline[i].y();
                            map.convertPt2Rad(pt.u, pt.v);

                            points.insert(idx - 1 + i,pt);
                        }
                        idx += size - 2;
                    }
                    else
                    {
                        pt.u = subline[0].x();
                        pt.v = subline[0].y();
                        map.convertPt2Rad(pt.u, pt.v);

                        points[idx + 1] = pt;

                        pt.u = subline[size - 1].x();
                        pt.v = subline[size - 1].y();
                        map.convertPt2Rad(pt.u, pt.v);

                        points[idx] = pt;

                        for(int i = 1; i < size - 1; i++)
                        {
                            pt.u = subline[i].x();
                            pt.v = subline[i].y();
                            map.convertPt2Rad(pt.u, pt.v);

                            points.insert(idx+1,pt);
                        }
                    }
                }

                if(addType == eAfter)
                {
                    idx++;
                }

                pt.u = e->pos().x();
                pt.v = e->pos().y();
                map.convertPt2Rad(pt.u, pt.v);
                points.insert(idx,pt);

                thePointBefor   = idx ? &points[idx - 1] : 0;
                thePoint        = &points[idx];
                thePointAfter   = (idx + 1) == points.count() ? 0 : &points[idx + 1];
            }
            else
            {
                pt_t pt;
                pt.u = e->pos().x();
                pt.v = e->pos().y();
                map.convertPt2Rad(pt.u, pt.v);

                *thePoint = pt;

                doMove          = false;
                addType         = eNone;
                thePoint        = 0;
                thePointBefor   = 0;
                thePointAfter   = 0;

            }

            subline.clear();

            calcDistance();
            theMainWindow->getCanvas()->update();

            //if(addType == eNone)   // why?
            //{
            emit sigChanged();
            //}
            return;
        }

        if(!doFuncWheel)
        {
            selectedPoints.clear();
            selectedPoints << points.indexOf(*thePoint);
            emit sigSelectionChanged();

            doFuncWheel = true;
            theMainWindow->getCanvas()->update();
            return;
        }

        QPoint pos1 = e->pos();

        projXY pt = *thePoint;
        map.convertRad2Pt(pt.u, pt.v);
        pos1 -= QPoint(pt.u - 24, pt.v - 24);

        if(rectDel.contains(pos1))
        {
            int idx = points.indexOf(*thePoint);

            if(idx == -1) return;

            points.takeAt(idx);

            if(points.isEmpty())
            {
                QStringList keys(getKey());
                COverlayDB::self().delOverlays(keys);
            }
            calcDistance();
            doFuncWheel     = false;
            thePoint        = 0;
            thePointBefor   = 0;
            thePointAfter   = 0;

            emit sigChanged();
        }
        else if(rectMove.contains(pos1))
        {
            QApplication::setOverrideCursor(QCursor(QPixmap(":/cursors/cursorMoveWpt.png"),0,0));
            doMove      = true;
            doFuncWheel = false;

            savePoint = *thePoint;
        }
        else if(rectAdd1.contains(pos1))
        {
            int idx = points.indexOf(*thePoint);

            if(idx == -1) return;

            pt_t pt;
            pt.u = e->pos().x();
            pt.v = e->pos().y();
            map.convertPt2Rad(pt.u, pt.v);
            points.insert(idx,pt);

            thePointBefor   = idx ? &points[idx - 1] : 0;
            thePoint        = &points[idx];
            thePointAfter   = (idx + 1) == points.count() ? 0 : &points[idx + 1];

            doMove          = true;
            addType         = eBefore;
            doFuncWheel     = false;

            theMainWindow->getCanvas()->update();
        }
        else if(rectAdd2.contains(pos1))
        {
            int idx = points.indexOf(*thePoint);

            if(idx == -1) return;

            idx++;

            pt_t pt;
            pt.u = e->pos().x();
            pt.v = e->pos().y();
            map.convertPt2Rad(pt.u, pt.v);
            points.insert(idx,pt);

            thePointBefor   = idx ? &points[idx - 1] : 0;
            thePoint        = &points[idx];
            thePointAfter   = (idx + 1) == points.count() ? 0 : &points[idx + 1];

            doMove          = true;
            addType         = eAfter;
            doFuncWheel     = false;

            theMainWindow->getCanvas()->update();

        }
        else
        {
            doFuncWheel     = false;
            thePoint        = 0;
            thePointBefor   = 0;
            thePointAfter   = 0;

        }
    }
    else if(e->button() == Qt::RightButton)
    {
        looseFocus();
        return;
    }

    selectedPoints.clear();
    if(addType == eNone)
    {
        emit sigSelectionChanged();
    }
}
Exemplo n.º 18
0
/**
 * @brief TvShowModelItem::onSeasonChanged
 * @param seasonItem
 * @param episodeItem
 */
void TvShowModelItem::onSeasonChanged(TvShowModelItem *seasonItem, TvShowModelItem *episodeItem)
{
    emit sigChanged(this, seasonItem, episodeItem);
}
Exemplo n.º 19
0
/**
 * @brief TvShowEpisode::setChanged
 * @param changed
 */
void TvShowEpisode::setChanged(bool changed)
{
    m_hasChanged = changed;
    emit sigChanged(this);
}
Exemplo n.º 20
0
/**
 * @brief Sets if some of the movies info has changed. Emits the sigChanged signal
 * @param changed Infos have changed
 * @see Movie::hasChanged
 */
void Movie::setChanged(bool changed)
{
    m_hasChanged = changed;
    emit sigChanged(this);
}
Exemplo n.º 21
0
void Artist::setHasChanged(bool hasChanged)
{
    m_hasChanged = hasChanged;
    if (hasChanged)
        emit sigChanged(this);
}
Exemplo n.º 22
0
UVWidget::UVWidget( QWidget * parent )
	: QGLWidget( QGLFormat( QGL::SampleBuffers ), parent, 0, Qt::Tool | Qt::WindowStaysOnTopHint ), undoStack( new QUndoStack( this ) )
{
	texnames = QStringList() // these are not translated since they are pulled from nif.xml
		<< "Base Texture"
		<< "Dark Texture"
		<< "Detail Texture"
		<< "Gloss Texture"
		<< "Glow Texture"
		<< "Bump Map Texture"
		<< "Decal 0 Texture"
		<< "Decal 1 Texture"
		<< "Decal 2 Texture"
		<< "Decal 3 Texture";
	
	setWindowTitle( tr("UV Editor") );
	setFocusPolicy( Qt::StrongFocus );
	
	textures = new TexCache( this );
	
	zoom = 1.2;
	
	pos = QPoint( 0, 0 );
	
	mousePos = QPoint( -1000, -1000 );
	
	setCursor( QCursor( Qt::CrossCursor ) );
	setMouseTracking( true );
	
	setContextMenuPolicy( Qt::ActionsContextMenu );
	
	QAction * aUndo = undoStack->createUndoAction( this );
	QAction * aRedo = undoStack->createRedoAction( this );
	
	aUndo->setShortcut( QKeySequence::Undo );
	aRedo->setShortcut( QKeySequence::Redo );
	
	addAction( aUndo );
	addAction( aRedo );
	
	QAction * aSep = new QAction( this );
	aSep->setSeparator( true );
	addAction( aSep );
	
	QAction * aSelectAll = new QAction( tr( "Select &All" ), this );
	aSelectAll->setShortcut( QKeySequence::SelectAll );
	connect( aSelectAll, SIGNAL( triggered() ), this, SLOT( selectAll() ) );
	addAction( aSelectAll );
	
	QAction * aSelectNone = new QAction( tr( "Select &None" ), this );
	connect( aSelectNone, SIGNAL( triggered() ), this, SLOT( selectNone() ) );
	addAction( aSelectNone );
	
	QAction * aSelectFaces = new QAction( tr( "Select &Faces" ), this );
	connect( aSelectFaces, SIGNAL( triggered() ), this, SLOT( selectFaces() ) );
	addAction( aSelectFaces );
	
	QAction * aSelectConnected = new QAction( tr( "Select &Connected" ), this );
	connect( aSelectConnected, SIGNAL( triggered() ), this, SLOT( selectConnected() ) );
	addAction( aSelectConnected );
	
	QAction * aScaleSelection = new QAction( tr( "&Scale and Translate Selected" ), this );
	aScaleSelection->setShortcut( QKeySequence( "Alt+S" ) );
	connect( aScaleSelection, SIGNAL( triggered() ), this, SLOT( scaleSelection() ) );
	addAction( aScaleSelection );
	
	QAction * aRotateSelection = new QAction( tr( "&Rotate Selected" ), this );
	aRotateSelection->setShortcut( QKeySequence( "Alt+R" ) );
	connect( aRotateSelection, SIGNAL( triggered() ), this, SLOT( rotateSelection() ) );
	addAction( aRotateSelection );
	
	aSep = new QAction( this );
	aSep->setSeparator( true );
	addAction( aSep );
	
	aTextureBlend = new QAction( tr( "Texture Alpha Blending" ), this );
	aTextureBlend->setCheckable( true );
	aTextureBlend->setChecked( true );
	connect( aTextureBlend, SIGNAL( toggled( bool ) ), this, SLOT( updateGL() ) );
	addAction( aTextureBlend );
	
	coordSetGroup = new QActionGroup( this );
	connect( coordSetGroup, SIGNAL( triggered( QAction * ) ), this, SLOT( selectCoordSet() ) );
	
	coordSetSelect = new QMenu( tr( "Select Coordinate Set" ) );
	addAction( coordSetSelect->menuAction() );
	connect( coordSetSelect, SIGNAL( aboutToShow() ), this, SLOT( getCoordSets() ) );
	
	texSlotGroup = new QActionGroup( this );
	connect( texSlotGroup, SIGNAL( triggered( QAction * ) ), this, SLOT( selectTexSlot() ) );
	
	menuTexSelect = new QMenu( tr( "Select Texture Slot" ) );
	addAction( menuTexSelect->menuAction() );
	connect( menuTexSelect, SIGNAL( aboutToShow() ), this, SLOT( getTexSlots() ) );
	
	currentTexSlot = 0;
	
	connect( Options::get(), SIGNAL( sigChanged() ), this, SLOT( updateGL() ) );
}