Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • class operator overloading error

    Unsolved
    16
    0 Votes
    16 Posts
    2k Views
    J
    @jericho63 that's work! Thank you The operator overload no longer need to be define in a class now?
  • Adapt a program to a new version of Qt

    Solved
    7
    0 Votes
    7 Posts
    890 Views
    L
    It's alright, I've solved it. The executable on Windows was using Qt 5.13.2 DLL files, all I had to do was to update them.
  • Camera fail create video output on Qt 6.6.1

    Unsolved
    7
    0 Votes
    7 Posts
    686 Views
    L
    @JoeCFD yes i have try on vlc first it's work but i still have same problem
  • How to set custom axis range for QBarSeries chart?

    Unsolved
    1
    0 Votes
    1 Posts
    420 Views
    No one has replied
  • Cannot get second QWidget window to show

    Solved
    3
    0 Votes
    3 Posts
    355 Views
    P
    @ChrisW67 Thanks for thew quick reply After making the second window a new window it did show up. I also had only one display only field on the second window, which when I made it part of the parent didn't show up, so I thought it didn't work. Thanks
  • Realtime Update of QLineEdit tools

    Solved
    6
    0 Votes
    6 Posts
    563 Views
    D
    @JonB You are correct in your first assumption about the QLineEdit. Also I was referring to the memory model database examples inadvertently. I will review the link that you sent me. I have looked at that before, but I have to admit, I'm not well versed in the qt functions yet. I have not explored the QDataWidgetMapper, that may be the answer to my question. In the future I will be wanting to receive data from an OPC server which is part of the direction of the question. Thanks for your feedback it is helpful and I will explore your suggestions. jdc
  • 0 Votes
    8 Posts
    717 Views
    A
    And here's the generated fragment shader code from the cache directory. #version 450 #define LAYER_diffuse #define LAYER_specular #define LAYER_normal layout(location = 0) in vec3 worldPosition; layout(location = 1) in vec3 worldNormal; // Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause layout(std140, binding = 0) uniform qt3d_render_view_uniforms { mat4 viewMatrix; mat4 projectionMatrix; mat4 uncorrectedProjectionMatrix; mat4 clipCorrectionMatrix; mat4 viewProjectionMatrix; mat4 inverseViewMatrix; mat4 inverseProjectionMatrix; mat4 inverseViewProjectionMatrix; mat4 viewportMatrix; mat4 inverseViewportMatrix; vec4 textureTransformMatrix; vec3 eyePosition; float aspectRatio; float gamma; float exposure; float time; }; layout(std140, binding = 1) uniform qt3d_command_uniforms { mat4 modelMatrix; mat4 inverseModelMatrix; mat4 modelViewMatrix; mat3 modelNormalMatrix; mat4 inverseModelViewMatrix; mat4 mvp; mat4 inverseModelViewProjectionMatrix; }; layout(std140, binding = 2) uniform qt3d_extras_uniforms { float texCoordScale; }; #line 2 const int MAX_LIGHTS = 8; const int TYPE_POINT = 0; const int TYPE_DIRECTIONAL = 1; const int TYPE_SPOT = 2; struct Light { vec3 position; float intensity; vec3 color; float constantAttenuation; vec3 direction; float linearAttenuation; float quadraticAttenuation; float cutOffAngle; int type; }; layout(std140, binding = 3) uniform qt3d_light_uniforms { Light lights[MAX_LIGHTS]; int lightCount; int envLightCount; }; // Pre-convolved environment maps layout(binding = 4) uniform samplerCube envLight_irradiance; // For diffuse contribution layout(binding = 5) uniform samplerCube envLight_specular; // For specular contribution #line 5 void adsModel(const in vec3 worldPos, const in vec3 worldNormal, const in vec3 worldView, const in float shininess, out vec3 diffuseColor, out vec3 specularColor) { diffuseColor = vec3(0.0); specularColor = vec3(0.0); // We perform all work in world space vec3 n = normalize(worldNormal); vec3 s = vec3(0.0); for (int i = 0; i < lightCount; ++i) { float att = 1.0; float sDotN = 0.0; if (lights[i].type != TYPE_DIRECTIONAL) { // Point and Spot lights // Light position is already in world space vec3 sUnnormalized = lights[i].position - worldPos; s = normalize(sUnnormalized); // Light direction // Calculate the attenuation factor sDotN = dot(s, n); if (sDotN > 0.0) { if (lights[i].constantAttenuation != 0.0 || lights[i].linearAttenuation != 0.0 || lights[i].quadraticAttenuation != 0.0) { float dist = length(sUnnormalized); att = 1.0 / (lights[i].constantAttenuation + lights[i].linearAttenuation * dist + lights[i].quadraticAttenuation * dist * dist); } // The light direction is in world space already if (lights[i].type == TYPE_SPOT) { // Check if fragment is inside or outside of the spot light cone if (degrees(acos(dot(-s, lights[i].direction))) > lights[i].cutOffAngle) sDotN = 0.0; } } } else { // Directional lights // The light direction is in world space already s = normalize(-lights[i].direction); sDotN = dot(s, n); } // Calculate the diffuse factor float diffuse = max(sDotN, 0.0); // Calculate the specular factor float specular = 0.0; if (diffuse > 0.0 && shininess > 0.0) { float normFactor = (shininess + 2.0) / 2.0; vec3 r = reflect(-s, n); // Reflection direction in world space specular = normFactor * pow(max(dot(r, worldView), 0.0), shininess); } // Accumulate the diffuse and specular contributions diffuseColor += att * lights[i].intensity * diffuse * lights[i].color; specularColor += att * lights[i].intensity * specular * lights[i].color; } } vec4 phongFunction(const in vec4 ambient, const in vec4 diffuse, const in vec4 specular, const in float shininess, const in vec3 worldPosition, const in vec3 worldView, const in vec3 worldNormal) { // Calculate the lighting model, keeping the specular component separate vec3 diffuseColor, specularColor; adsModel(worldPosition, worldNormal, worldView, shininess, diffuseColor, specularColor); // Combine spec with ambient+diffuse for final fragment color vec3 color = (ambient.rgb + diffuseColor) * diffuse.rgb + specularColor * specular.rgb; return vec4(color, diffuse.a); } layout(location = 0) out vec4 fragColor; layout(std140, binding = 6) uniform qt3d_shadergraph_generated_uniforms { float shininess; vec4 ks; vec4 kd; vec4 ka; }; void main() { fragColor = (((((((phongFunction(ka, kd, ks, shininess, worldPosition, normalize(((eyePosition - worldPosition))), normalize(worldNormal))))))))); }
  • Do these two methods return the same value?

    Unsolved
    10
    0 Votes
    10 Posts
    646 Views
    Pl45m4P
    @duncan98 said in Do these two methods return the same value?: but I don't seem to be able to, only the header file You need to add the Qt src path to your QtCreator. QtCreator > Tools > Options > Debugger > Source Path Mapping > Add Qt sources And then put the path to your Qt/<version>/src there.
  • QNetworkAccessManager::authenticationRequired signal not emitted

    Unsolved
    3
    0 Votes
    3 Posts
    680 Views
    D
    @ChrisW67 yea, the forum suggested the thread I was writing in before might be too old, so I do not know if it is the right thing to start a new one or keep writing in the old.
  • Qt Creator fails to run a basic Qt Design Studio Project

    Unsolved
    1
    0 Votes
    1 Posts
    208 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • can't link correctly static openssl libraries

    Unsolved
    2
    0 Votes
    2 Posts
    609 Views
    Christian EhrlicherC
    @vofr said in can't link correctly static openssl libraries: ${A_DIR_MODULE_ROOT}/platform/windows/lib/libcrypto.lib These are MSVC import libs.
  • This topic is deleted!

    Solved
    6
    0 Votes
    6 Posts
    111 Views
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    19 Views
    No one has replied
  • Selling a GPL/LGPL software as a company

    Unsolved open source licence
    13
    0 Votes
    13 Posts
    3k Views
    S
    @Rahul-Das said in Selling a GPL/LGPL software as a company: How the end user gets the dependency libs - well - could be through a repository ? or distribution by the you (company) ? As long as the libs are not changed (which is normally the case - unless you recompile it), what's the problem ? This has been discussed over and over again: You need to have the source code of the exact version of the LGPL library you used. And it is not sufficient to link to someone else hosting the code. You must have control over the source. You can host it yourself and maybe you could also have your own repository on GITHub or similar. @Volker75 said in Selling a GPL/LGPL software as a company: Well, the initial question was about selling GPL (and LGPL) software. Nothing is preventing you from selling software under the GPL (as long as you also provide the source code, which is not what the OP wants). However, you cannot in any way restrict what the customer does with the software afterwards. He is allowed to sell it, too. He is also allowed to give it away for free. This hardly makes it a viable business strategy. Linux is GPL and SUSE and RedHat are selling Linux. It mostly works for them because of the support they are selling together with the product.
  • The code is inconsistent with the execution

    Unsolved
    2
    0 Votes
    2 Posts
    230 Views
    C
    Then one or more of these things is true: You are not compiling the source code you think you are. This could be because there are several copies of the source, or because the project file does not list all the components, or the project file has changed but not been reprocessed. You are not compiling into the directory you think you are. You are not running the executable that the compilation has produced. Are you building a release version but running an older debug version for example. There is no way for us to diagnose this for you.
  • A QMenu Popup to Confirm a Button Click

    Unsolved qmenu qaction popup
    7
    0 Votes
    7 Posts
    1k Views
    C
    @JonB that works. Don't know why I didn't try that, other than getting lost in all the overloads that involved signals/slots. The simplest one with just a QString argument does the trick. Thanks!
  • Use of deleted function error when compiling

    Solved
    3
    0 Votes
    3 Posts
    896 Views
    P
    @ChrisW67 Thanks
  • This topic is deleted!

    Unsolved
    5
    0 Votes
    5 Posts
    77 Views
  • Unknown module(s) in QT: openssl-linked

    Unsolved network ssl openssl
    6
    0 Votes
    6 Posts
    1k Views
    T
    Oh well. I am calling wget to get things accomplished. Nice work around that also takes care of redirects and all that.