我在替换javascript / jquery中的字符串时遇到了一个小问题。首先代码:
HTML:
<fieldset>
<legend>Contact persons</legend>
<div id="cm_contactPersons">
<fieldset id="cm_%email%">
<legend><span class="glyphicon glyphicon-circle-arrow-right"></span> %email%</legend>
<div class="form-group">
<label for="cm_%email_inputFirstname" class="col-sm-2 control-label">Firstname</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="cm_%email%_inputFirstname" value="%firstname%" placeholder="" required>
</div>
</div>
<div class="form-group">
<label for="cm_%email%_inputLastname" class="col-sm-2 control-label">Lastname</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="cm_%email%_inputLastname" value="%lastname%" placeholder="i. e. Max" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Actions</label>
<div class="col-sm-10">
<button type="button" class="btn btn-warning">Create new password</button>
<button type="button" class="btn btn-danger">Delete contact person</button>
</div>
</div>
</fieldset>
</div>
</fieldset>
Run Code Online (Sandbox Code Playgroud)
Javascript:
$(document).ready(function() {
$('#cm_customerList').btsListFilter('#cm_customerSearchInput');
var …Run Code Online (Sandbox Code Playgroud) 几周前,我在基于C++和Qt的Windows笔记本上写了一个小JSON-RPC实现.我使用Visual C++ 2013编译器,它没有任何问题.
现在我将我的代码复制到带有GCC编译器的Linux Mint机器上,我总是得到以下错误:
jsonrpc.h:18: Error: conversion from 'long int' to 'QJsonValue' is ambiguous
static QJsonObject generateErrorObj(ErrorCode code, QString message, QJsonValue data = NULL);
Run Code Online (Sandbox Code Playgroud)
此错误也出现在第19行(方法generateErrorResponse)和第20行(方法generateRequest).所以...现在我不熟悉C++或Qt,所以我不明白,为什么这不起作用,虽然它在Windows上运行...
这是jsonrpc.h的完整代码:
#ifndef JSONRPC_H
#define JSONRPC_H
#include <QtCore>
class JSONRPC
{
public:
enum ErrorCode
{
PARSE_ERROR = -32700,
INVALID_REQUEST = -32600,
METHOD_NOT_FOUND = -32601,
INVALID_PARAMS = -32602,
INTERNAL_ERROR = -32603
};
static QJsonObject generateObj(QString id, bool isNotification = false);
static QJsonObject generateErrorObj(ErrorCode code, QString message, QJsonValue data = NULL);
static QJsonObject generateErrorResponse(QString id, ErrorCode code, …Run Code Online (Sandbox Code Playgroud)