草庐IT

member-hiding

全部标签

c++ - Vim 中文件的一部分的快照 : hide comments and blank lines

如何临时显示文件快照,同时隐藏注释和空行?目的是在密集的页面格式中捕获C++函数(例如)。一种方法是使用全局命令过滤掉注释行:g!/\/\/但随后语法高亮显示和移动控件消失了。Vim的折叠功能是完成这项工作的一种方式,但它只会将几个连续的注释减少到一行,这在视觉上是有干扰的。无论如何,折叠对于隐藏类似C的长注释仍然很有用,例如::setfoldmethod=marker:setfoldmarker=/*,*/但我没能在一个命令中轻松折叠C(/.../)和C++(//...)注释。理想的技巧是:隐藏(不仅仅是在一行中折叠)注释和空行,也许在第一列用一个字符表示隐藏线,处理C和C++注释,

c++ - 错误 : invalid use of member in static member function

我有两个类,这是其中一个的标题:#ifndefWRAPPER_HPP#defineWRAPPER_HPP#includeusingnamespacestd;classWrapper{private://SDL_Surface*screen;public:staticSDL_Surface*screen;staticvoidset_screen(SDL_Surface*_screen);staticvoidset_pixel(intx,inty,Uint8color);staticvoidclear_screen(intr,intg,intb);staticSDL_Surface*loa

c++ - 不合格的名称查找 : Why local declaration hides declaration from using directive

考虑这段代码:namespaceA{inti=24;}namespaceB{usingnamespaceA;inti=11;intk=i;//findsB::i,noambiguity}和basic.lookup.unqual.2:§6.4.1Unqualifiednamelookup[basic.lookup.unqual]Thedeclarationsfromthenamespacenominatedbyausing-directivebecomevisibleinanamespaceenclosingtheusing-directive;see[namespace.udir].F

c++ - CString 'Trim' : is not a member, 为什么?

我有一个简单的应用程序,我尝试用VCExpress编译并使用:适用于WindowsServer2003的Microsoft平台SDK,包含MFC和ATL。现在我有了这个简单的代码:CStringstrValue("test");CStrings=strValue.Trim();LPCTSTRlpStr=(LPCTSTR)strValue.Trim()这给我一个编译错误:c:\dev\test.cpp(463):errorC2039:'Trim':不是'CString'的成员c:\programfiles\microsoftplatformsdkforwindowsserver2003r

c++ - 错误消息 : 'value_type' : is not a member of

我不明白这个神秘的错误消息,但我得到了30个`'value_type':isnotamemberof'TextFileLineBuffer'`当我在VC++6中编译以下代码时,//***行未注释。当然,如果我把它注释掉,它编译得很好。我想我在过去的两个小时里尝试了各种尝试,但都没有成功。任何提示将不胜感激。#include#include#include#include#include#include//wrapperforastringlinestructTextLine{std::stringm_sLineContent;operatorstd::stringconst&()con

c++ - 智能感知 : namespace "MSXML2" has no member "DOMDocument" in VS2012

我正在尝试编译我继承的项目,然后遇到了这个错误。以下是一些相关代码:#include...HRESULThr;hr=pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument));有人可以帮忙吗? 最佳答案 我在Windows8中看到了类似的问题。似乎MSXML6.0没有公开DOMDocument,但它确实公开了DOMDocument60。为了帮助其他人通过搜索到达这里,您可能还会看到的编译器错误是:错误C2039:“DOMDocument”:不是“MSXML2”的成员尝试进行以下更改以明确使用

c++ - Qt5 : How to hide or remove a QMenu from the QMenuBar?

我在Windows7平台上使用Qt5:QtCreator版本为:v3.3.2.Qt版本5.5.1和MinGW32位。目前,在我的菜单栏中:Configuration-Reports-Help我搜索了SO,我发现这是一个可能的答案:NotpossibletohideaQMenuobjectQMenu::setVisible()?,但没用...因此,我尝试使用以下方法删除“帮助”菜单:ui->menuHelp->setVisible(false);和:ui->menuHelp->menuAction()->setVisible(false);不幸的是,两者都未能隐藏/删除帮助菜单...请问

c++ - 如何在函数声明中声明 C++ mem_fn(member_function)?

我理解在其类之外传递成员函数地址的基本问题。我觉得mem_fn()可能是解决方案,但我在具体细节上遇到了麻烦。我在类p中有一个成员函数,当前声明为typedefvoid(*valNamedFlagsCallback)(constint,constbool);boolvalNamedFlags(constOptBlk*operand,constchar*description_of_value_or_NULL,constintsubscripts[],constchar*names[],valNamedFlagsCallbackcallBack);在e类中,我试图用调用valNamedF

c++ - 解决 "only static const integral data members can be initialized within a class"编译错误

以下创建全局对象会导致编译错误。#include"stdafx.h"#includeusingnamespaceSystem;usingnamespacestd;#pragmahdrstopclassTester;voidinput();classTester{staticintnumber=5;public:Tester(){};~Tester(){};voidsetNumber(intnewNumber){number=newNumber;}intgetNumber(){returnnumber;}}TestertesterObject;voidmain(void){cout>ne

c++ - Q_PROPERTY : MEMBER vs READ/WRITE

我正在阅读有关Q_PROPERTY宏的Qt5.5文档,但我无法很好地理解它。我知道您可以在此宏中使用关键字MEMBER或访问器READ/WRITE。如果您使用关键字MEMBER,则不必编写访问器,因为您可以使用setProperty()和Property()访问您的私有(private)数据成员(属性),如set和get。关键是:使用MEMBER和使用READ/WRITE有什么区别吗?什么时候应该使用一种方式,什么时候使用另一种方式?如有必要:使用MEMBER的例子:Q_PROPERTY(QStringtextMEMBERm_textNOTIFYtextChanged)使用读/写的例子