예제 #1
0
void PlaybackControls::browseFilePath()
{
	QString tempFile = QFileDialog::getOpenFileName(mpParentWindow/*, tr("Open Music File"), "", tr("Media Files (*.mp3 *.avi *.wma)")*/);
	if (tempFile != "")
	{
		mFile = tempFile;
		Stop();
		Play();
		emit pathChanged(mFile);
	}
}
void DrawablePath::applyRelativePath (const RelativePointPath& newRelativePath, Expression::Scope* scope)
{
    Path newPath;
    newRelativePath.createPath (newPath, scope);

    if (path != newPath)
    {
        path.swapWithPath (newPath);
        pathChanged();
    }
}
예제 #3
0
void QuickConfig::setPath(const QString &path)
{
	if (m_path != path) {
		m_path = path;
		m_config = Config(path);

		if (!m_group.isEmpty())
			m_config.beginGroup(m_group);

		emit pathChanged();
	}
}
SrcProjectWizardPage::SrcProjectWizardPage(QWidget *parent)
    : QWizardPage(parent), m_complete(false)
{
    ui = new Ui::SrcProjectWizardPage;
    ui->setupUi(this);

    connect(ui->pathChooser, SIGNAL(pathChanged(QString)), this, SLOT(onPathChooserPathChanged(QString)));

    setPath(QDir::homePath());

    setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Momentics"));
}
예제 #5
0
void PlaybackControls::editFilePath()
{
	QString tempFile = mpParentWindow->pathBox->displayText();
	if (tempFile != "")
	{
		Stop();
		mFile = tempFile;
		LoadFile();
		mMediaObject.play();
		pathChanged(mFile);
	}
}
void DrawMapScene::mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent)
{
    if(m_currPath && (mouseEvent->buttons() & Qt::LeftButton))
    {
        QPainterPath path = m_currPath->path();
        path.lineTo(mouseEvent->scenePos());
        paths.first().append(mouseEvent->scenePos().toPoint());
        m_currPath->setPath(path);

        emit pathChanged();
    }
}
예제 #7
0
void BufferWidget::doTabPathChanged(const QString &p)
{
	editor::Buffer *b = dynamic_cast<editor::Buffer *>(sender());

	if(b != NULL)
	{
		if(b == currentBuffer())
		{
			Q_EMIT pathChanged(p);
		}
	}
}
예제 #8
0
void BufferWidget::doTabChanged(int i)
{
	Q_EMIT bufferChanged();

	Pane *p = dynamic_cast<Pane *>(tabWidget->widget(i));

	if(p != nullptr)
	{
		QTextCursor curs = p->getBuffer()->textCursor();

		p->getBuffer()->setFocus(Qt::OtherFocusReason);

		Q_EMIT pathChanged(p->getBuffer()->getPath());
		Q_EMIT encodingChanged(p->getBuffer()->getEncoding());
	}
	else
	{
		Q_EMIT pathChanged("");
		Q_EMIT encodingChanged("UTF-8");
	}
}
예제 #9
0
void djvFileBrowserModel::setPath(const QString & path)
{
    if (path == _p->path)
        return;
    
    _p->path = path;
    
    dirUpdate();
    modelUpdate();
    
    Q_EMIT pathChanged(_p->path);
}
QTM_BEGIN_NAMESPACE

QGeoTiledMapPolylineObjectInfo::QGeoTiledMapPolylineObjectInfo(QGeoTiledMapData *mapData, QGeoMapObject *mapObject)
    : QGeoTiledMapObjectInfo(mapData, mapObject)
{
    polyline = static_cast<QGeoMapPolylineObject*>(mapObject);

    connect(polyline,
            SIGNAL(pathChanged(QList<QGeoCoordinate>)),
            this,
            SLOT(pathChanged(QList<QGeoCoordinate>)));
    connect(polyline,
            SIGNAL(penChanged(QPen)),
            this,
            SLOT(penChanged(QPen)));

    pathItem = new QGraphicsPathItem();
    graphicsItem = pathItem;

    penChanged(polyline->pen());
    pathChanged(polyline->path());
}
/**
 * @brief SourceDirectory::setPath
 * @param newpath The new path to be used.
 */
