Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • QTextEdit set row colour based

    Unsolved
    1
    0 Votes
    1 Posts
    140 Views
    No one has replied
  • How to use a QGraphicsItem in a Delegate?

    Solved qitemdelegate qgraphicswidget qtreeview
    8
    0 Votes
    8 Posts
    1k Views
    SGaistS
    @Jammin44fm the paint method of QGraphicsItem is public so you can call it yourself with the painter you use in the delegate.
  • Minior ethic "issue"

    Unsolved
    4
    0 Votes
    4 Posts
    273 Views
    A
    @Pl45m4 The title should have been "Minor ethic issue" minor as in irrelevant . This post was not about "how to set aliment " but since you brought it up here is the code result_name = Get_("hci0",result ,"hci0"); if(!result_name .contains(" FAILED ")) { **ui->lineEdit_10->setAlignment(Qt::AlignRight);** ui->lineEdit_10->setText(result_name ); ui->textEdit->append(result_name ); ui->textEdit_3->append(result_name ); } else { ui->textEdit_4->append(result_name); } ... and the result is still same - the text is LEFT ALIGNED... BUMMER I changed "build only changed files " and it does not ... I had to run "build" to get the "right align " to take...
  • setPointConfiguration does nothing

    Unsolved
    6
    0 Votes
    6 Posts
    454 Views
    N
    @JonB I should ask, is this an oversight or bug? Should turning on OpenGL de-activate certain features of QLineseries?
  • Stylesheet for the arrows on the QListView of a QCombobox

    Unsolved
    3
    0 Votes
    3 Posts
    603 Views
    C
    @jsulm Sorry, I'm just not seeing it. I'm already styling "QComboBox::down-arrow" and "CComboBox::drop-down" to make the combobox look like this. [image: fa9289d7-fe71-4646-8511-51178ad53796.png] For smaller lists, those arrows don't appear and it looks fine. I styled "QComboBox QAbstractItemView { " to set the padding, background color, selection color, item selection border for the itens on the ListView. The only things in the example I'm not using are the "on" and "editable" states. I'm not planning on allowing the user to edit the combobox and I don't want it to look different if it's on or not. To see if I could change the color of those arrow buttons to red, I literally tried styling something similar to the example below for every sub-control on the List of Sub-Controls in this link https://doc.qt.io/qt-6/stylesheet-reference.html#sub-line-sub, but nothing changed those two buttons. "CComboBox::down-arrow {" "background-color: red;" "}" "CComboBox::float-button {" "background-color: red;" "}" "CComboBox::indicator {" "background-color: red;" "}" ... I'm just looking for the name of these sub-controls or if they should be addressed as another class instead of a sub-control. I really would appreciate an example like the ones above that could turn those two arrows red or set an image or change them in any way.
  • How to correctly close the subroutine started by QProcess?

    Solved
    2
    0 Votes
    2 Posts
    209 Views
    aha_1980A
    @alexaatm That sounds like a horrible solution as this will block your event loop. Let me guess: you create the QProcess object on the stack and when the object goes out of scope, it is destroyed and therefore the executable is killed. The correct solution is to make the QProcess a member variable so it stays alive when the calling function exits. Instead the waitForXxxx functions you should use signals and slots to communicate with the process. Regards
  • Using OpenCV with QT 6 and CMake

    Unsolved
    13
    0 Votes
    13 Posts
    6k Views
    D
    This worked for me
  • class operator overloading error

    Unsolved
    16
    0 Votes
    16 Posts
    1k 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
    662 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
    585 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
    345 Views
    No one has replied
  • Cannot get second QWidget window to show

    Solved
    3
    0 Votes
    3 Posts
    303 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
    471 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
    634 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
    569 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
    562 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
    172 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
    436 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