void FollowupReminderInfoDialogTest::shouldAddItemInTreeList()
{
    FollowUpReminderInfoDialog dlg;
    FollowUpReminderInfoWidget *infowidget = dlg.findChild<FollowUpReminderInfoWidget *>(QStringLiteral("FollowUpReminderInfoWidget"));
    QTreeWidget *treeWidget = infowidget->findChild<QTreeWidget *>(QStringLiteral("treewidget"));
    QList<FollowUpReminder::FollowUpReminderInfo *> lstInfo;
    lstInfo.reserve(10);
    for (int i = 0; i < 10; ++i) {
        FollowUpReminder::FollowUpReminderInfo *info = new FollowUpReminder::FollowUpReminderInfo();
        lstInfo.append(info);
    }
    dlg.setInfo(lstInfo);
    //We load invalid infos.
    QCOMPARE(treeWidget->topLevelItemCount(), 0);

    //Load valid infos
    for (int i = 0; i < 10; ++i) {
        FollowUpReminder::FollowUpReminderInfo *info = new FollowUpReminder::FollowUpReminderInfo();
        info->setOriginalMessageItemId(42);
        info->setMessageId(QStringLiteral("foo"));
        info->setFollowUpReminderDate(QDate::currentDate());
        info->setTo(QStringLiteral("To"));
        lstInfo.append(info);
    }

    dlg.setInfo(lstInfo);
    QCOMPARE(treeWidget->topLevelItemCount(), 10);
}
void AELoadedResourcesTreeView::LoadModels()
{
	_modelResourcesItem->removeRows(0, _modelResourcesItem->rowCount());

	Anima::AnimaModelsManager* mgr = _document->GetEngine()->GetScenesManager()->GetScene("AnimaEditor")->GetModelsManager();
	for (int i = 0; i < mgr->GetModelsNumber(); i++)
	{
		Anima::AnimaModel* model = mgr->GetModel(i);
		
		QStandardItem *resourceNameItem = new QStandardItem(QString("%0").arg(model->GetName()));
		resourceNameItem->setData(QVariant::fromValue(model), ModelRole);
		resourceNameItem->setEditable(true);

		QStandardItem *resourceFileNameItem = new QStandardItem(QString("%0").arg(model->GetOriginFileName()));
		resourceFileNameItem->setData(QVariant::fromValue(model), ModelRole);
		resourceFileNameItem->setEditable(false);

		QList<QStandardItem*> newItem;
		newItem.append(resourceNameItem);
		newItem.append(resourceFileNameItem);

		resourceNameItem->removeRows(0, resourceNameItem->rowCount());

		LoadModelMeshes(model, resourceNameItem);
		LoadModelAnimations(model, resourceNameItem);

		_modelResourcesItem->appendRow(newItem);
	}
}
QList<SmartLine> SendBtMessageBlockGenerator::convertElementIntoDirectCommand(NxtOSEKRobotGenerator *nxtGen
		, qReal::Id const &elementId, qReal::Id const &logicElementId)
{
	Q_UNUSED(logicElementId)
	QList<SmartLine> result;
	QString const message = nxtGen->api()->stringProperty(logicElementId, "Message").toUtf8();
	nxtGen->variables().hasBtSend();
	int len = message.length();
	if(len > 0 && len <= 32) {
		QString lenStr = QString::number(len);
		QString arrStr = "";
		for(int i = 0; i < len; i++) {
			QString hexadecimal;
			hexadecimal.setNum(message.at(i).unicode(), 16);
			arrStr += "0x" + hexadecimal;
			if (i < len - 1) {
				arrStr += ", ";
			}
		}

		result.append(SmartLine("const U8 message[" + lenStr + "] = {" + arrStr + "};" + " //message \"" + message + "\" in ascii", elementId));
		result.append(SmartLine("memcpy(bt_send_buf, message, " + lenStr + ");", elementId));
	}

	if (len > 32) {
		result.append(SmartLine("\\message is too long (length is more then 32)", elementId));
	}

	result.append(SmartLine("ecrobot_send_bt_packet(bt_send_buf, 32);", elementId));

	return result;
}
Example #4
0
QList<QAction *> const FrameRateAdjuster::actions() {
	QList<QAction *> l;
	l.append(decFrameRateAction_);
	l.append(incFrameRateAction_);
	l.append(resetFrameRateAction_);
	return l;
}
Example #5
0
void DataTable::showContextMenu(const QPoint &pos, QModelIndex index) //pos is in global coordinates
{
    if(!model() || !index.isValid()){
        return;
    }

    QList<QAction*> actions;

    //first add copy actions.
    actions.append(createCopyMenu(false));
    actions.append(createCopyMenu(true));

    actions.append(WidgetHelper::createSeparatorAction());

    int row=index.row();
    actions.append(getActionsForObject(row));

    if(actions.size()==0){
        return;
    }

    QMenu *menu = new QMenu();
    menu->addActions(actions);
    menu->setDefaultAction(WidgetHelper::findDefaultAction(actions));
    connect(menu, SIGNAL(triggered(QAction*)), this, SIGNAL(contextMenuTriggered(QAction*)));
    menu->exec(pos);

    WidgetHelper::deleteMenu(menu);
}
Example #6
0
///
/// \brief TreeView CurPlotItem slots(曲线条目树形窗口)
/// \param index
///
void SAChartDatasViewWidget::onTreeViewCurPlotItemClicked(const QModelIndex &index)
{
    Q_UNUSED(index);
    QItemSelectionModel* sel = ui->treeView->selectionModel();
    QModelIndexList indexList = sel->selectedRows();
    QList<QwtPlotItem*> items;
    for(int i = 0;i<indexList.size ();++i)
    {
        if(!indexList[i].parent().isValid())
        {//说明点击的是父窗口,就是qwtplot,这时显示所有
            items.clear();
            int childIndex = 0;
            while (indexList[i].child(childIndex,0).isValid()) {
                items.append(m_treeModel->getQwtPlotItemFromIndex (
                                 indexList[i].child(childIndex,0)));
                ++childIndex;
            }
            break;
        }
        if(indexList[i].column () != 0)
        {
            indexList[i] = indexList[i].parent().child(indexList[i].row(),0);
        }
        items.append (m_treeModel->getQwtPlotItemFromIndex (indexList[i]));
    }

    m_tableModel->setPlotItems (items);
}
const QList<QList<Point>> Etude::getListeDeCourbes() const
{
    QList<QList<Point>> listeDeCourbes;
    QList<Point> listeDePointsCourbe;
    const QList<Point>& listeDePoints = this->getListeDePoints();
    const int nombreDePoints = listeDePoints.count();
    for (int itPoint = 0; itPoint < nombreDePoints; itPoint++)
    {
        const Point& pointCourant = listeDePoints.at(itPoint);
        const int& typePointCourant = pointCourant.getTypePoint();
        if (typePointCourant == Point::COURBE_DEBUT)
        {
            listeDePointsCourbe.clear();
            listeDePointsCourbe.append(pointCourant);
        }
        else if (typePointCourant == Point::COURBE)
        {
            listeDePointsCourbe.append(pointCourant);
        }
        else if (typePointCourant == Point::COURBE_FIN)
        {
            listeDePointsCourbe.append(pointCourant);
            listeDeCourbes.append(listeDePointsCourbe);
        }
    }
    return listeDeCourbes;
}
ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent, const QString &id)
{
    if (!canCreate(parent, id))
        return 0;

    QList<QtSupport::BaseQtVersion *> knownVersions = QtSupport::QtVersionManager::instance()->versionsForTargetId(id);
    if (knownVersions.isEmpty())
        return 0;

    QtSupport::BaseQtVersion *qtVersion = knownVersions.first();
    QtSupport::BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig();

    QList<BuildConfigurationInfo> infos;
    if (id != Constants::S60_EMULATOR_TARGET_ID) {
        infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString()));
        infos.append(BuildConfigurationInfo(qtVersion, config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString()));
    } else {
        if (config & QtSupport::BaseQtVersion::DebugBuild)
            infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString()));
        else
            infos.append(BuildConfigurationInfo(qtVersion, config ^ QtSupport::BaseQtVersion::DebugBuild, QString(), QString()));
    }

    return create(parent, id, infos);
}
Example #9
0
void CTaskType::slotFindTask(const QString &text)
{
    QList<QVariant> list;
    QSqlQuery       stored;

#ifndef QT_NO_CURSOR
        QApplication::setOverrideCursor(QCursor(QPixmap("data/picture/additionally/wait.png")));
#endif

        list.append((int)actualRecords);
        list.append(text);
        stored.setForwardOnly(true);
        stored = execStored(currentDatabase(), "FindTaskType", storageHashTable(list));

        bool empty(false);
        while (stored.next()){
            empty = true;
        }

        stored = execStored(currentDatabase(), "FindTaskType", storageHashTable(list));

        if (empty) {
            fillTaskModel(stored);
        }

#ifndef QT_NO_CURSOR
        QApplication::restoreOverrideCursor();
#endif
        stored.finish();
}
QList<XMLTestFactory*> SecStructPredictTests::createTestFactories()
{
    QList<XMLTestFactory*> res;
    res.append(GTest_SecStructPredictAlgorithm::createFactory());
    res.append(GTest_SecStructPredictTask::createFactory());
    return res;
}
QList<ProjectExplorer::Task> Qt4SymbianTargetFactory::reportIssues(const QString &proFile)
{
    QList<ProjectExplorer::Task> results;
    // Warn of strange characters in project name and path:
    const QString projectName = proFile.mid(proFile.lastIndexOf(QLatin1Char('/')) + 1);
    QString projectPath = proFile.left(proFile.lastIndexOf(QLatin1Char('/')));
#if defined (Q_OS_WIN)
    if (projectPath.at(1) == QChar(':') && projectPath.at(0).toUpper() >= QChar('A') && projectPath.at(0).toUpper() <= QChar('Z'))
        projectPath = projectPath.mid(2);
#endif
    if (projectPath.contains(QLatin1Char(' '))) {
        results.append(Task(Task::Warning,
                            QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker",
                                                        "The Symbian tool chain does not handle spaces "
                                                        "in the project path '%1'.").arg(projectPath),
                            QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
    }
    if (projectName.contains(QRegExp("[^a-zA-Z0-9.-]"))) {
        results.append(Task(Task::Warning,
                            QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker",
                                                        "The Symbian tool chain does not handle special "
                                                        "characters in the project name '%1' well.")
                            .arg(projectName),
                            QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
    }
    return results;
}
Example #12
0
int main(int argc, char ** argv)
{
    QGuiApplication app(argc, argv);

//    QList<QObject*> dataList;
//    dataList.append(new DataObject("Item 1", "red"));
//    dataList.append(new DataObject("Item 2", "green"));
//    dataList.append(new DataObject("Item 3", "blue"));
//    dataList.append(new DataObject("Item 4", "yellow"));

//    QQuickView view;
//    view.setResizeMode(QQuickView::SizeRootObjectToView);
//    QQmlContext *ctxt = view.rootContext();
//    ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));

//    view.setSource(QUrl("qrc:view.qml"));
//    view.show();

    QQmlApplicationEngine engine;

    QList<QObject*> dataList;
    dataList.append(new DataObject("Item 1", "red"));
    dataList.append(new DataObject("Item 2", "green"));
    dataList.append(new DataObject("Item 3", "blue"));
    dataList.append(new DataObject("Item 4", "yellow"));

    QQmlContext *ctxt = engine.rootContext();
    ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));

    engine.load(QUrl("qrc:view.qml") );//QUrl(QStringLiteral("qrc:/view.qml")));

    return app.exec();
}
Example #13
0
static void populateTableModel(QStandardItemModel *model)
{
    enum { ItemCount = 50 };

    const char *itemNames[] = { "potion", "ring", "amulet", "wand", "figurine" };
    const char *itemColors[] = { "black", "white", "red", "mauve", "blue", "green",
                                 "yellow", "ultramarine", "pink", "purple" };

    for (int i = 0; i < ItemCount; ++i) {
        QList<QStandardItem*> row;
        QStandardItem *item;
        item = new QStandardItem((i % 10 == 0) ? QString(itemNames[i / 10]) : QString());
        item->setEditable(false);
        row.append(item);
        item = new QStandardItem(QString("%1 %2").arg(QString(itemColors[i % 10])).
                    arg(QString(itemNames[i / 10])));
        item->setEditable(false);
        row.append(item);
        item = new QStandardItem(QString("%1 gold coins").arg(i * 10 + (i % 10) * 15 + 13));
        item->setTextAlignment(Qt::AlignCenter); // the Maemo 5 design spec recommends this.
        item->setEditable(false);
        row.append(item);
        model->appendRow(row);
    }
}
Example #14
0
QList<QByteArray> KeymapParser::tokenize(const QByteArray &line)
{
    bool quoted = false, separator = true;
    QList<QByteArray> result;
    QByteArray token;

    for (int i = 0; i < line.length(); ++i) {
        QChar c = line.at(i);

        if (!quoted && c == '#' && separator)
            break;
        else if (!quoted && c == '"' && separator)
            quoted = true;
        else if (quoted && c == '"')
            quoted = false;
        else if (!quoted && c.isSpace()) {
            separator = true;
            if (!token.isEmpty()) {
                result.append(token);
                token.truncate(0);
            }
        }
        else {
            separator = false;
            token.append(c);
        }
    }
    if (!token.isEmpty())
        result.append(token);
    return result;
}
void ClipboardQt::declareAndWriteDragImage(Element* element, const KURL& url, const String& title, Frame* frame)
{
    ASSERT(frame);

    // WebCore::writeURL(m_writableDataObject.get(), url, title, true, false);
    if (!m_writableData)
        m_writableData = new QMimeData;

    CachedImage* cachedImage = getCachedImage(element);
    if (!cachedImage || !cachedImage->image() || !cachedImage->isLoaded())
        return;
    QPixmap* pixmap = cachedImage->image()->nativeImageForCurrentFrame();
    if (pixmap)
        m_writableData->setImageData(*pixmap);

    AtomicString imageURL = element->getAttribute(HTMLNames::srcAttr);
    if (imageURL.isEmpty())
        return;

    KURL fullURL = frame->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(imageURL));
    if (fullURL.isEmpty())
        return;

    QList<QUrl> urls;
    urls.append(url);
    urls.append(fullURL);

    m_writableData->setText(title);
    m_writableData->setUrls(urls);
    m_writableData->setHtml(createMarkup(element, IncludeNode, 0, AbsoluteURLs));
