コード例 #1
1
bool
CategoryModel::removeRows(int row, int count, const QModelIndex& /*parent*/)
{
	if (model_ == nullptr || count != 1) {
		return false;
	}
	if (row < 0 || static_cast<std::size_t>(row) >= model_->categoryList().size()) {
		return false;
	}
	if (model_->categoryList()[row].use_count() > 1) {
		emit errorOccurred(tr("Can't remove category in use."));
		return false;
	}

	beginRemoveRows(QModelIndex(), row, row);
	model_->categoryList().erase(model_->categoryList().begin() + row);
	endRemoveRows();

	emit categoryChanged();

	return true;
}
コード例 #2
0
UserWindow::UserWindow(DisplayForm *display, const QString& dataPath, QWidget *parent) :
	QMainWindow(parent),
	ui(new Ui::UserWindow),
	m_songSearchTimer(new QTimer(this)),
	m_fileworker(0),
	m_songActive(false),
	m_displayWidget(display),
	m_displayActive(false),
	m_category(new Category()),
	m_dataPath(dataPath),
	m_confirmPowerOff(false)
{
	ui->setupUi(this);

	connect(m_songSearchTimer, SIGNAL(timeout()), this, SLOT(songSearchTimer_timeout()));

	/* clear labels */
	ui->songLabel->clear();
	ui->songLabel->setWordWrap(true);
	ui->songNumberLabel->clear();
	ui->categoryLabel->clear();
	ui->projectorStateLabel->clear();
	ui->displayActiveLabel->clear();

	/* default category text */
	categoryChanged();
	/* connect on categoty change */
	connect(m_category, SIGNAL(changed()), this, SLOT(categoryChanged()));

	/* projector control handling */
	m_control = new ProjectorControl();
	connect(m_control, SIGNAL(stateChanged(QString)), this, SLOT(control_stateChanged(QString)));
	m_control->periodicStateCheck();
}
コード例 #3
0
void QDeclarativeLandmarkCategoryFilter::setCategory(QDeclarativeLandmarkCategory* category)
{
    m_category = category;
    m_filter.setCategoryId(m_category->category().categoryId());
    emit categoryChanged();
    emit filterContentChanged();
}
コード例 #4
0
void
VirtausApplication::setCategory(Virtaus::Core::Category *category)
{
    this->c_category = category;

    emit categoryChanged(category);
}
コード例 #5
0
bool
CategoryModel::insertRows(int row, int count, const QModelIndex& /*parent*/)
{
	if (model_ == nullptr || count != 1) {
		return false;
	}
	if (row < 0 || static_cast<std::size_t>(row) > model_->categoryList().size()) {
		return false;
	}

	if (model_->findCategoryName(NEW_ITEM_NAME)) {
		qWarning("Duplicate category: %s", NEW_ITEM_NAME);
		return false;
	}

	beginInsertRows(QModelIndex(), row, row);
	std::shared_ptr<TRMControlModel::Category> newCategory(new TRMControlModel::Category(NEW_ITEM_NAME));
	model_->categoryList().insert(
				model_->categoryList().begin() + row,
				newCategory);
	endInsertRows();

	emit categoryChanged();

	return true;
}
コード例 #6
0
ファイル: FoursquareItem.cpp プロジェクト: ashish173/marble
void FoursquareItem::setCategory(const QString& category)
{
    if( category != m_category ) {
        m_category = category;
        emit categoryChanged();
    }
}
コード例 #7
0
void QSoundEffectPrivate::setCategory(const QString &category)
{
    if (d->m_category != category && !d->m_playing) {
        d->m_category = category;
        emit categoryChanged();
    }
}
コード例 #8
0
void VBoxSettingsToolBarSelector::settingsGroupChanged (int aIndex)
{
    SelectorActionItem *item = findActionItemByTabWidget (qobject_cast<QTabWidget*> (sender()), aIndex);
    if (item)
    {
        if (item->page() &&
            !item->tabWidget())
            emit categoryChanged (item->id());
        else
        {
            SelectorActionItem *child = static_cast<SelectorActionItem*> (
                findItemByPage (static_cast<UISettingsPage*> (item->tabWidget()->currentWidget())));
            if (child)
                emit categoryChanged (child->id());
        }
    }
}
コード例 #9
0
void QchNotification::setCategory(const QString &c) {
    if (c != category()) {
        Q_D(QchNotification);
        d->category = c;
        d->setNotificationCategory();
        emit categoryChanged();
    }
}
コード例 #10
0
void VBoxSettingsTreeViewSelector::settingsGroupChanged (QTreeWidgetItem *aItem,
                                                     QTreeWidgetItem * /* aPrevItem */)
{
    if (aItem)
    {
        int id = aItem->text (treeWidget_Id).toInt();
        Assert (id >= 0);
        emit categoryChanged (id);
    }
}
コード例 #11
0
// Returns the new index.
QModelIndex
CategoryModel::decrementCategoryRow(const QModelIndex& index)
{
	if (model_ == nullptr || !index.isValid()) {
		return index;
	}

	unsigned int row = index.row();
	if (row > 0) {
		std::swap(model_->categoryList()[row - 1], model_->categoryList()[row]);
		emit dataChanged(createIndex(row - 1, 0 /* first column */), createIndex(row, NUM_COLUMNS - 1 /* last column */));
		emit categoryChanged();
		return createIndex(row - 1, NUM_COLUMNS - 1 /* last column */);
	}
	return index;
}
コード例 #12
0
void ResourceManager::languageChange()
{
#if defined(Q_OS_MAC)
	showInFSButton->setText( tr( "Show In Finder" ) );
#endif
#if defined(Q_OS_WIN32)
	showInFSButton->setText( tr( "Show In Explorer" ) );
#endif

	resourceCategories.clear();
	resourceCategories.insert(RM_FONTS, tr("Fonts"));
	resourceCategories.insert(RM_HYPH, tr("Hyphenation Dictionaries"));
	resourceCategories.insert(RM_SPELL, tr("Spelling Dictionaries"));
	resourceCategories.insert(RM_HELP, tr("Help Manuals"));
	resourceCategories.insert(RM_PALETTES, tr("Palettes"));
	//resourceCategories.insert(RM_TEMPLATES, tr("Templates"));
	//resourceCategories.insert(RM_PROFILES, tr("Color Profiles"));
//	resourceCategories.insert(RM_TEST, tr("Test"));

	dataFiles.clear();
	dataFiles.insert(RM_FONTS, "scribus_fonts.xml");
	dataFiles.insert(RM_HYPH, "scribus_hyph_dicts.xml");
	dataFiles.insert(RM_SPELL, "scribus_spell_dicts.xml");
	dataFiles.insert(RM_HELP, "scribus_help.xml");
	dataFiles.insert(RM_PALETTES, "scribus_palettes.xml");
	//dataFiles.insert(RM_TEMPLATES, "scribus_templates.xml");
	//dataFiles.insert(RM_PROFILES, "scribus_profiles.xml");
//	dataFiles.insert(RM_TEST, "test.txt");


	installedTableWidget->clear();
	availableTableWidget->clear();
	categoryComboBox->clear();
	categoryComboBox->setInsertPolicy(QComboBox::InsertAlphabetically);

	QMapIterator<int, QString> i(resourceCategories);
	while (i.hasNext())
	{
		i.next();
		categoryComboBox->addItem(i.value(), i.key());
	}
	categoryChanged();
}
コード例 #13
0
void VBoxSettingsToolBarSelector::settingsGroupChanged (QAction *aAction)
{
    SelectorActionItem *item = findActionItemByAction (aAction);
    if (item)
    {
        emit categoryChanged (item->id());
//        if (item->page() &&
//            !item->tabWidget())
//            emit categoryChanged (item->id());
//        else
//        {
//
//            item->tabWidget()->blockSignals (true);
//            item->tabWidget()->setCurrentIndex (0);
//            item->tabWidget()->blockSignals (false);
//            printf ("%s\n", qPrintable(item->text()));
//            SelectorActionItem *child = static_cast<SelectorActionItem*> (
//                findItemByPage (static_cast<UISettingsPage*> (item->tabWidget()->currentWidget())));
//            if (child)
//                emit categoryChanged (child->id());
//        }
    }
}
コード例 #14
0
int DownloadDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: sendDownload((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2])),(*reinterpret_cast< QString(*)>(_a[3])),(*reinterpret_cast< bool(*)>(_a[4])),(*reinterpret_cast< bool(*)>(_a[5])),(*reinterpret_cast< QString(*)>(_a[6])),(*reinterpret_cast< QString(*)>(_a[7])),(*reinterpret_cast< QString(*)>(_a[8])),(*reinterpret_cast< QString(*)>(_a[9]))); break;
        case 1: browse(); break;
        case 2: download(); break;
        case 3: cancle(); break;
        case 4: showWidgetAdv(); break;
        case 5: saveConfig(); break;
        case 6: loadConfig(); break;
        case 7: cekUrl(); break;
        case 8: getFileName(); break;
        case 9: categoryChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 10: readSTO(); break;
        default: ;
        }
        _id -= 11;
    }
    return _id;
}
コード例 #15
0
bool
CategoryModel::setData(const QModelIndex& index, const QVariant& value, int role)
{
	if (model_ == nullptr || !index.isValid() || role != Qt::EditRole) {
		return false;
	}
	unsigned int row = index.row();
	if (row >= model_->categoryList().size()) {
		return false;
	}

	if (index.column() == 1) {
		std::string name = value.toString().toStdString();
		if (model_->findCategoryName(name)) {
			qWarning("Duplicate category: %s", name.c_str());
			return false;
		}
		model_->categoryList()[row]->setName(name);
		emit dataChanged(index, index);
		emit categoryChanged();
		return true;
	}
	return false;
}
コード例 #16
0
void CategoryFilterWidget::onCurrentRowChanged(const QModelIndex &current, const QModelIndex &previous)
{
    Q_UNUSED(previous);

    emit categoryChanged(getCategoryFilter(static_cast<CategoryFilterProxyModel *>(model()), current));
}
コード例 #17
0
void FormGameCategories::slot_handleClicked(QListWidgetItem *widget)
{
    pandatvGameCategoryThumbnail *pandaWidget = (pandatvGameCategoryThumbnail*)widget;
    emit categoryChanged(pandaWidget->getEname());
}
コード例 #18
0
ファイル: qsoundeffect.cpp プロジェクト: Elleo/qtmultimedia
QT_BEGIN_NAMESPACE

/*!
    \class QSoundEffect
    \brief The QSoundEffect class provides a way to play low latency sound effects.

    \ingroup multimedia
    \ingroup multimedia_audio
    \inmodule QtMultimedia

    This class allows you to play uncompressed audio files (typically WAV files) in
    a generally lower latency way, and is suitable for "feedback" type sounds in
    response to user actions (e.g. virtual keyboard sounds, positive or negative
    feedback for popup dialogs, or game sounds).  If low latency is not important,
    consider using the QMediaPlayer class instead, since it supports a wider
    variety of media formats and is less resource intensive.

    This example shows how a looping, somewhat quiet sound effect
    can be played:

    \snippet multimedia-snippets/qsound.cpp 2

    Typically the sound effect should be reused, which allows all the
    parsing and preparation to be done ahead of time, and only triggered
    when necessary.  This assists with lower latency audio playback.

    \snippet multimedia-snippets/qsound.cpp 3

    Since QSoundEffect requires slightly more resources to achieve lower
    latency playback, the platform may limit the number of simultaneously playing
    sound effects.
*/


/*!
    \qmltype SoundEffect
    \instantiates QSoundEffect
    \brief The SoundEffect type provides a way to play sound effects in QML.

    \inmodule QtMultimedia
    \ingroup multimedia_qml
    \ingroup multimedia_audio_qml
    \inqmlmodule QtMultimedia 5.0

    SoundEffect is part of the \b{QtMultimedia 5.0} module.

    This type allows you to play uncompressed audio files (typically WAV files) in
    a generally lower latency way, and is suitable for "feedback" type sounds in
    response to user actions (e.g. virtual keyboard sounds, positive or negative
    feedback for popup dialogs, or game sounds).  If low latency is not important,
    consider using the MediaPlayer or Audio types instead, since they support a wider
    variety of media formats and are less resource intensive.

    Typically the sound effect should be reused, which allows all the
    parsing and preparation to be done ahead of time, and only triggered
    when necessary.  This is easy to achieve with QML, since you can declare your
    SoundEffect instance and refer to it elsewhere.

    The following example plays a WAV file on mouse click.

    \snippet multimedia-snippets/soundeffect.qml complete snippet

    Since SoundEffect requires slightly more resources to achieve lower
    latency playback, the platform may limit the number of simultaneously playing
    sound effects.
*/

