首页 \ 问答 \ 如何在visual studio 2010中创建空Qt项目(How to create empty Qt project in visual studio 2010)

如何在visual studio 2010中创建空Qt项目(How to create empty Qt project in visual studio 2010)

使用visual studio C ++ 2010 Ult。 我已经编译并安装了Qt库,并且Visual Studio插件安装到VC ++中,因此我基本上能够使用来自VS加载项的Qt模板构建Qt应用程序。 我也能够包含Qt标题,所有的作品都很好......

使用VSC ++命令promt完成安装,然后使用configure和nmake完全构建。

QTDIR和PATH已正确设置。 Qt库安装到:(QTDIR)C:\ Users \ Admin \ Documents \ Libraries \ Qt(PATH)C:\ Users \ Admin \ Documents \ Libraries \ Qt \ bin

BIG BUT:当装箱新的空(或其他非Qt模板)项目时,我不能包含任何Qt标题,所以我的问题是如何启用它。

我想设置这个,所以我可以在以后的所有项目中简单地写:

#include <Qapplication>
#include <Qlabel> //etc...

非常感谢。


Using visual studio C++ 2010 Ult. I have compiled and instaled Qt libraries and visual studio add-in is installed into VC++ so I'm basicaly able to build Qt applications using Qt templates ofered from VS add-in. I'm also able to include Qt headers and all works just fine...

installation has been done using VSC++ command promt, full build using configure and nmake then.

QTDIR and PATH are properly seted up. Qt libs are installed into: (QTDIR) C:\Users\Admin\Documents\Libraries\Qt (PATH) C:\Users\Admin\Documents\Libraries\Qt\bin

BIG BUT: when crating new empty(or other non Qt template) project I can't include any Qt header so my question is how to enable this.

I want to set this so I can in all my future projects simply write:

#include <Qapplication>
#include <Qlabel> //etc...

thanks alot.


原文:https://stackoverflow.com/questions/8258131
更新时间:2022-06-16 08:06

最满意答案

需要在内存中过度分配data.table,以便通过引用工作来添加列。 加载后并非如此:

load("ttt")
length(a)
#[1] 1
truelength(a)
#[1] 0

b <- data.table(x=1:2)
length(b)
#[1] 1
truelength(b)
#[1] 100

来自help(truelength)

但是对于从磁盘加载的表,在R 2.14.0中truelength为0,在R <= 2.13.2中随机为0; 也就是说,在这两种情 data.table检测此状态,并在下一列添加或删除发生时过度分配已加载的data.table。

但似乎你将一个(新加载的)data.table传递给一个函数,然后在函数内部通过引用添加过度分配,但是在全局环境中没有到达符号(只有函数内部的本地符号) )。 如果您直接在全局环境中执行此操作,或者未将data.table作为函数参数传递,则它可以正常工作。

如果data.table已经过度分配(通常就是这种情况,除了从磁盘上新加载的那个),那么有一些备用插槽可以通过引用添加到列中而没有浅拷贝(以实现过度分配) )需要通过以下方式完成:=函数内部。

这可能值得一个错误报告(但我还没有检查是否已有)。

R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] microbenchmark_1.3-0 data.table_1.8.8    

loaded via a namespace (and not attached):
[1] tools_3.0.1

A data.table needs to be over-allocated in memory for adding columns by reference to work. After loading it that's not the case:

load("ttt")
length(a)
#[1] 1
truelength(a)
#[1] 0

b <- data.table(x=1:2)
length(b)
#[1] 1
truelength(b)
#[1] 100

From help(truelength):

For tables loaded from disk however, truelength is 0 in R 2.14.0 and random in R <= 2.13.2; i.e., in both cases perhaps unexpected. data.table detects this state and over-allocates the loaded data.table when the next column addition or deletion occurs.

But it seems like if you pass a (freshly loaded) data.table to a function and then add by reference inside the function over-allocation happens but doesn't reach the symbol up in the global environment (only the local symbol inside the function). If you do it in the global environment directly or don't pass the data.table as function parameter, it works.

If the data.table is over-allocated already (as is normally the case, other than when freshly loaded from disk), then there are spare slots for the column to be added into by reference and no shallow copy (to achieve over-allocation) needs to be done by := inside the function.

This might be worth a bug report (but I haven't checked if there is already one).

R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] microbenchmark_1.3-0 data.table_1.8.8    

loaded via a namespace (and not attached):
[1] tools_3.0.1

相关问答

更多

相关文章

更多

最新问答

更多
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • 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)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 如何配置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])
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)
  • 是否可以嵌套hazelcast IMaps?(Is it possible to nest hazelcast IMaps? And whick side effects can I expect? Is it a good Idea anyway?)
  • UIViewAnimationOptionRepeat在两个动画之间暂停(UIViewAnimationOptionRepeat pausing in between two animations)
  • 在x-kendo-template中使用Razor查询(Using Razor query within x-kendo-template)
  • 在BeautifulSoup中替换文本而不转义(Replace text without escaping in BeautifulSoup)
  • 如何在存根或模拟不存在的方法时配置Rspec以引发错误?(How can I configure Rspec to raise error when stubbing or mocking non-existing methods?)
  • asp用javascript(asp with javascript)
  • “%()s”在sql查询中的含义是什么?(What does “%()s” means in sql query?)
  • 如何为其编辑的内容提供自定义UITableViewCell上下文?(How to give a custom UITableViewCell context of what it is editing?)
  • c ++十进制到二进制,然后使用操作,然后回到十进制(c++ Decimal to binary, then use operation, then back to decimal)
  • 以编程方式创建视频?(Create videos programmatically?)
  • 无法在BeautifulSoup中正确解析数据(Unable to parse data correctly in BeautifulSoup)
  • webform和mvc的区别 知乎
  • 如何使用wadl2java生成REST服务模板,其中POST / PUT方法具有参数?(How do you generate REST service template with wadl2java where POST/PUT methods have parameters?)
  • 我无法理解我的travis构建有什么问题(I am having trouble understanding what is wrong with my travis build)
  • iOS9 Scope Bar出现在Search Bar后面或旁边(iOS9 Scope Bar appears either behind or beside Search Bar)
  • 为什么开机慢上面还显示;Inetrnet,Explorer
  • 有关调用远程WCF服务的超时问题(Timeout Question about Invoking a Remote WCF Service)