Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. 请问C++17 -> “std::any”是不是与QT的控件类有冲突?
Forum Updated to NodeBB v4.3 + New Features

请问C++17 -> “std::any”是不是与QT的控件类有冲突?

Scheduled Pinned Locked Moved Unsolved Chinese
1 Posts 1 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    X-Crack
    wrote on last edited by
    #1

    std::any var = std::make_any<QPushButton>("123123", Q_NULLPTR);
    如上示例,无论我怎么写,编译器都会报错 如下:

    ~~```
    1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\any(471): error C2440: “初始化”: 无法从“initializer list”转换为“std::any”
    1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\any(470): note: 无构造函数可以接受源类型,或构造函数重载决策不明确
    note: 参见对正在编译的函数 模板 实例化“std::any std::make_any<QPushButton,const char(&)[7],nullptr>(const char (&)[7],nullptr &&)”的引用

    
    有经验的兄弟请教该如何解决。
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved