草庐IT

my_application

全部标签

c++ - 隐藏的 QMainWindow : application crashes after QMessageBox is displayed 问题

//main.cpp#include#include"mainwindow.h"intmain(intargc,char*argv[]){QApplicationapp(argc,argv);MainWindow*window=newMainWindow();window->show();returnapp.exec();}//mainwindow.cpp#include#include#include#include"mainwindow.h"MainWindow::MainWindow(QWidget*parent):QMainWindow(parent){this->setCen

c++ - std::error_code,my_error::check_block == my_error::validate && my_error::accept_block == my_error::validate

我正在使用std::error_code并定义和注册了一堆错误(使用枚举类)。我有一个非常通用的错误,现在称为my_error::validate,但我想在我的库中提供更具体的版本。通常人们会想要使用:if(ec==bc::error::validate)//...但是有时他们可能希望看到与该std::error_code关联的特定错误或打印错误消息。//ec.message()says"check_block()failedtodoXYZ"assert(ec==bc::error::check_block);我希望能够启用如下功能:if(ec==bc::error::validate

c++ - 为什么 "error: invalid application of ' sizeof' 为使用 unique_ptr 的不完整类型”通过添加空析构函数来修复?

这个问题在这里已经有了答案:Isstd::unique_ptrrequiredtoknowthefulldefinitionofT?(9个回答)关闭7年前。我在类里面拉皮条STFT.在header中用这个编译就好了:classSTFT;//pimplofftopreventpointnameclashclassWhatever{private:STFT*stft;这在实现中:#include"STFT.h"Whatever::Whatever():stft(newSTFT()){//blahblah}Whatever::~Whatever(){deletestft;//pureevil

C++: "my text"是 std::string、*char 还是 c 字符串?

我刚刚做了看起来是acommonnewbiemistake的事情:首先我们阅读oneofmanytutorials是这样的:#includeintmain(){usingnamespacestd;ifstreaminf("file.txt");//(...)}其次,我们尝试在我们的代码中使用类似的东西,它是这样的:#includeintmain(){usingnamespacestd;std::stringfile="file.txt";//Orgetthenameofthefile//fromafunctionthatreturnsstd::string.ifstreaminf(fi

android - 安卓版 Qt : change the application icon

如何更改针对android的Qt项目的图标,以便应用程序的启动器具有此图标? 最佳答案 您应该创建一个Androidlist文件并在QtCreator中编辑它。转到项目>构建AndroidAPK>详细信息现在选择创建模板来创建list文件并在编辑器中打开它:如图所示,您可以为您的应用程序设置三个版本的图标,从左到右分别为低、中、高DPI值。这种制作androidlist文件的新方法自Qt5.4和QtCreator3.3开始可用。以前版本在Projects->Run->Deploy中有一个CreateAndroidManifest.x

c++ - ->second 是否为迭代器 my_map.end() 定义?

我正在使用std::map.我想测试是否my_map.find(key)返回一个特定的指针。现在我在做;autoiter=my_map.find(key);if((iter!=my_map.end())&&(iter->second==expected)){//Somethingwonderfulhashappened}然而,operator*迭代器的需要返回一个引用。凭直觉我假设它是有效的并且完全初始化?如果是这样,my_map.end()->second将是NULL,并且(因为NULL从来都不是预期的),我可以将我的if语句减少到:if(iter->second==expected

c++ - 如何模仿静态库的 "multiple instances of global variables within the application"行为但使用 DLL?

我们有一个用C/C++编写的应用程序,它被分解为一个EXE和多个DLL。这些DLL中的每一个都使用相同的静态库(utilities.lib)。实用程序静态库中的任何全局变量在应用程序运行时实际上都会有多个实例。utilities.lib链接到的每个模块(即DLL或EXE)将有一份全局变量拷贝。(这是众所周知的好事,但值得回顾一下静态库在DLL上下文中的行为方式的一些背景知识。)现在我的问题..我们想要更改utilities.lib以便它成为一个DLL。它变得非常庞大和复杂,我们希望以DLL形式而不是.lib形式分发它。问题是对于这个应用程序,我们希望保留每个应用程序DLL在实用程序库中

windows - 执行 svn 合并时出现 "out of memory - terminating application"错误

尝试在32位WindowsXP下使用Subversion1.6.9执行命令行svnmerge时,我们看到以下错误。Outofmemory-terminatingapplication.ThisapplicationhasrequestedtheRuntimetoterminateitinanunusualway.Pleasecontacttheapplication'ssupportteamformoreinformation.此时检查Windows任务管理器显示以下内存使用情况svn.exe进程的峰值内存使用量超过1.8GB。顺便说一句,我们在尝试使用TortoiseSVN执行合并时

windows - my.bat 不是内部或外部命令,也不是可运行的程序或批处理文件

当我登录到此Windows2008R2服务器并启动CMD窗口时,默认目录是:C:\Users\SVC_asl2trim>所以我将其添加到PATH中,然后发布:C:\Users\SVC_asl2trim>setpathPath=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\ProgramFiles\Hewlett-Packard\HPTRIM\;C:\Users\SVC_asl2trim\PATHEXT=.COM;.EXE;.BA

node.js - Node js 应用程序在 Windows 机器中给出错误 "%1 is not a valid Win32 application"

我的Nodejs应用程序在ubuntu中运行良好。当我尝试在Windows机器中部署相同的内容时,它显示以下错误。=>nodeserver.jsD:\home\site\wwwrootD:\home\site\wwwroot\node_modules\ffi\node_modules\bindings\bindings.js:83throwe^Error:%1isnotavalidWin32application.D:\home\site\wwwroot\node_modules\ffi\node_modules\ref\build\Release\binding.nodeatErro