void SourceDirectory::setPath(QString newpath)
{
   if (newpath == path) {
      return;
   }
   path = newpath;
   emit pathChanged(newpath);
   QDir dir(newpath);
   if (dir.exists() != validpath) {
      validpath = !validpath;
      emit pathStatusChanged(validpath);
   }
}
예제 #12
0
void DesktopFile::setPath(QString path)
{
    m_path = path;
    m_isValid = m_path != "";

    // Extracts "papyros-files" from "/path/to/papyros-files.desktop"
    m_appId = QFileInfo(path).baseName();

    emit pathChanged();
    emit isValidChanged();

    load();
}
예제 #13
0
// add a monitor to the local file system. If there is a change in the
// file system, the method slotFolderMonitorFired is triggered through
// the SignalMapper
void FolderMan::registerFolderMonitor( Folder *folder )
{
    if( !folder ) return;

    if( !_folderWatchers.contains(folder->alias() ) ) {
        FolderWatcher *fw = new FolderWatcher(folder->path(), folder);

        // Connect the pathChanged signal, which comes with the changed path,
        // to the signal mapper which maps to the folder alias. The changed path
        // is lost this way, but we do not need it for the current implementation.
        connect(fw, SIGNAL(pathChanged(QString)), folder, SLOT(slotWatchedPathChanged(QString)));
        _folderWatchers.insert(folder->alias(), fw);

        // This is at the moment only for the behaviour of the SocketApi.
        connect(fw, SIGNAL(pathChanged(QString)), folder, SLOT(watcherSlot(QString)));
    }

    // register the folder with the socket API
    if( _socketApi ) {
        _socketApi->slotRegisterPath(folder->alias());
    }
}
BlackBerryInstallWizardNdkPage::BlackBerryInstallWizardNdkPage(BlackBerryInstallerDataHandler &data, QWidget *parent)
    : QWizardPage(parent)
    , m_ui(new Ui_BlackBerryInstallWizardNdkPage)
    , m_data(data)
    , m_ndkPathChooser(new NdkPathChooser(NdkPathChooser::InstallMode))
    , m_manual(new QListWidgetItem)
    , m_validNdkPath(false)
{
    m_ui->setupUi(this);
    setTitle(tr("Native SDK"));
    m_ui->verticalLayout->addWidget(m_ndkPathChooser);
    connect(m_ui->ndkPathListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(setNdkPath()));
    connect(m_ndkPathChooser, SIGNAL(pathChanged(QString)), this, SLOT(setManualNdkPath()));
}
예제 #15
0
int Utils::FileSystemWatcher::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: pathChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 1;
    }
    return _id;
}
void DrawMapScene::mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent)
{
    m_currPath = addPath(QPainterPath(), m_pen);

    QPainterPath path = m_currPath->path();
    QPointF p = mouseEvent->scenePos();
    p += QPointF(0.01, 0.01);
    path.moveTo(p);
    path.lineTo(mouseEvent->scenePos());
    paths.prepend(QList<QPoint>() << mouseEvent->scenePos().toPoint());
    m_currPath->setPath(path);

    emit pathChanged();
}
예제 #17
0
void StyleSet::setName(const QString& val)
{
  if (mName != val) {
    mName = val;

    QObject* p = parent();
    if (p) {
      mPath = traversePathUp(p);
      setupStyle();
    }

    Q_EMIT nameChanged(mName);
    Q_EMIT pathChanged();
  }
}
예제 #18
0
FilesystemWidget::FilesystemWidget(QWidget *parent)
{
    setParent(parent);

    // Create the toolbar
    QToolBar *fsToolbar = new QToolBar();
    fsToolbar->setMovable(false);

    goUpAction = new QAction(IconFactory::fromTheme("go-up"), tr("Go up"), this);
    connect(goUpAction, SIGNAL(triggered()), this, SLOT(goUp()));
    fsToolbar->addAction(goUpAction);

    goHomeAction = new QAction(IconFactory::fromTheme("go-home"), tr("Go to the home folder"), this);
    connect(goHomeAction, SIGNAL(triggered()), this, SLOT(goHome()));
    fsToolbar->addAction(goHomeAction);

    // TODO: use placeholderText in Qt 4.7.
    filterEdit = new QLineEdit();
    QLabel* filterLabel = new QLabel(tr("Filter:"));
    filterLabel->setContentsMargins(5, 0, 5, 0);
    fsToolbar->addSeparator();
    fsToolbar->addWidget(filterLabel);
    fsToolbar->addWidget(filterEdit);
    connect(filterEdit, SIGNAL(textChanged(QString)), this, SLOT(setNameFilter(QString)));

    // Create the filesystem view
    fsWidgetModel = new QFileSystemModel();
    fsWidgetModel->setNameFilterDisables(false);
    fsWidgetModel->setFilter(QDir::AllDirs|QDir::Files|QDir::NoDotAndDotDot);
    fsListView = new QListView();
    fsListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
    fsListView->setDragEnabled(true);
    fsListView->setModel(fsWidgetModel);

    // We shall use this to filter available file extensions from Phonon
    //fsWidgetModel->setFilter(getPhononExtensions());

    connect(fsWidgetModel, SIGNAL(rootPathChanged(QString)), this, SLOT(pathChanged()));
    connect(fsListView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(doubleClickAt(QModelIndex)));

    // Create a new horizontal box
    QVBoxLayout *vlayout = new QVBoxLayout();
    vlayout->addWidget(fsToolbar);
    vlayout->addWidget(fsListView);
    goHome();

    this->setLayout(vlayout);
}
/*!
    makeConnections
*/
void FmFileDialogPrivate::makeConnections()
{
    mFileDialog->connect( mUpButton,SIGNAL( clicked() ),
        mFileDialog, SLOT( _q_handleUpButton() ) );

    if( mFileNameLineEdit ) {
        mFileDialog->connect( mFileNameLineEdit, SIGNAL( textChanged( QString ) ),
            mFileDialog, SLOT( _q_handleTextChanged( QString ) ) );
    }

    mFileDialog->connect( mFileWidget, SIGNAL( pathChanged( QString ) ),
        mFileDialog, SLOT( _q_handlePathChanged( QString ) ) );

    mFileDialog->connect( mFileWidget, SIGNAL( fileActivated( QString ) ),
        mFileDialog, SLOT( _q_handleFileActivated( QString ) ) );
}
예제 #20
0
/**
 * @brief SourceDirectoryWidget::setDirNode
 * @param newNode The new SourceDirectory instance to be managed by this instance.
 */
