我在我的LFS上编译八度 - 从头开始 - Linux系统.
在配置八度时,我收到一条警告:
configure:警告:找不到FFTW3F库.将使用较慢的FFTPACK库.
我编译并安装了FFTW 3.3.4,然后重新配置了octave,但是我仍然收到以下消息:
检查fftw3.h的可用性......是的
检查fftw3.h的存在......是的
检查fftw3.h ...是的
在-lfftw3中检查fftw_plan_dft_1d ...是的
检查fftw3.h ...(缓存)是的
在-l fftw3f中检查fftwf _plan_dft_1d ...没有
configure:警告:找不到FFTW3F库.将使用较慢的FFTPACK库.
我注意到FFTW 3.3.4安装libfftw3.so但不是libfftw3f.so,这就是为什么即使安装了FFTW 3.3.4之后,八度音也找不到FFTW3F库.现在,我想知道如何安装libfftw3f.so.
我创建了一个像这样的 Qt3D 网格:
Qt3DCore::QEntity *newEntity = new Qt3DCore::QEntity();
Qt3DExtras::QConeMesh *mesh =new Qt3DExtras::QConeMesh();
mesh->setTopRadius(0.2);
mesh->setBottomRadius(1.0);
mesh->setLength(2.0);
for(int i = 0; i < mesh->geometry()->attributes().size(); ++i) {
mesh->geometry()->attributes().at(i)->buffer()->setSyncData(true); // To have access to data
}
newEntity->addComponent(mesh);
Run Code Online (Sandbox Code Playgroud)
创建的网格如下所示:
在代码的后面,我尝试以STL 二进制格式导出上述网格。为此,我提取了实体的几何和变换组件:
Qt3DCore::QComponent *compoMesh = nullptr; // place holder for mesh geometry of entity
Qt3DCore::QComponent *compoTran = nullptr; // place holder for mesh transformation of entity
QVector<Qt3DCore::QComponent *> compos = newEntity->components();
for(int i = 0; i < compos.size(); …Run Code Online (Sandbox Code Playgroud) 我在*.pro项目文件中定义了这个宏:
# The application version
VERSION = 6.10.0
# Define the preprocessor macro to get the application version in our application.
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
Run Code Online (Sandbox Code Playgroud)
然后我设置我的应用程序版本如下:
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
/*
* Setting the Application version
*/
app.setApplicationVersion(APP_VERSION);
// ...
}
Run Code Online (Sandbox Code Playgroud)
现在我想访问共享库中的QML代码中的应用程序版本.我怎样才能做到这一点?:
ColumnLayout {
id: versionLayout
StyledLabel {
text: qsTr("Version")
font.weight: Font.Bold
}
RowLayout {
StyledLabel {
Layout.alignment: Qt.AlignCenter
text: APP_VERSION // How can I access my macro/version here?
// QApplication.applicationVersion() is …Run Code Online (Sandbox Code Playgroud) 我尝试在的列表中突出显示a selectedItem及其子元素items。
const QList<Item *> items = /* ... */;
Item *selectedItem = /* ... */;
Q_FOREACH( Item *item, items ) {
if ( selectedItem == item ) {
item->setHighlightEnabled(true); // Highlight selected item
} else {
item->setHighlightEnabled(false); // De-highlight other items
}
}
Run Code Online (Sandbox Code Playgroud)
该item->setHighlightEnabled方法对子级递归执行相同的操作:
void Item::setHighlightEnabled(bool enabled)
{
if (enabled) {
/* highlight item */
} else {
/* de-highlight item */
}
// Go through all children and highlight them too …Run Code Online (Sandbox Code Playgroud) 本指南讨论可拉伸常量:
尽可能使用“可拉伸”常量
可伸缩的常数避免了字长变化的问题。
它还提供了一个示例:
const int all_ones = ~0;
const int last_3_bits = ~0x7;
Run Code Online (Sandbox Code Playgroud)
什么是可拉伸常数?
我正在使用 Qt3D 的预制材料:
Qt3DRender::QMaterial *MyClass::createMaterial()
{
Qt3DExtras::QPhongAlphaMaterial *mat = new Qt3DExtras::QPhongAlphaMaterial();
mat->setAmbient(QColor("#576675"));
mat->setDiffuse(QColor("#5F6E7D"));
mat->setSpecular(QColor("#61707F"));
mat->setShininess(0.0f);
mat->setAlpha(0.5f);
return mat;
}
Run Code Online (Sandbox Code Playgroud)
我将 alpha 设置为0.5f,所以我希望材料是半透明的。但模型看起来大部分是白色的,除了一些区域:
当我检查源代码时,我看到了 alpha 混合的这个设置:
m_blendState->setSourceRgb(QBlendEquationArguments::SourceAlpha);
m_blendState->setDestinationRgb(QBlendEquationArguments::OneMinusSourceAlpha);
m_blendEquation->setBlendFunction(QBlendEquation::Add);
Run Code Online (Sandbox Code Playgroud)
我想知道为什么模型看起来是白色的?
正如@Macke 所建议的,黑色背景上的物体看起来不错!
当我设置alpha为 时1.0,我观察到:
正如@Macke 所指出的,一个问题与深度测试有关。在源代码上,默认情况下禁用深度蒙版:
// ...
, m_noDepthMask(new QNoDepthMask())
// ...
m_phongAlphaGL3RenderPass->addRenderState(m_noDepthMask);
m_phongAlphaGL2RenderPass->addRenderState(m_noDepthMask);
m_phongAlphaES2RenderPass->addRenderState(m_noDepthMask);
Run Code Online (Sandbox Code Playgroud)
我通过删除QNoDepthMask东西启用了深度蒙版,现在alpha = 1.0渲染结果很好:
在@EddyAlleman 的建议下,我添加了以下代码行:
blendState->setSourceAlpha(Qt3DRender::QBlendEquationArguments::Zero);
blendState->setDestinationAlpha(Qt3DRender::QBlendEquationArguments::One);
Run Code Online (Sandbox Code Playgroud)
然后,alpha = 0.4即使在灰色背景下,透明度 ( ) 也很好:
我正在尝试构建一个库并将其链接到一个应用程序。库构建没问题,但链接到应用程序会引发以下错误:
Clipper.lib(clipper.obj) :错误 LNK2001:无法解析的外部符号 __CxxFrameHandler4
Clipper.lib(clipper.obj) :错误 LNK2001:无法解析的外部符号 __GSHandlerCheck_EH4
根据this和that,错误可能是由于使用 VS 2019工具集构建库造成的,但应用程序正在使用 VS 2017工具集。
我正在使用以下命令构建库:
cd lib/src/clipper
mkdir build
cd build/
cmake ..
cmake --build . --config Debug
cmake --build . --config Release
Run Code Online (Sandbox Code Playgroud)
即使在 VS 2017 命令提示符下,CMake 也会为 VS 2019 构建库:
强制 CMake 为 VS 2017 而不是 2019 构建的最简单/最快的方法是什么?
我已经tbb下载并放置在我的存储库目录中:
> tree deps/tbb/ -d \ndeps/tbb/\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 bin\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 cmake\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 templates\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 include\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serial\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 tbb\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 tbb\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 compat\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 internal\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 machine\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 lib\n \xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 ia32\n \xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 gcc4.8\n \xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 intel64\n \xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 gcc4.8\nRun Code Online (Sandbox Code Playgroud)\n在我的CMakeLists.txt我已经尝试过这个:
include_directories("deps/tbb/include")\n\n\nfind_library(TBB_LIB\n NAMES\n tbbbind_debug\n tbbbind\n tbb_debug\n tbbmalloc_debug\n tbbmalloc_proxy_debug\n tbbmalloc_proxy\n tbbmalloc\n tbb_preview_debug\n tbb_preview\n tbb\n HINTS "${CMAKE_PREFIX_PATH}/deps/tbb/lib/intel64/gcc4.8"\n)\n\nadd_executable(${PROJECT_NAME}\nsrc/main.cpp\n)\n\ntarget_link_libraries(${PROJECT_NAME} PUBLIC ${TBB_LIB})\nRun Code Online (Sandbox Code Playgroud)\n但是使用cmake, 链接器构建会引发此错误:
\n\n/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:找不到-lTBB_LIB-NOTFOUND
\ncollect2:错误:ld 返回 1 退出状态
\n
我无法弄清楚缺少什么。谢谢。
\n我下载了Android Studio 3.0,并开始关注构建我的第一个应用教程.但Gradle抛出的错误如下:
无法解析com.android.support:appcompat-v7:26.1.0.
最终我发现我正在使用Android Studio的代理:
要解决这个错误,我必须通过将这些行添加到gradle.properties文件来实现Gradle的代理:
systemProp.http.proxyHost=127.0.0.1
systemProp.http.nonProxyHosts=localhost, 127.0.0.1
org.gradle.jvmargs=-Xmx1536m
systemProp.http.proxyPort=8118
systemProp.https.proxyHost=127.0.0.1
systemProp.https.nonProxyHosts=localhost, 127.0.0.1
systemProp.https.proxyPort=8118
Run Code Online (Sandbox Code Playgroud)
添加上述语句后gradle.properties,错误得到解决.请注意,需要将两个 代理HTTP和HTTPS代理添加到Gradle属性
我在openSUSE Leap 15上使用Qt 5.9.4上的GCC7.
我有以下课程:
class ManSuppProps : public QObject
{
Q_OBJECT
public:
explicit ManSuppProps(QString parentName);
explicit ManSuppProps(){}
explicit ManSuppProps(const ManSuppProps &manSuppProps);
explicit ManSuppProps(ManSuppProps &manSuppProps);
~ManSuppProps();
private:
QVector3D m_suppPos;
QString m_suppParentName;
}
Run Code Online (Sandbox Code Playgroud)
通过以下构造函数的实现:
ManSuppProps::ManSuppProps(QString parentName)
: QObject()
, m_suppPos(QVector3D(0, 0, 0))
, m_suppParentName(parentName)
{
qDebug()<<"Constructing ManSuppProps object ...";
}
ManSuppProps::ManSuppProps(const ManSuppProps &manSuppProps)
: QObject()
, m_suppPos(manSuppProps.getSuppPos())
, m_suppParentName(manSuppProps.getSuppParentName())
{
}
ManSuppProps::ManSuppProps(ManSuppProps &manSuppProps)
: QObject()
, m_suppPos(manSuppProps.getSuppPos())
, m_suppParentName(manSuppProps.getSuppParentName())
{
}
ManSuppProps::~ManSuppProps(){}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
错误:没有匹配函数来调用'ManSuppProps :: ManSuppProps(ManSuppProps&)'
在具有类成员的另一个类的方法中ManSuppProps:
ManSuppProps EditorScene::manSuppProps() …Run Code Online (Sandbox Code Playgroud)