#ifndef QT_NO_CLIPBOARD
    if (isForCopyAndPaste())
        QApplication::clipboard()->setMimeData(m_writableData);
#endif
}
Example #16
0
/**
 * Scripter.activeDocument.selection
 * Property
 * List of selected Item objects on active document
 */
QList<QVariant> DocumentAPI::selection()
{
	QList<QVariant> l;
	Selection *sel = ScCore->primaryMainWindow()->doc->m_Selection;
	for (int i=0; i < sel->count(); i++)
	{
		/**
		 * Checking whether it is a textframe. If yes, we are trying to cast 
		 * it onto TextWrapper class, which can effectively perform all 
		 * the text operations
		 */
		PageItem *item = sel->itemAt(i);
		if (item->asTextFrame())
		{
			TextAPI *textItem = new TextAPI(item->asTextFrame());
			l.append(qVariantFromValue((QObject *)(textItem)));
		}
		else if(item->asImageFrame())
		{
			ImageAPI *imageItem = new ImageAPI(item->asImageFrame());
			l.append(qVariantFromValue((QObject *)(imageItem)));
		}
		else
		{
			ItemAPI *otherItem = new ItemAPI(item);
			l.append(qVariantFromValue(
			             (QObject *)(otherItem)
			         ));
		}
	}
	return l;
}
FormInputCollectionPtr StaticFormInputGenerator::generateFormFields(QSet<FormFieldDescriptorConstPtr> fields,
                                                                    ExecutionResultConstPtr) const
{
    QList<FormInputPair> inputs;

    foreach(FormFieldDescriptorConstPtr field, fields) {

        if (mExcludedFormFields.contains(field->getDomElement()->getId())) {
            continue;
        }

        switch (field->getType()) {
        case TEXT:
            inputs.append(FormInputPair(field, InjectionValue(generateRandomString(10))));
            break;
        case BOOLEAN:
            inputs.append(FormInputPair(field, InjectionValue(randomBool())));
            break;
        case FIXED_INPUT:
            if(field->getInputOptions().size()>0){
                inputs.append(FormInputPair(field, InjectionValue(pickRand(field->getInputOptions()))));
                break;
            }
        default:
            inputs.append(FormInputPair(field, InjectionValue(QString(""))));
        }
    }

    return FormInputCollectionPtr(new FormInputCollection(inputs));
}
Example #18
0
/**
 * Scripter.activeDocument.items
 * Property
 * List of all Item objects of active document
 */
