如何获得QQuickItem的变换矩阵?(How can I get transform matrix for QQuickItem?)
我用
QGraphicsItem
工作了很长时间,它有transform()
函数。 现在我不会对QQuickItem
做同样的事情,但不幸的是它错过了transform()
。 所以我的问题 - 如何获得QQuickItem
变换矩阵?I worked for a long time with
QGraphicsItem
and it hastransform()
function. Now I wont to do same thing withQQuickItem
but unfortunately it missestransform()
. So my question - how can I get transform matrix forQQuickItem
?
原文:https://stackoverflow.com/questions/28535528
最满意答案
我终于在一本书中找到了完整的答案:
通过声明结构就像这样:
struct sigaction act_therm; act_therm.sa_handler=handler_therm;
标志SA_RESETHAND(默认情况下)附加到结构。 每次使用它调用sigaction时,它都会恢复信号的默认行为。
有两种方法可以解决这个问题:
- 坏的一个,包括每次用sigaction调用信号时重新定义信号的行为
- 定义完整的结构(来自man)并创建sa_flags以便不调用SA_RESETHAND:
struct sigaction { void (*sa_handler) (int); void (*sa_sigaction) (int, siginfo_t *, void *); sigset_t sa_mask; int sa_flags; void (*sa_restorer) (void); };
I finally found the complete answer in a book :
By declaring the structure just like this :
struct sigaction act_therm; act_therm.sa_handler=handler_therm;
The flag SA_RESETHAND is (by default) attached to the struct. Each time sigaction is called with it, It restore the default behavior of the signal.
There is two way to solve this problem :
- The bad one, which consists of redefining the behavior of the signal each time the signal is called with a sigaction
- Defining the complete structure (from the man) and creating sa_flags so that SA_RESETHAND is not called:
struct sigaction { void (*sa_handler) (int); void (*sa_sigaction) (int, siginfo_t *, void *); sigset_t sa_mask; int sa_flags; void (*sa_restorer) (void); };
相关问答
更多-
raise rise[2023-12-26]
答案是B,解析: 句子意思是“想继续发言的请举手,然后站起来讲”,显然是翻译“举”和“站”。从字面上意思来看,raise有提升、举的意思;rise有升、站的意思。另外一点,raise是及物动词,后面可以加有名词对象(your hands);rise是不及物动词,后面不能加名词对象。从上面两点可以判定选B。 -
在for循环中使用“..”(Using “..” with for loop)[2021-03-03]
你有一个过时的版本的快速书。 干得好。 当前版本的半封闭范围是0..<3不是0..3 https://developer.apple.com/library/ios/documentation/swift/conceptual/Swift_Programming_Language/BasicOperators.html You have an out of date version of the swift book. Here you go. The current version of the half ... -
该标准要求将for循环的省略条件替换为非零常数: 来自C11 6.8.5.3 :(重点是我的) 6.8.5.3 for语句 1(clause-1; expression-2; expression-3)语句的行为如下所示:表达式expression-2是在每次执行循环体之前评估的控制表达式。 在每次执行循环体之后,表达式-3被评估为空表达式。 如果子句-1是一个声明,则它声明的任何变量的范围是声明的剩余部分和整个循环,包括其他两个表达式; 它是在控制表达式的第一次评估之前按执行顺序达到的。 如果子句-1是一 ...
-
for for循环中的循环(For loop within a for loop)[2023-08-23]
直接的方法可能是使用QuakeCore建议的if语句。 代码看起来像下面这样: public static void main(String[] args) { for (int j = 32; j < 122; j++) { System.out.print((char)j); if (j % 10 == 1) { System.out.println(); } } } 当在if条件下使用模数函数时,这会留下一些丑陋 ... -
需要解决我的程序(program to write values and the raise)[2024-01-17]
emp_rec中的值在调用raise_salary之前获取,并且不受raise_salary的UPDATE的raise_salary 。 要获得工资的新值,您需要再次从数据库中获取它。 尝试更改主循环,如下所示: FOR emp_rec IN emp_cursor LOOP v_oldsalary:=emp_rec.salary; raise_salary; SELECT SALARY INTO v_newsalary FROM EMPLOYEES WHER ... -
在for循环中再次迭代(Iterate again within the for loop)[2023-06-05]
你可以这样做: a = [1,2,3,4,5] b = iter(a) try: while True: c = b.next() if (condition): c = b.next() except StopIteration: pass You could do something like this: a = [1,2,3,4,5] b = iter(a) try: while True: c = ... -
这个问题有两个面。 首先, goto任何嵌套IF / FOR命令的事实,但更重要的是,与goto组合在一起的事实非常缓慢。 一种解决方案是用无限循环模拟一段时间: for /L %%i in () do ...并通过子程序中的goto分解它。 这个解决方案的问题在于, 在同一个cmd.exe上下文中 , for /L不能被打破。 所以,解决方案是调用一个新的cmd.exe来执行While。 要在新cmd.exe中执行的批处理文件可能是同一个调用程序文件,所以我们需要通过同一个批处理文件中的特殊参数来控制Wh ...
-
结合`raise`和`throw`(Combining `raise` and `throw`)[2021-08-16]
这与catch无关 - 可以观察到行为 def f loop do # Loop will abort during first iteration g end end 这是因为loop挽救了StopIteration并将其解释为意味着你想要摆脱loop (参见循环的定义) This is nothing to do with catch - the behaviour can be observed with def f loop do # Loop will abort durin ... -
while循环中的raise()(raise() in while loop)[2022-11-21]
我终于在一本书中找到了完整的答案: 通过声明结构就像这样: struct sigaction act_therm; act_therm.sa_handler=handler_therm; 标志SA_RESETHAND(默认情况下)附加到结构。 每次使用它调用sigaction时,它都会恢复信号的默认行为。 有两种方法可以解决这个问题: 坏的一个,包括每次用sigaction调用信号时重新定义信号的行为 定义完整的结构(来自man)并创建sa_flags以便不调用SA_RESETHAND: struct ... -
如何在循环中得到这个(How to get this in loop)[2023-12-22]
尝试这个: foreach ($item_variations as $key => $object) { $vars = get_object_vars($object); foreach ($vars as $k => $v) { if($k==$attributeCode) { if($v != ''){ Mage::log($v,NULL,"value.log"); ...