如何Camera在Android上关注QML ?我已经尝试了所有focusMode但没有任何作用.相机应用正确关注我的设备.
这是我的QML文件:
import QtQuick 2.3
import QtMultimedia 5.2
Item {
property int scanerButtonWidth: 80
property int scanerButtonHeight: 60
Rectangle {
width: parent.width
height: scanerButtonHeight + 10
color: Qt.rgba(0,0,0,1)
}
VideoOutput {
width: parent.width
height: parent.height
source: camera
anchors.fill: parent
autoOrientation: true
}
Camera {
id: camera
imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash
captureMode: Camera.CaptureStillImage
exposure {
exposureMode: Camera.ExposureAuto
}
focus {
focusMode: Camera.FocusContinuous
focusPointMode: Camera.FocusPointCenter
}
imageCapture {
onImageCaptured: {
otpGeneratorApp.scanedQR_Code( preview, false, type )
qrCodeScanner.visible = false
} …Run Code Online (Sandbox Code Playgroud) 我们尝试验证javafx datepicker。因此我们使用:
if (fromDatePicker.getValue() == null) {
sb.append("No valid from date!\n");
} else {
System.out.println(fromDatePicker.getValue().toString());
if (!DateUtil
.validEnglishDate(fromDatePicker.getValue().toString())) {
sb.append("No valid from date. Use the format yyyy-MM-dd.\n");
}
}
Run Code Online (Sandbox Code Playgroud)
但是目前无法通过日期选择器获得无效的日期,因为所有无效的日期都已更改为起始值。因此,我们问我们是否可以使用javafx datepicker获得无效的Date?
*****编辑*****
示例:我们具有以下日期选择器:DatePicker [2015-05-12]现在我们在DatePicker中输入了“ fjdfk”,因此我们具有:DatePicker [fjdfk],用于保存数据,日期选择器自动更改为DatePicker [2015-05-12]
是否可以使用绝对路径,@fontace?我有以下目录结构:
-HP
|--font
| |- Monoton.woff
| |- Monoton.eot
|--css
| |- font.css
| |- fontface.css
|--html
|-index.html
Run Code Online (Sandbox Code Playgroud)
定义了font-face
@font-face {
font-familiy: Monoton;
src: url('../font/Monoton.woff') format('woff'); // EDIT: Change fonts to font the name of th woff-file
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
并在css中使用它作为类单调:
@import url('fontFace.css');
.monoton {
font-familiy: Monoton, cursive;
font-size: 1.875em;
color: rgba(0, 200, 0, 1);
}
Run Code Online (Sandbox Code Playgroud)
但它不适用于chrome,Firefox和co.有人可以解释一下为什么吗?我已将fontFace.css所有字体文件放在html目录中.现在它会工作..
我有一个模型,其中包含到其他模型的 m2m-Fields。
class OtherModel(models.Model)
name = models.CharField(max_length=100, null=True)
class Model(models.Model)
name = models.CharField(max_length=100, null=True)
otherModel = models.ManyToManyField(OtherModel)
Run Code Online (Sandbox Code Playgroud)
对于模型类,我使用普通的 FormSet()。对于 otherModel 类,我使用 formset_factory()
我只想允许从 OtherModel 从数据库中选择数据,因此我使用以下代码将 OtherModel 中的 CharField 名称更改为 ModelChoiceField:
def otherModel_formset(self, patientenID):
class OtherModelForm(ModelForm):
name= ModelChoiceField(queryset=OtherModel.objects.all())
def __init__(self, *args, **kwargs):
super(OtherModelForm, self).__init__(*args, **kwargs)
class Meta:
model = OtherModel
fields = ['name']
return formset_factory(form=OtherModelForm, max_num=10)
Run Code Online (Sandbox Code Playgroud)
我可以将选定的名称保存在 m2m 字段中,但在重新加载时他们没有选择任何内容
例子:
<select id=some_id" name="some_name">
<option value="1"> HAWAII </option>
<option value="2"> ALASKA</option>
</select>
Run Code Online (Sandbox Code Playgroud)
在示例中,阿拉斯加在提交和重新加载时被选择,应如下所示:
<select id=some_id" name="some_name">
<option value="1"> HAWAII </option>
<option value="2" …Run Code Online (Sandbox Code Playgroud) 我尝试使用QTest命名空间的mouseClick函数单击QPushButton.QPushButton是Widget的私有成员.单击期间鼠标光标的位置位于按钮的中心,但是没有单击按钮...有人可以解释一下为什么?
MyWidget *myWidget= new myWidget();
myWidget->show();
while ( !myWidget->isVisible() ) {
QTest::qWait(200);
}
QTest::qWait(500);
QTest::mouseMove ( myWidget, QPoint( 70, 100 ), -1 );
QTest::mouseClick ( myWidget, Qt::LeftButton, Qt::NoModifier, QPoint( 70, 100 ), 100);
Run Code Online (Sandbox Code Playgroud)
谢谢
如何在Android智能手机上更改qml应用程序的font.family?我使用 Qt 5.3。
我试图设置qml 组件QApplication::setFont()的font.family属性:import QtQuick 2.3 import QtQuick.Controls 1.2
ApplicationWindow {
id: mainWindow
visible: true
width: 640
height: 480
Text {
font.pointSize: 24;
color: Qt.rgba(0.2,0.2,0.2,1);
font.family: "Courier";
text: qsTr("MyText");
}
}
Run Code Online (Sandbox Code Playgroud)
但似乎没有任何效果.. 使用 setFont() 唯一发生的事情是字体大小缩放。