QList<QVariant> DocumentAPI::items()
{
	QList<QVariant> l;
	for (int i = 0; i<ScCore->primaryMainWindow()->doc->Items->count(); ++i)
	{
		PageItem *item = ScCore->primaryMainWindow()->doc->Items->at(i);
		if (item->asTextFrame())
		{
			TextAPI *textItem = new TextAPI(item->asTextFrame());
			l.append(qVariantFromValue((QObject *)(textItem)));
		}
		else if(item->asImageFrame())
		{
			ImageAPI *imageItem = new ImageAPI(item->asImageFrame());
			l.append(qVariantFromValue((QObject *)(imageItem)));
		}
		else
		{
			ItemAPI *otherItem = new ItemAPI(item);
			l.append(qVariantFromValue(
			             (QObject *)(otherItem)
			         ));
		}
	}
	return l;
}
Example #19
0
void GetSupportedFileFormats(QList<QByteArray> &g_supportedFormats)
{

    // Assemble list of supported Image Formats from our plugin
    int numPlugins = g_pluginManager.getNumPlugins();
    for (int i = 0; i< numPlugins; i++)
    {
        if (strcmp(g_pluginManager.getPluginType(i), "IMAGE") == 0)
        {
            QByteArray bArray = g_pluginManager.getPluginName(i);
            QByteArray fformat = bArray.toUpper();
            if (!g_supportedFormats.contains(fformat))
                g_supportedFormats.append(fformat);
        }
    }

    // Get a list of all Supported file formats from Qt Plugins
    QList<QByteArray> QtFormats = QImageReader::supportedImageFormats();

    // Upppercase List
    QList<QByteArray>::Iterator i;
    for (i = QtFormats.begin(); i != QtFormats.end(); ++i)
    {
        QByteArray fformat = (*i);
        fformat = fformat.toUpper();
        if (!g_supportedFormats.contains(fformat))
            g_supportedFormats.append(fformat);
    }
    
    // Sort the list to alphabetical order
    std::sort(g_supportedFormats.begin(), g_supportedFormats.end());

}
Example #20
0
void CFontFileListView::removeFiles()
{
    QTreeWidgetItem          *root=invisibleRootItem();
    QList<QTreeWidgetItem *> removeFonts;

    for(int t=0; t<root->childCount(); ++t)
    {
        QList<QTreeWidgetItem *> removeFiles;
        QTreeWidgetItem          *font=root->child(t);

        for(int c=0; c<font->childCount(); ++c)
        {
            QTreeWidgetItem *file=font->child(c);

            if(!Misc::fExists(file->text(0)))
                removeFiles.append(file);
        }

        QList<QTreeWidgetItem *>::ConstIterator it(removeFiles.begin()),
                                                end(removeFiles.end());

        for(; it!=end; ++it)
            delete (*it);
        if(0==font->childCount())
            removeFonts.append(font);
    }

    QList<QTreeWidgetItem *>::ConstIterator it(removeFonts.begin()),
                                            end(removeFonts.end());
    for(; it!=end; ++it)
        delete (*it);
}
QList<KoTableOfContentsGeneratorInfo *> TableOfContentsTemplate::templates()
{
    //if you are adding your own custom styles specifically for ToC, add it as an unused style in KoStyleManager
    // when the ToC is used the style will be automatically move to the usedStyle section

    QList<KoTableOfContentsGeneratorInfo *> predefinedTemplates;
    KoTableOfContentsGeneratorInfo *firstTemplate = new KoTableOfContentsGeneratorInfo();
    firstTemplate->m_indexTitleTemplate.text = i18n("Table Of Contents");

    firstTemplate->m_indexTitleTemplate.styleId = m_manager->defaultTableOfcontentsTitleStyle()->styleId();
    firstTemplate->m_indexTitleTemplate.styleName = m_manager->defaultTableOfcontentsTitleStyle()->name();

    for (int level=1; level <= firstTemplate->m_outlineLevel; ++level) {
        firstTemplate->m_entryTemplate[level - 1].styleId = m_manager->defaultTableOfContentsEntryStyle(level)->styleId();
        firstTemplate->m_entryTemplate[level - 1].styleName = m_manager->defaultTableOfContentsEntryStyle(level)->name();
    }

    KoTableOfContentsGeneratorInfo *secondTemplate = new KoTableOfContentsGeneratorInfo();
    secondTemplate->m_indexTitleTemplate.text = i18n("Contents");

    secondTemplate->m_indexTitleTemplate.styleId = m_manager->defaultTableOfcontentsTitleStyle()->styleId();
    secondTemplate->m_indexTitleTemplate.styleName = m_manager->defaultTableOfcontentsTitleStyle()->name();

    for (int level = 1; level <= firstTemplate->m_outlineLevel; ++level) {
        secondTemplate->m_entryTemplate[level - 1].styleId = m_manager->defaultTableOfContentsEntryStyle(level)->styleId();
        secondTemplate->m_entryTemplate[level - 1].styleName = m_manager->defaultTableOfContentsEntryStyle(level)->name();
    }

    predefinedTemplates.append(firstTemplate);
    predefinedTemplates.append(secondTemplate);
    return predefinedTemplates;
}
QList<QAction *> QmitkNodeDescriptorManager::GetActions(const QList<mitk::DataNode::Pointer> &_Nodes) const
{
  QList<QAction *> actions = m_UnknownDataNodeDescriptor->GetBatchActions();
  QSet<QmitkNodeDescriptor *> nodeDescriptors;
  QmitkNodeDescriptor *lastDescriptor;

  // find all descriptors for the nodes (unique)
  foreach (mitk::DataNode::Pointer node, _Nodes)
  {
    for (QList<QmitkNodeDescriptor *>::const_iterator it = m_NodeDescriptors.begin(); it != m_NodeDescriptors.end(); ++it)
    {
      if ((*it)->CheckNode(node))
      {
        nodeDescriptors.insert(*it);
      }
    }
  }
  // add all actions for the found descriptors
  lastDescriptor = m_UnknownDataNodeDescriptor;
  foreach (QmitkNodeDescriptor *descr, nodeDescriptors)
  {
    actions.append(lastDescriptor->GetSeparator());
    lastDescriptor = descr;
    actions.append(lastDescriptor->GetBatchActions());
  }
Example #23
0
favorites::favorites( QWidget * parent ) :
	QDialog( parent ),
	m_ui( new Ui::favorites )
{
	m_ui->setupUi( this ) ;
	this->setWindowFlags( Qt::Window | Qt::Dialog ) ;
	this->setFont( parent->font() ) ;

	this->setFixedSize( this->size() ) ;

	connect( m_ui->pbDeviceAddress,SIGNAL( clicked() ),this,SLOT( deviceAddress() ) ) ;
	connect( m_ui->pbAdd,SIGNAL( clicked() ),this,SLOT( add() ) ) ;
	connect( m_ui->pbFileAddress,SIGNAL( clicked() ),this,SLOT( fileAddress() ) ) ;
	connect( m_ui->pbCancel,SIGNAL( clicked() ),this,SLOT( cancel() ) ) ;
	connect( m_ui->tableWidget,SIGNAL( currentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ),this,
		SLOT( currentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ) ) ;
	connect( m_ui->tableWidget,SIGNAL( itemClicked( QTableWidgetItem * ) ),this,
		SLOT( itemClicked( QTableWidgetItem * ) ) ) ;
	connect( m_ui->lineEditDeviceAddress,SIGNAL( textChanged( QString ) ),this,SLOT( devicePathTextChange( QString ) ) ) ;

	m_ui->pbFileAddress->setIcon( QIcon( ":/file.png" ) ) ;
	m_ui->pbDeviceAddress->setIcon( QIcon( ":/partition.png" ) ) ;

	m_ac = new QAction( this ) ;
	QList<QKeySequence> keys ;
	keys.append( Qt::Key_Enter ) ;
	keys.append( Qt::Key_Return ) ;
	keys.append( Qt::Key_Menu ) ;
	m_ac->setShortcuts( keys ) ;
	connect( m_ac,SIGNAL( triggered() ),this,SLOT( shortcutPressed() ) ) ;
	this->addAction( m_ac ) ;

	this->installEventFilter( this ) ;
}
Example #24
0
QByteArray KQOAuthRequestPrivate::requestBaseString() {
    QByteArray baseString;

    // Every request has these as the commont parameters.
    baseString.append( oauthHttpMethodString.toUtf8() + "&");                                                     // HTTP method
    baseString.append( QUrl::toPercentEncoding( oauthRequestEndpoint.toString(QUrl::RemoveQuery) ) + "&" ); // The path and query components

    QList< QPair<QString, QString> > baseStringParameters;
    baseStringParameters.append(requestParameters);
    baseStringParameters.append(additionalParameters);

    // Sort the request parameters. These parameters have been
    // initialized earlier.
    qSort(baseStringParameters.begin(),
          baseStringParameters.end(),
          normalizedParameterSort
          );

    // Last append the request parameters correctly encoded.
    baseString.append( encodedParamaterList(baseStringParameters) );

    if (debugOutput) {
        qDebug() << "========== KQOAuthRequest has the following base string:";
        qDebug() << baseString << "\n";
    }

    return baseString;
}
void ServerModeReader::generateProjectTree(CMakeListsNode *root,
        const QList<const FileNode *> &allFiles)
{
    // Split up cmake inputs into useful chunks:
    QList<FileNode *> cmakeFilesSource;
    QList<FileNode *> cmakeFilesBuild;
    QList<FileNode *> cmakeFilesOther;
    QList<FileNode *> cmakeLists;

    foreach (FileNode *fn, m_cmakeInputsFileNodes) {
        const FileName path = fn->filePath();
        if (path.fileName().compare("CMakeLists.txt", HostOsInfo::fileNameCaseSensitivity()) == 0)
            cmakeLists.append(fn);
        else if (path.isChildOf(m_parameters.sourceDirectory))
            cmakeFilesSource.append(fn);
        else if (path.isChildOf(m_parameters.buildDirectory))
            cmakeFilesBuild.append(fn);
        else
            cmakeFilesOther.append(fn);
    }
    m_cmakeInputsFileNodes.clear(); // Clean out, they are not going to be used anymore!

    if (!m_projects.isEmpty())
        root->setDisplayName(m_projects.at(0)->name);

    QSet<Node *> usedNodes;
    usedNodes.insert(updateCMakeInputs(root, m_parameters.sourceDirectory, m_parameters.buildDirectory,
                                       cmakeFilesSource, cmakeFilesBuild, cmakeFilesOther));

    usedNodes.unite(updateCMakeLists(root, cmakeLists));
    usedNodes.unite(updateProjects(root, m_projects, allFiles));

    // Trim out unused nodes:
    root->trim(usedNodes);
}
Example #26
0
void initStaffTypes()
      {
      StaffTypePitched* st = new StaffTypePitched();
      st->setName("Pitched 5 lines");
      st->setBuildin(true);
      st->setLines(5);
      st->setLineDistance(Spatium(1.0));
      st->setGenClef(true);
      st->setGenKeysig(true);
      st->setSlashStyle(false);
      st->setShowBarlines(true);
      st->setShowLedgerLines(true);
      staffTypes.append(st);

      StaffTypeTablature* stab = new StaffTypeTablature();
      stab->setName("Tab");
      stab->setBuildin(true);
      staffTypes.append(stab);

      StaffTypePercussion* sp = new StaffTypePercussion();
      sp->setName("Percussion 5 lines");
      sp->setBuildin(true);
      sp->setLines(5);
      sp->setLineDistance(Spatium(1.0));
      sp->setGenClef(true);
      sp->setGenKeysig(false);
      sp->setSlashStyle(false);
      sp->setShowBarlines(true);
      sp->setShowLedgerLines(true);
      staffTypes.append(sp);
      }
void AELoadedResourcesTreeView::LoadModelAnimations(Anima::AnimaModel* model, QStandardItem* parentItem)
{
	QStandardItem *animationItem1 = new QStandardItem(QString("Animations"));
	animationItem1->setEditable(false);

	QStandardItem *animationItem2 = new QStandardItem(QString(""));
	animationItem2->setEditable(false);

	QList<QStandardItem*> newItem;
	newItem.append(animationItem1);
	newItem.append(animationItem2);

	parentItem->appendRow(newItem);

	int count = model->GetAnimationsCount();
	for (int i = 0; i < count; i++)
	{
		Anima::AnimaAnimation* animation = model->GetAnimation(i);

		QStandardItem *animationItem3 = new QStandardItem(QString("%0").arg(animation->GetName()));
		animationItem3->setData(QVariant::fromValue(animation), MeshRole);
		animationItem3->setEditable(false);

		QStandardItem *animationItem4 = new QStandardItem(QString(""));
		animationItem4->setData(QVariant::fromValue(animation), MeshRole);
		animationItem4->setEditable(false);

		newItem.clear();
		newItem.append(animationItem3);
		newItem.append(animationItem4);

		animationItem1->appendRow(newItem);
	}
}
Example #28
0
QList<QAction *> QgsPGLayerItem::actions( QWidget *parent )
{
  QList<QAction *> lst;

  QString typeName = mLayerProperty.isView ? tr( "View" ) : tr( "Table" );

  QAction *actionRenameLayer = new QAction( tr( "Rename %1…" ).arg( typeName ), parent );
  connect( actionRenameLayer, &QAction::triggered, this, &QgsPGLayerItem::renameLayer );
  lst.append( actionRenameLayer );

  if ( !mLayerProperty.isView )
  {
    QAction *actionTruncateLayer = new QAction( tr( "Truncate %1" ).arg( typeName ), parent );
    connect( actionTruncateLayer, &QAction::triggered, this, &QgsPGLayerItem::truncateTable );
    lst.append( actionTruncateLayer );
  }

  if ( mLayerProperty.isMaterializedView )
  {
    QAction *actionRefreshMaterializedView = new QAction( tr( "Refresh Materialized View" ), parent );
    connect( actionRefreshMaterializedView, &QAction::triggered, this, &QgsPGLayerItem::refreshMaterializedView );
    lst.append( actionRefreshMaterializedView );
  }

  return lst;
}
Example #29
0
void FxsData::getFxs(QList<TFxP> &fxs, QMap<TFx *, int> &zeraryFxColumnSize,
                     QList<TXshColumnP> &columns) const {
  QMap<TFx *, TFx *> clonedFxs;
  for (int i = 0; i < m_fxs.size(); i++) {
    TFx *clonedFx = m_fxs[i]->clone(false);
    TPointD pos   = m_fxs[i]->getAttributes()->getDagNodePos();
    clonedFx->getAttributes()->setDagNodePos(pos);
    clonedFx->getAttributes()->removeFromAllGroup();
    fxs.append(clonedFx);
    if (m_fxs[i]->isZerary())
      zeraryFxColumnSize[clonedFx] =
          m_zeraryFxColumnSize[m_fxs[i].getPointer()];
    clonedFxs[m_fxs[i].getPointer()] = clonedFx;

    TFx *linkedFx = m_fxs[i]->getLinkedFx();
    if (linkedFx && clonedFxs.contains(linkedFx))
      clonedFx->linkParams(clonedFxs[linkedFx]);
  }

  QList<TXshColumnP>::const_iterator it;
  for (it = m_columns.begin(); it != m_columns.end(); it++) {
    TXshColumn *col    = it->getPointer();
    TXshColumn *newCol = col->clone();
    newCol->getFx()->getAttributes()->setDagNodePos(
        col->getFx()->getAttributes()->getDagNodePos());
    columns.append(newCol);
    clonedFxs[col->getFx()] = newCol->getFx();
  }

  linkFxs(clonedFxs);
}
Example #30
0
static void create_segments()
{
    segment.append(MidiSegment());

    segment[0].start = firstbeat; // Always start a segment at the very beginning of the piece (the first beat)
    for (int b = 0; b < num_sbeats; b++) {
        if (b == 0 && (sbeat[0].time - firstbeat) < ((sbeat[1].time-firstbeat) - (sbeat[0].time-firstbeat))/2)
            continue;
        /* If it's the first beat of the piece, and the upbeat is
           less than half of the first beat interval, don't start a segment
        */
        else {
            MidiSegment seg;
            seg.start          = sbeat[b].time;
            segment.back().end = sbeat[b].time;
            segment.append(seg);
        }
    }
    int s = segment.size() - 1;

    /* If final segment starts at or after final timepoint of piece, ignore it,
       decrementing number of segments by 1; if not, set that segment's ending
       to final timepoint of piece
       */
    if (segment[s].start >= final_timepoint) {
        s--;
    }
    else {
        segment[s].end = final_timepoint;
        /* qDebug("Final segment ends at %d", segment[s].end); */
    }
    segtotal = s; // index of final segment
}