华为的P20在屏幕上方有一个类似iPhone的缺口.可以在Android Studio中模拟这个"缺口",以便可以测试应用程序在其上呈现的方式而无需拥有P20吗?我查看了设置,可以在硬件配置文件中选择"皮肤",但华为的P20不是它的一部分.
当我查询/mycollections?ql=Select * where name='dfsdfsdfsdfsdfsdf'我得到
{
"action" : "get",
"application" : "859e6180-de8a-11e4-9360-f1aabbc15f58",
"params" : {
"ql" : [ "Select * where name='dfsdfsdfsdfsdfsdf'" ]
},
"path" : "/mycollections",
"uri" : "http://localhost:8080/myorg/myapp/mycollections",
"entities" : [ {
"uuid" : "2ff8961a-dea8-11e4-996b-63ce373ace35",
"type" : "mycollection",
"name" : "dfsdfsdfsdfsdfsdf",
"created" : 1428577466865,
"modified" : 1428577466865,
"metadata" : {
"path" : "/mycollections/2ff8961a-dea8-11e4-996b-63ce373ace35",
"connections" : {
"relations" : "/mycollections/2ff8961a-dea8-11e4-996b-63ce373ace35/relations"
}
}
} ],
"timestamp" : 1428589309204,
"duration" : 53,
"organization" : "myorg",
"applicationName" : "myapp",
"count" : …Run Code Online (Sandbox Code Playgroud) 这是我的代码
var fs = require('fs');
var fp = fs.openSync('binary.txt', "w");
var byte = '\0';
fs.writeSync(fp, byte, null, 'ascii');
Run Code Online (Sandbox Code Playgroud)
在我打开binary.txt文件执行它之后,它包含0x20而不是预期的空字节.
现在我用的时候
fs.writeSync(fp, byte, null, 'utf-8');
Run Code Online (Sandbox Code Playgroud)
我在文件中得到了想要的空字节.
import UIKit
import CoreNFC
class ViewController: UIViewController, NFCTagReaderSessionDelegate {
var nfcTagReaderSession: NFCTagReaderSession?
func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) {
print("Tag reader did become active")
print("isReady: \(nfcTagReaderSession?.isReady)")
}
func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) {
print("\(error)")
}
func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) {
// this part is never called!
print("got a Tag!")
print("\(tags)")
}
@IBAction func clickedNFC(_ sender: Any) {
nfcTagReaderSession = NFCTagReaderSession(pollingOption: [.iso14443], delegate: self)
nfcTagReaderSession?.alertMessage = "Place the device on the innercover of the passport"
nfcTagReaderSession?.begin()
print("isReady: \(nfcTagReaderSession?.isReady)") …Run Code Online (Sandbox Code Playgroud) 我已经尝试使用disabled和!enabled,但它不工作.这是我的QSS代码:
QPushButton {
background-color:#44c767;
border-radius:5px;
border:1px solid #18ab29;
color:#ffffff;
font-family:arial;
font-size:15px;
font-weight:bold;
text-decoration:none;
padding-right:10px;
outline: 0;
}
QPushButton:hover:!pressed {
background-color:#54d777;
}
QPushButton: pressed {
background-color:#30b252;
}
QPushButton: disabled {
background-color:#ff0000;
}
QPushButton: !enabled {
background-color:#ff0000;
}
Run Code Online (Sandbox Code Playgroud)
文档指的是disabled伪状态,但没有提供有关它的更多信息.
编辑
我正在使用QT5.3
这是我的单身人士
class MySingleton {
private:
int myNumber;
public:
static MySingleton &get() {
static MySingleton instance;
return instance;
}
int getMyNumber() const {
return myNumber;
}
void setMyNumber(int myNumber) {
MySingleton::myNumber = myNumber;
}
};
Run Code Online (Sandbox Code Playgroud)
这是测试它的代码
MySingleton t1 = MySingleton::get();
t1.setMyNumber(6);
printf("t1: %d \n", t1.getMyNumber());
MySingleton t2 = MySingleton::get();
printf("t2: %d \n", t2.getMyNumber());
Run Code Online (Sandbox Code Playgroud)
现在我得到的输出是
t1: 6
t2: 0
Run Code Online (Sandbox Code Playgroud)
但预计结果将是
t1: 6
t2: 6
Run Code Online (Sandbox Code Playgroud)
它看起来像是MySingleton::get()在创建一个新实例,当然它不应该做.