/*!
    Creates a QSoundEffect with the given \a parent.
*/
QSoundEffect::QSoundEffect(QObject *parent) :
    QObject(parent)
{
    d = new QSoundEffectPrivate(this);
    connect(d, SIGNAL(loopsRemainingChanged()), SIGNAL(loopsRemainingChanged()));
    connect(d, SIGNAL(volumeChanged()), SIGNAL(volumeChanged()));
    connect(d, SIGNAL(mutedChanged()), SIGNAL(mutedChanged()));
    connect(d, SIGNAL(loadedChanged()), SIGNAL(loadedChanged()));
    connect(d, SIGNAL(playingChanged()), SIGNAL(playingChanged()));
    connect(d, SIGNAL(statusChanged()), SIGNAL(statusChanged()));
    connect(d, SIGNAL(categoryChanged()), SIGNAL(categoryChanged()));
}
コード例 #19
0
MainWindow::MainWindow(QWidget* parent)
		: QMainWindow(parent)
		, config_()
		, model_()
		, synthesis_(new Synthesis)
		, ui_(new Ui::MainWindow)
		, dataEntryWindow_(new DataEntryWindow)
		, intonationWindow_(new IntonationWindow)
		, intonationParametersWindow_(new IntonationParametersWindow)
		, postureEditorWindow_(new PostureEditorWindow)
		, prototypeManagerWindow_(new PrototypeManagerWindow)
		, specialTransitionEditorWindow_(new TransitionEditorWindow)
		, ruleManagerWindow_(new RuleManagerWindow)
		, ruleTesterWindow_(new RuleTesterWindow)
		, synthesisWindow_(new SynthesisWindow)
		, transitionEditorWindow_(new TransitionEditorWindow)
{
	ui_->setupUi(this);

	ui_->logTextEdit->setMaximumBlockCount(MAX_LOG_BLOCK_COUNT);
	specialTransitionEditorWindow_->setSpecial();

	connect(ui_->quitAction, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
	connect(ui_->aboutAction, SIGNAL(triggered()), this, SLOT(about()));

	coutStreamBuffer_.reset(new LogStreamBuffer(std::cout, false, ui_->logTextEdit));
	cerrStreamBuffer_.reset(new LogStreamBuffer(std::cerr, true, ui_->logTextEdit));
	LogStreamBuffer::registerQDebugMessageHandler();

	connect(prototypeManagerWindow_.get(), SIGNAL(editTransitionButtonClicked(unsigned int, unsigned int)),
		transitionEditorWindow_.get(), SLOT(handleEditTransitionButtonClicked(unsigned int, unsigned int)));

	connect(prototypeManagerWindow_.get(), SIGNAL(editSpecialTransitionButtonClicked(unsigned int, unsigned int)),
		specialTransitionEditorWindow_.get(), SLOT(handleEditTransitionButtonClicked(unsigned int, unsigned int)));

	connect(dataEntryWindow_.get(), SIGNAL(categoryChanged()) , postureEditorWindow_.get(), SLOT(unselectPosture()));
	connect(dataEntryWindow_.get(), SIGNAL(parameterChanged()), postureEditorWindow_.get(), SLOT(unselectPosture()));
	connect(dataEntryWindow_.get(), SIGNAL(symbolChanged())   , postureEditorWindow_.get(), SLOT(unselectPosture()));

	connect(dataEntryWindow_.get(), SIGNAL(parameterChanged()), ruleManagerWindow_.get(), SLOT(loadRuleData()));
	connect(dataEntryWindow_.get(), SIGNAL(parameterChanged()), synthesisWindow_.get(), SLOT(setupParameterTable()));

	connect(postureEditorWindow_.get(), SIGNAL(postureChanged()), ruleManagerWindow_.get(), SLOT(unselectRule()));
	connect(postureEditorWindow_.get(), SIGNAL(postureCategoryChanged()), dataEntryWindow_.get(), SLOT(updateCategoriesTable()));

	connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), transitionEditorWindow_.get(), SLOT(updateEquationsTree()));
	connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), transitionEditorWindow_.get(), SLOT(updateTransition()));
	connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), specialTransitionEditorWindow_.get(), SLOT(updateEquationsTree()));
	connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), specialTransitionEditorWindow_.get(), SLOT(updateTransition()));
	connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), ruleManagerWindow_.get(), SLOT(setupRuleSymbolEquationsTable()));
	connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), ruleManagerWindow_.get(), SLOT(setupEquationsTree()));

	connect(prototypeManagerWindow_.get(), SIGNAL(transitionChanged()), transitionEditorWindow_.get(), SLOT(clear()));
	connect(prototypeManagerWindow_.get(), SIGNAL(transitionChanged()), ruleManagerWindow_.get(), SLOT(setupRuleTransitionsTable()));
	connect(prototypeManagerWindow_.get(), SIGNAL(transitionChanged()), ruleManagerWindow_.get(), SLOT(setupTransitionsTree()));

	connect(prototypeManagerWindow_.get(), SIGNAL(specialTransitionChanged()), specialTransitionEditorWindow_.get(), SLOT(clear()));
	connect(prototypeManagerWindow_.get(), SIGNAL(specialTransitionChanged()), ruleManagerWindow_.get(), SLOT(setupRuleSpecialTransitionsTable()));
	connect(prototypeManagerWindow_.get(), SIGNAL(specialTransitionChanged()), ruleManagerWindow_.get(), SLOT(setupSpecialTransitionsTree()));

	connect(transitionEditorWindow_.get(), SIGNAL(equationReferenceChanged()), prototypeManagerWindow_.get(), SLOT(setupEquationsTree()));
	connect(transitionEditorWindow_.get(), SIGNAL(transitionChanged()),        prototypeManagerWindow_.get(), SLOT(unselectTransition()));

	connect(specialTransitionEditorWindow_.get(), SIGNAL(equationReferenceChanged()), prototypeManagerWindow_.get(), SLOT(setupEquationsTree()));
	connect(specialTransitionEditorWindow_.get(), SIGNAL(transitionChanged()),        prototypeManagerWindow_.get(), SLOT(unselectSpecialTransition()));

	connect(ruleManagerWindow_.get(), SIGNAL(categoryReferenceChanged()), dataEntryWindow_.get(), SLOT(updateCategoriesTable()));

	connect(ruleManagerWindow_.get(), SIGNAL(transitionReferenceChanged())       , prototypeManagerWindow_.get(), SLOT(setupTransitionsTree()));
	connect(ruleManagerWindow_.get(), SIGNAL(specialTransitionReferenceChanged()), prototypeManagerWindow_.get(), SLOT(setupSpecialTransitionsTree()));
	connect(ruleManagerWindow_.get(), SIGNAL(equationReferenceChanged())         , prototypeManagerWindow_.get(), SLOT(setupEquationsTree()));

	connect(synthesisWindow_.get(), SIGNAL(textSynthesized()), intonationWindow_.get(), SLOT(loadIntonationFromEventList()));
	connect(synthesisWindow_.get(), SIGNAL(audioStarted()), intonationWindow_.get(), SLOT(handleAudioStarted()));
	connect(synthesisWindow_.get(), SIGNAL(audioFinished()), intonationWindow_.get(), SLOT(handleAudioFinished()));
	connect(synthesisWindow_.get(), SIGNAL(synthesisFinished()), intonationWindow_.get(), SLOT(handleSynthesisFinished()));
	connect(intonationWindow_.get(), SIGNAL(synthesisRequested()), synthesisWindow_.get(), SLOT(synthesizeWithManualIntonation()));
	connect(intonationWindow_.get(), SIGNAL(synthesisToFileRequested(QString)), synthesisWindow_.get(), SLOT(synthesizeToFileWithManualIntonation(QString)));
}
コード例 #20
0
void MaterialCategoryModel::changedCategory(MaterialCategory* category)
{
    emit categoryChanged(category);
}
コード例 #21
0
ファイル: transfer.cpp プロジェクト: marxoft/musikloud2
void Transfer::setCategory(const QString &c) {
    if (c != category()) {
        m_category = c;
        emit categoryChanged();
    }
}