Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Is Apple's SwiftUI just a copy of QML?

    Unsolved
    5
    0 Votes
    5 Posts
    925 Views
    W
    @Pl45m4 It's often said that Apple doesn't invent anything, but they just improve upon what others have done.
  • Problem building Qt for Raspberry Pi OS

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    Ronel_qtmasterR
    @jlouts check this.It is not on Ubuntu but it can hugely help you https://drive.google.com/file/d/1-Dd228_crhvV1VJnNjqLCAl3O6_cWeJ4/view?usp=drive_link
  • This topic is deleted!

    Unsolved
    6
    0 Votes
    6 Posts
    73 Views
  • CMake can NOT find Vulkan when building

    Solved windows cmake vulkan missing
    3
    0 Votes
    3 Posts
    3k Views
    sierdzioS
    @PerssonBrown said in CMake can NOT find Vulkan when building: Here are my questions: What is Vulkan? It is a library for displaying graphics, much like OpenGL, DirectX or Metal. Do all Widget Applications need Vulkan? No, you can safely ignore this warning. When Vulkan is not present, Qt will use other libraries to draw stuff. How to fix this missing warning? On Windows I'm not sure if you can fix it, but you can ignore it.
  • MSCV C2338 permissive and C2139 Qstring not defined class (BLE scanner under MSVC)

    Unsolved
    2
    0 Votes
    2 Posts
    225 Views
    jsulmJ
    @Flaming-Moe said in MSCV C2338 permissive and C2139 Qstring not defined class (BLE scanner under MSVC): C2139 Qstring not defined class is not allowed as... Please post the exact error and the code causing it
  • can't show webcam on Qt 6

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    L
    @JoeCFD yes my Qt version 5.15
  • How to redirect all cout to file

    Unsolved
    2
    0 Votes
    2 Posts
    328 Views
    sierdzioS
    @JacobNovitsky redirecting output is not something to bother qmake (the build system) with. Either set up Qt Creator run configuration (Project -> Run -> Additional Arguments), or if you want to do it programmatically, use qInstallMessageHandler and there save the messages using QSaveFile or QFile.
  • how to detect menu selection /click?

    Unsolved this
    2
    0 Votes
    2 Posts
    432 Views
    Christian EhrlicherC
    A menu has an action (as already told you more than once) so you should look at the signals of QAction and you will find hovered triggered toggled So connect those signals to a slot and you will get notified.
  • WindowTransparentForInput not worked on wayland

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    H
    I can't find other app to get the similar info. and i test this code on ubuntu 22.04 and uos-20, both of them don't work functional. I explore the qtwayland source code(https://code.qt.io/cgit/qt/qtwayland.git), the window set flag by calling mShellSuface->setWindowFlags [image: e9145cd6-b8a8-4a3d-acb6-784cc748aafd.png] and then call set_window_flags on the shell extension. And I find the function set_window_flags on surface-extension.xml , but the function only support three value <enum name="windowflag"> <entry name="OverridesSystemGestures" value="1"/> <entry name="StaysOnTop" value="2"/> <entry name="BypassWindowManager" value="4"/> </enum> <request name="set_window_flags"> <arg name="flags" type="int"/> </request> so, it's qtwayland that dosen't support the WindowTransparentForInput ? am I on the right way? thanks!
  • namespace problems

    Unsolved
    3
    0 Votes
    3 Posts
    573 Views
    enjoysmathE
    @grafenocarbono I've noticed an issue / bug with the Class wizard in Qt Creator / Designer / VS tools for Qt. Basically there's two options: include the MainWindow's auto-generated UI code as a base class and as a member (it's an option in the Class wizard dialog as you create the class). Forgot which one worked for me, but try both, one of them will work! Also, please refrain from the name-calling. We are all muscle men with a moderate enjoyment of the pleasures of geekdom. J/k, I thought it was funny 😂
  • Change focusOutEvent

    Solved
    31
    0 Votes
    31 Posts
    8k Views
    V
    @JonB You won't believe it! I looked at that article from stackoverflow. There, a person wrote that Tab only throws the ShortcutOverride event. I tried to make a check for this event, and then, according to the standard, cast to the QKeyEvent type. And it worked!!! I got the implementation I wanted when I pressed Tab. I want to thank you for spending so much time and effort to help me!
  • Qt6 - Svg file image drawn using delegate paint method has scaling issue

    Unsolved
    1
    0 Votes
    1 Posts
    225 Views
    No one has replied
  • QThread with control flow

    Unsolved
    12
    0 Votes
    12 Posts
    925 Views
    SGaistS
    That library is a tool to implement something. What is that something ? As stated earlier, if we know what you want to achieve, it will be easier to help you either integrate that library in your application or maybe use a different implementation.
  • This topic is deleted!

    Unsolved
    4
    0 Votes
    4 Posts
    11 Views
  • How to locate Qt log files

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    C
    @JacobNovitsky Need to solve my previous topic issue: Then do not start another thread without engaging with the first thread you you started. I want to check Qt Creator log, but could not locate one Qt Creator does not have a log file that is likely to help with your original problem. It does have an internal logging facility that you can see. It is documented and also the first hit on a Google search for me. When Qt Creator builds a project all the compiler and linker output is presented to you in the "Compile Output" tab in the IDE. When Qt Creator runs a project's built executable then all the output that process send to the the standard streams goes either in to the "Application output" tab in the IDE, or into the separate terminal that was launched to start the program. How to locate Qt log files Qt is a library and it does not have a log file. A Qt-based application may use Qt library functions to generate a log file, but that is up to the application.
  • QTopcua missing qfactoryloader files

    Unsolved
    1
    0 Votes
    1 Posts
    182 Views
    No one has replied
  • Cannot write curly braces

    Solved curly braces
    6
    0 Votes
    6 Posts
    3k Views
    defineRazD
    Just pour clean water into the glass, solution: Edit -> Preferences -> Enviroment -> Keyboard -> search for Build keyword and reset all CTRL+ALT+ B key combinations, I know it's an old post but in our home is always a problem(Hungarian keyboard).
  • How to popup a widget when I hover a label?

    Solved
    4
    0 Votes
    4 Posts
    650 Views
    C
    Hi, I made a floating widget a while ago, it's a bit rough on the edges, but it could be helpful to your case. It just needs a parent and a trigger, it'll do the rest on its own. For a QLabel, you could use the linkActivated signal, since I believe clicking is a more controllable trigger compared to hovering, which could be triggered by mistake. But if you're determined on relying on mouse hover, you could use linkHovered instead. Here's an example: #include <QApplication> #include <QSlider> #include <QLabel> #include "mfloatwidget.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); //style the link to make it look like normal text //and provide whatever text for the actual link, it'll be enough to trigger linkActivated QLabel label("<a style=\"color: white; text-decoration:none;\" href=\"someText\">100%</a>"); label.setAlignment(Qt::AlignCenter); MFloatWidget floatingWidget(&label); QSlider slider(Qt::Horizontal); //addWidget is a custom method to add widgets to the floating widget floatingWidget.addWidget(&slider); //clicking the label text will pop up the floating widget which contains the slider label.connect(&label, &QLabel::linkActivated, &floatingWidget, &QWidget::show); label.show(); return a.exec(); } [image: 524e9109-b16b-4124-a763-3c1bd6956906.gif] You can find some explanation about the custom widget on my blog: How to make a floating widget in Qt, and the link to the public repository if this is useful/useable.
  • 0 Votes
    1 Posts
    178 Views
    No one has replied
  • Using QThread::create() from Qt 6+

    Unsolved
    7
    0 Votes
    7 Posts
    897 Views
    JonBJ
    @clhallinan said in Using QThread::create() from Qt 6+: The nature of my app requires configuration before it can be used. Then as @Christian-Ehrlicher has said why do you want to show the main window in any form if the application is not "ready" before the configuration parameters are available? Indeed, it would not surprise me if the main window itself has some dependency on these parameters and so should not be shown yet. Why not get the dialog for configuration shown and deal with (or not) before you even try to show the main window? void main() { QApplication app(); if (!configurationIsComplete()) { configurationDialog.exec(); // handle configuration stuff here or inside `configurationDialog` } QMainWindow mw; mw.show(); return app.exec(); } A lot of beginners seems to rush into threads. They are about the last thing you want to do, not the first. Not to mention Qt's restrictions on secondary threads accessing the UI in any shape or form. I certainly do not see any need/desire for a thread here.