我正在探索Qt源代码并遇到了这个Q_D宏.有人可以解释它的作用吗?
几乎所有时候它都应该返回作为d变量参数给出的类型的小部件.需要进一步澄清这一点.
我正在写一个dockerfile,我需要在docker容器中安装IPtables.我需要在IP表中添加规则,因为我试图在"主机"网络模式下运行,似乎我需要为此目的安装IPtables.当我尝试按如下方式包含规则时,我收到以下错误.
iptables -I INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
iptables v1.6.0: can't initialize iptables table `filter': Permission denied (you must be root)
Run Code Online (Sandbox Code Playgroud)
也许iptables或你的内核需要升级.
是否可以使用root权限运行iptables.
我对Qt很新.我在插入QImage场景时遇到了麻烦.有人可以告诉我如何添加QImage到QGraphicsScene?
我正在尝试使用安装在/ home/user/Software的angstrom工具链来编译qt 4.7.4 for beagle board.
我收到的错误是:
/corelib/arch/qatomic_arm.h:131:错误:没有这样的指令:`swpb%al,%dl,[%esi]'
我的qmake.conf文件如下:
#
# qmake configuration for building with arm-none-linux-gnueabi-g++
#
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
# modifications to g++.conf
QMAKE_CC = arm-angstrom-linux-gnueabi-gcc
QMAKE_CXX = arm-angstrom-linux-gnueabi-g++
QMAKE_LINK = arm-angstrom-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-angstrom-linux-gnueabi-g++
# modifications to linux.conf
QMAKE_AR = arm-angstrom-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-angstrom-linux-gnueabi-objcopy
QMAKE_STRIP = arm-angstrom-linux-gnueabi-strip
QMAKE_LIBDIR_QT = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/${libdir}
QMAKE_MOC = /usr/local/angstrom/arm/bin/moc4
QMAKE_UIC = /usr/local/angstrom/arm/bin/uic4
QMAKE_UIC3 = /usr/local/angstrom/arm/bin/uic34
QMAKE_RCC = /usr/local/angstrom/arm/bin/rcc4
QMAKE_QDBUSCPP2XML = /usr/local/angstrom/arm/bin/qdbuscpp2xml4
QMAKE_QDBUSXML2CPP = /usr/local/angstrom/arm/bin/qdbusxml2cpp4
QMAKE_INCDIR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/include
QMAKE_LIBDIR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/lib
QMAKE_INCDIR_X11 = …Run Code Online (Sandbox Code Playgroud) 我试图将我的beagle board挂钩到在Ubuntu Linux上运行的qt creator 2.3.1.我试图找到一个很好的教程,发现qt文档中没有任何内容.(我不明白为什么有一个功能哪个文档没有解释如何使用).有人可以解释一下如何做到这一点吗?
在编译qt时,我发现有一个名为arm-linux-gcc的qws目标.我环顾四周但无法弄清楚如何以及在哪里找到它.我试过安装,apt-cache给了我以下输出.
apt-cache search armel
asterisk-prompt-fr-armelle - French voice prompts for Asterisk by Armelle Desjardins
rootstock - shellscript to create armel rootfs tarballs using a VM
rootstock-gtk - graphical frontend to the rootstock rootfs builder tool
icedtea-6-jre-cacao - Alternative JVM for OpenJDK, using Cacao
installation-guide-armel - Ubuntu installation guide for armel
jasper - Configure a preinstalled ext2/3 system image
cpp-4.3-arm-linux-gnueabi - The GNU C preprocessor
cpp-4.4-arm-linux-gnueabi - The GNU C preprocessor
g++-4.3-arm-linux-gnueabi - The GNU C++ compiler
g++-4.4-arm-linux-gnueabi - The GNU …Run Code Online (Sandbox Code Playgroud) bool ok = query.exec("CREATE TABLE person ( IdTable INTEGER IDENTITY(1,1) NOT NULL PRIMARY KEY, LastName varchar(255), FirstName varchar(255) )");
bool ok1 = query.exec("INSERT INTO person VALUES ('Wijethilake','Tharanga')");
QSqlQuery scope_Identity("SELECT SCOPE_IDENTITY() AS Current_Identity;");
QSqlRecord rec = scope_Identity.record();
qDebug() << scope_Identity.isValid();
Run Code Online (Sandbox Code Playgroud)
这返回false.它是qt的错误还是我的范围Identity语句错误.我非常感谢有人帮忙.
谢谢.
在上面的场景中,我收到以下编译错误.有人可以告诉我为什么吗?我使用以下文档作为我的指导
http://billforums.station51.net/viewtopic.php?f=8&t=15
ts_test.o: In function `main':
ts_test.c:(.text+0x1d8): undefined reference to `rpl_malloc'
fbutils.o: In function `open_framebuffer':
fbutils.c:(.text+0xa7c): undefined reference to `rpl_malloc'
collect2: ld returned 1 exit status
make[2]: *** [ts_test] Error 1
ts_harvest.o: In function `main':
ts_harvest.c:(.text+0x5d0): undefined reference to `rpl_malloc'
fbutils.o: In function `open_framebuffer':
fbutils.c:(.text+0xa7c): undefined reference to `rpl_malloc'
collect2: ld returned 1 exit status
make[2]: *** [ts_harvest] Error 1
make[2]: Leaving directory `/home/thwijeth/Downloads/tslib-1.0/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/thwijeth/Downloads/tslib-1.0'
make: *** [all] Error 2
ts_test.o: In …Run Code Online (Sandbox Code Playgroud) 我正在阅读Qt Scripting的文档,并且如果错误的指导文本,它会完全令人困惑和充实.有些人可以用简单的英文解释如何包装一个函数并在包装后在脚本代码中访问它.我在下面列举了我的例子.包装功能.这是一个简单的包装器,我需要返回作为参数传递的字符串.以下是代码.
#include <QApplication>
#include <QtScript/QScriptEngine>
#include <QtScript/QScriptContext>
#include <QDebug>
QScriptValue returnProperty(QScriptContext *context , QScriptEngine *engine)
{
qDebug() << "running returnValues Function "<< context->argument(0).toString();
return context->thisObject().property("returnValue");
}
int main(int argc, char *argv[])
{
QApplication app(argc,argv);
QScriptEngine engine;
//Evaluating a simple expression
qDebug() << engine.evaluate("1+2").toNumber();
QScriptValue func = engine.globalObject();
func.setProperty("foo",engine.newFunction(returnProperty),QScriptValue::PropertyGetter);
engine.evaluate("var v= foo('name') ; print( 'This prints values from addValues function :',v) ;");
}
Run Code Online (Sandbox Code Playgroud)
输出如下
3
Running returnValues Function "undefined"
Run Code Online (Sandbox Code Playgroud)
如果我正确理解这是我应该做的,如果我调用engine.newObject(),因为它在doc函数中提到甚至没有被调用.
我在这里得到的是,我在func.setproperty行中分配的属性是什么,一旦我设置它,我可以用属性foo做什么.如何在函数中设置值.
如果有人在这里解释我做错了什么,我感激不尽.
我试图找出以下2行的含义时遇到阻塞问题.以下是gsoap声明的方法声明,我对如何定义finstion的参数感到困惑
SOAP_FMAC3 void SOAP_FMAC4 **soap_serialize_PointerTomss__MobileUserType**(struct soap *soap, mss__MobileUserType *const*a)
Run Code Online (Sandbox Code Playgroud)
所以我正在尝试跟随,但无法弄清楚这里的错误是什么.
mss__MobileUserType const *mobile_user_type = setupMobileUsertype();
**soap_serialize_PointerTomss__MobileUserType**(soap , &mobile_user_type);
Run Code Online (Sandbox Code Playgroud)
我在这做错了什么
我正在尝试为qt脚本编写示例代码.当我向QObjecy副本建设者宣布时,我认为我做的是正确的事情,我也冒昧宣布=运营商.但是这段代码一直在给我
'QObject::QObject' : cannot access private member declared in class 'QObject'
Run Code Online (Sandbox Code Playgroud)
错误.
我声明MyClass这是一个QObject如下.我知道这可以让人看到我在这里做什么.
标题:
#ifndef SCRIPT_CLASSES_H
#define SCRIPT_CLASSES_H
#include "QObject"
#include "QtScript/QScriptValue"
#include "QtScript/QScriptable"
#include "QtScript/QScriptClass"
class MyClass : public QObject
{
Q_OBJECT
// Q_PROPERTY( int _id WRITE setId READ id )
public :
MyClass(QObject *aparent =0) ;
~MyClass();
// bool operator =(MyClass obj);
public slots:
void setId(int d);
int id() const ;
// bool MyClass::equals(const MyClass &other);
private :
int _id; …Run Code Online (Sandbox Code Playgroud) qt ×9
embedded ×3
arm ×1
c++ ×1
compilation ×1
const ×1
database ×1
docker ×1
function ×1
iptables ×1
macros ×1
qimage ×1
qobject ×1
qt-creator ×1
sql-server ×1
touchscreen ×1