void SourceDirectoryWidget::setDirNode(SourceDirectory* newNode)
{
   if (!newNode || newNode == dirNode) {
      return;
   }
   if (dirNode) {
      lineedit->disconnect(dirNode);
      dirNode->disconnect(this);
   }
   dirNode = newNode;
   connect(dirNode, SIGNAL(pathChanged(QString)), this, SLOT(setDir(QString)));
   connect(lineedit, SIGNAL(textChanged(QString)), newNode, SLOT(setPath(QString)));
   connect(newNode, SIGNAL(pathStatusChanged(bool)), this, SLOT(pathStatusChanged(bool)));
   this->setDir(newNode->getPath());
   pathStatusChanged(newNode->isValid());
}
예제 #21
0
FileWizardPage::FileWizardPage(QWidget *parent) :
    WizardPage(parent),
    d(new FileWizardPagePrivate)
{
    d->m_ui.setupUi(this);
    connect(d->m_ui.pathChooser, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));
    connect(d->m_ui.nameLineEdit, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));

    connect(d->m_ui.pathChooser, SIGNAL(returnPressed()), this, SLOT(slotActivated()));
    connect(d->m_ui.nameLineEdit, SIGNAL(validReturnPressed()), this, SLOT(slotActivated()));

    setProperty(SHORT_TITLE_PROPERTY, tr("Location"));

    registerFieldWithName(QLatin1String("Path"), d->m_ui.pathChooser, "path", SIGNAL(pathChanged(QString)));
    registerFieldWithName(QLatin1String("FileName"), d->m_ui.nameLineEdit);
}
/*!
    \internal
*/
void QDeclarativePolylineMapItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{
    if (updatingGeometry_ || newGeometry.topLeft() == oldGeometry.topLeft()) {
        QDeclarativeGeoMapItemBase::geometryChanged(newGeometry, oldGeometry);
        return;
    }

    QDoubleVector2D newPoint = QDoubleVector2D(x(),y()) + QDoubleVector2D(geometry_.firstPointOffset());
    QGeoCoordinate newCoordinate = map()->screenPositionToCoordinate(newPoint, false);
    if (newCoordinate.isValid()) {
        double firstLongitude = path_.at(0).longitude();
        double firstLatitude = path_.at(0).latitude();
        double minMaxLatitude = firstLatitude;
        // prevent dragging over valid min and max latitudes
        for (int i = 0; i < path_.count(); ++i) {
            double newLatitude = path_.at(i).latitude()
                    + newCoordinate.latitude() - firstLatitude;
            if (!QLocationUtils::isValidLat(newLatitude)) {
                if (qAbs(newLatitude) > qAbs(minMaxLatitude)) {
                    minMaxLatitude = newLatitude;
                }
            }
        }
        // calculate offset needed to re-position the item within map border
        double offsetLatitude = minMaxLatitude - QLocationUtils::clipLat(minMaxLatitude);
        for (int i = 0; i < path_.count(); ++i) {
            QGeoCoordinate coord = path_.at(i);
            // handle dateline crossing
            coord.setLongitude(QLocationUtils::wrapLong(coord.longitude()
                               + newCoordinate.longitude() - firstLongitude));
            coord.setLatitude(coord.latitude()
                              + newCoordinate.latitude() - firstLatitude - offsetLatitude);
            path_.replace(i, coord);
        }

        QGeoCoordinate leftBoundCoord = geometry_.geoLeftBound();
        leftBoundCoord.setLongitude(QLocationUtils::wrapLong(leftBoundCoord.longitude()
                           + newCoordinate.longitude() - firstLongitude));
        geometry_.setPreserveGeometry(true, leftBoundCoord);
        geometry_.markSourceDirty();
        updateMapItem();
        emit pathChanged();
    }

    // Not calling QDeclarativeGeoMapItemBase::geometryChanged() as it will be called from a nested
    // call to this function.
}
예제 #23
0
int Window::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: curveChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: pathChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: periodChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 3: amplitudeChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 4: overshootChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
void QDeclarativePolylineMapItem::removeCoordinate(const QGeoCoordinate &coordinate)
{
    int index = path_.lastIndexOf(coordinate);

    if (index == -1) {
        qmlInfo(this) << COORD_NOT_BELONG_TO << QStringLiteral("PolylineMapItem");
        return;
    }

    if (path_.count() < index + 1) {
        qmlInfo(this) << COORD_NOT_BELONG_TO << QStringLiteral("PolylineMapItem");
        return;
    }
    path_.removeAt(index);

    geometry_.markSourceDirty();
    updateMapItem();
    emit pathChanged();
}
void QDeclarativePolylineMapItem::removeCoordinate(const QGeoCoordinate &coordinate)
{
    int index = path_.lastIndexOf(coordinate);

    if (index == -1) {
        qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, COORD_NOT_BELONG_TO).arg("PolylineMapItem");
        return;
    }

    if (path_.count() < index + 1) {
        qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, COORD_NOT_BELONG_TO).arg("PolylineMapItem");
        return;
    }
    path_.removeAt(index);

    geometry_.markSourceDirty();
    updateMapItem();
    emit pathChanged();
}
예제 #26
0
void PageItem::setDocument(DocumentItem *doc)
{
    if (doc == m_documentItem.data() || !doc) {
        return;
    }

    m_page = 0;
    disconnect(doc, 0, this, 0);
    m_documentItem = doc;
    Observer *observer = m_isThumbnail ? m_documentItem.data()->thumbnailObserver() : m_documentItem.data()->pageviewObserver();
    connect(observer, SIGNAL(pageChanged(int, int)), this, SLOT(pageHasChanged(int, int)));
    connect(doc->document()->bookmarkManager(), SIGNAL(bookmarksChanged(KUrl)),
            this, SLOT(checkBookmarksChanged()));
    setPageNumber(0);
    emit documentChanged();
    m_redrawTimer->start();

    connect(doc, SIGNAL(pathChanged()), this, SLOT(documentPathChanged()));
}
예제 #27
0
FilePathWidget::FilePathWidget(QWidget *parent) : QWidget(parent),
	m_lineEdit(new QLineEdit(this)),
	m_completer(NULL),
	m_selectFile(true)
{
	QPushButton *button = new QPushButton(tr("Browse…"), this);
	QHBoxLayout *layout = new QHBoxLayout(this);
	layout->addWidget(m_lineEdit);
	layout->addWidget(button);
	layout->setContentsMargins(0, 0, 0, 0);

	setLayout(layout);
	setFocusPolicy(Qt::StrongFocus);
	setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

	connect(m_lineEdit, SIGNAL(textEdited(QString)), this, SLOT(updateCompleter()));
	connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(pathChanged(QString)));
	connect(button, SIGNAL(clicked()), this, SLOT(selectPath()));
}
예제 #28
0
void DocumentItem::setPath(const QString &path)
{
    //TODO: remote urls
    m_document->openDocument(path, KUrl(path), KMimeType::findByUrl(KUrl(path)));

    m_tocModel->fill(m_document->documentSynopsis());
    m_tocModel->setCurrentViewport(m_document->viewport());

    m_matchingPages.clear();
    for (uint i = 0; i < m_document->pages(); ++i) {
         m_matchingPages << (int)i;
    }
    emit matchingPagesChanged();
    emit pathChanged();
    emit pageCountChanged();
    emit openedChanged();
    emit supportsSearchingChanged();
    emit windowTitleForDocumentChanged();
}
/*!
    \internal
*/
void QDeclarativePolygonMapItem::dragEnded()
{
    QPointF newPoint = QPointF(x(),y()) + geometry_.firstPointOffset();
    QGeoCoordinate newCoordinate = map()->screenPositionToCoordinate(newPoint, false);
    if (newCoordinate.isValid()) {
        double firstLongitude = path_.at(0).longitude();
        double firstLatitude = path_.at(0).latitude();
        double minMaxLatitude = firstLatitude;
        // prevent dragging over valid min and max latitudes
        for (int i = 0; i < path_.count(); ++i) {
            double newLatitude = path_.at(i).latitude()
                    + newCoordinate.latitude() - firstLatitude;
            if (!QLocationUtils::isValidLat(newLatitude)) {
                if (qAbs(newLatitude) > qAbs(minMaxLatitude)) {
                    minMaxLatitude = newLatitude;
                }
            }
        }
        // calculate offset needed to re-position the item within map border
        double offsetLatitude = minMaxLatitude - QLocationUtils::clipLat(minMaxLatitude);
        for (int i = 0; i < path_.count(); ++i) {
            QGeoCoordinate coord = path_.at(i);
            // handle dateline crossing
            coord.setLongitude(QLocationUtils::wrapLong(coord.longitude()
                               + newCoordinate.longitude() - firstLongitude));
            coord.setLatitude(coord.latitude()
                              + newCoordinate.latitude() - firstLatitude - offsetLatitude);

            path_.replace(i, coord);
        }

        QGeoCoordinate leftBoundCoord = geometry_.geoLeftBound();
        leftBoundCoord.setLongitude(QLocationUtils::wrapLong(leftBoundCoord.longitude()
                           + newCoordinate.longitude() - firstLongitude));
        geometry_.setPreserveGeometry(true, leftBoundCoord);
        borderGeometry_.setPreserveGeometry(true, leftBoundCoord);
        geometry_.markSourceDirty();
        borderGeometry_.markSourceDirty();
        updateMapItem();
        emit pathChanged();
    }
}
void FileChooserWidget::search() {
	QString tmp;

	switch (_dialogType) {
	case DialogTypeFile:
		tmp = TkFileDialog::getOpenFileName(this, tr("Select a File"), _path, _filter);
		break;
	case DialogTypeDir:
		tmp = TkFileDialog::getExistingDirectory(this, tr("Select a Directory"), _path);
		break;
	default:
		qCritical() << __FUNCTION__ << "Error: unknown DialogType:" << _dialogType;
	}

	if (!tmp.isEmpty()) {
		_path = tmp;
		_pathLineEdit->setText(_path);
		emit pathChanged(_path);
	}
}