首页 \ 问答 \ 如何获得QQuickItem的变换矩阵?(How can I get transform matrix for QQuickItem?)

如何获得QQuickItem的变换矩阵?(How can I get transform matrix for QQuickItem?)

我用QGraphicsItem工作了很长时间,它有transform()函数。 现在我不会对QQuickItem做同样的事情,但不幸的是它错过了transform() 。 所以我的问题 - 如何获得QQuickItem变换矩阵?


I worked for a long time with QGraphicsItem and it has transform() function. Now I wont to do same thing with QQuickItem but unfortunately it misses transform(). So my question - how can I get transform matrix for QQuickItem?


原文:https://stackoverflow.com/questions/28535528
更新时间:2022-12-07 15:12

最满意答案

我终于在一本书中找到了完整的答案:

通过声明结构就像这样:

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。
  • 你有一个过时的版本的快速书。 干得好。 当前版本的半封闭范围是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是一 ...
  • 直接的方法可能是使用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条件下使用模数函数时,这会留下一些丑陋 ...
  • 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 ...
  • 你可以这样做: 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 ...
  • 这与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 ...
  • 我终于在一本书中找到了完整的答案: 通过声明结构就像这样: struct sigaction act_therm; act_therm.sa_handler=handler_therm; 标志SA_RESETHAND(默认情况下)附加到结构。 每次使用它调用sigaction时,它都会恢复信号的默认行为。 有两种方法可以解决这个问题: 坏的一个,包括每次用sigaction调用信号时重新定义信号的行为 定义完整的结构(来自man)并创建sa_flags以便不调用SA_RESETHAND: struct ...
  • 尝试这个: 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"); ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)