Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.3k Topics 456.0k Posts
  • QProcess starting on macos only when run from terminal

    Solved
    10
    0 Votes
    10 Posts
    181 Views
    SGaistS
    One other possible option that might also make your users happy: have a setting in your application that allows to set the path to ffmpeg so if they have a custom version they want to use, they can change for it. You can populate that value checking for known paths.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • How to create a TableView in QML

    Unsolved
    2
    0 Votes
    2 Posts
    64 Views
    A
    in fact you need two structures : one core structure containing all the data, called the model, and a UI component displaying the data from the model. It is bit more complex and time consuming to setup than an excel/libreoffice spreadsheet, but much more lightweight and offers you more control and more protection on how data are displayed or edited, which cells are editable. creating a view in TableView { id: tableView anchors.fill: parent // or whatever anchoring/positionning/layout you want model: yourTableModel // should be declared nearby } Please note that TableView on it's own doesn't provide horizontal and vertical headers, you have to add VerticalHeaderView and HorizontalHeaderView manually. https://doc.qt.io/qt-6/qml-qtquick-controls-verticalheaderview.html for the model, you have two options : either you subclass QAbstractTableModel, adding a QML_ELEMENT macro after Q_OBJECT, and declaring those source files in a qt_add_qml_module directive in CMakeLists.txt The TableView documentation provides a minimal example of a model that can be used in a QML view : https://doc.qt.io/qt-6/qml-qtquick-tableview.html or you can use the ListModel QML element if your model isn't much complex. Option one is usually advised for production. Option two is often used by UI dev to supply a sample model to work on the view itself.
  • How to get Qt5.15 on Windows ?

    Unsolved compile qt5.15.2 windows10
    6
    0 Votes
    6 Posts
    2k Views
    S
    https://download.qt.io/official_releases/qt/
  • Strange QSettings issue with Qt6 on Jenkins

    Unsolved
    4
    0 Votes
    4 Posts
    88 Views
    SGaistS
    Hi, In addition to the questions of my fellows, one thing to consider for the tests is to write the file to a known read/write path rather than relying on system defaults.
  • Create signal with / from stdin

    Unsolved
    11
    0 Votes
    11 Posts
    3k Views
    T
    The fact that Qt does not implement a direct method to generate QIODevice-like signals for stdin implies that doing so is difficult or impossible. The problem with using a separate QThread in the child to generate signals by blocking on sys.stdin.readline() is getting that QThread to exit. QThread.terminate() does not terminate that QThread until a line of input is received. All related answers ignore this problem. I was able to workaround this by having the parent process feeding the child's stdin send "exit\n", and have the child's stdin-reading QThread detect that line and call its QThread.exit().
  • Problem with connect invocation

    Solved
    3
    0 Votes
    3 Posts
    72 Views
    PerdrixP
    @SGaist Thank you! This seems to work (well at least it compiles)! auto deepSkyStacker = DeepSkyStacker::instance(); connect(ui->help, &QLabel::linkActivated, deepSkyStacker, [=]() { deepSkyStacker->help(); }); David
  • How to disable linking with Qt6EntryPoint in Visual Studio?

    Unsolved
    4
    0 Votes
    4 Posts
    484 Views
    A
    I'm resurrecting this because I am facing the same issue. We are looking at Qt as a migration option from MFC (one of several). So I have VS Tools added to Visual Studio 2022. I have manually added the Qt "bits" to the relevant project file but I can't find a way of successfully adding this in to the Qt settings part for the project: CONFIG -= entrypoint I tried passing it on to qmake in the "Additional Command Arguments" but to no avail. There appears to be lots of things I could do with the "Qt Project Settings" within Visual Studio but if there's any documentation on this, I can't find it. TIA
  • Undefined symbol when trying to load a Wayland custom shell extension client plugin

    Solved
    9
    0 Votes
    9 Posts
    249 Views
    B
    @Christian-Ehrlicher said in Undefined symbol when trying to load a Wayland custom shell extension client plugin: Simply leave it empty so CMake will auto-determine the needed compilers. Yeah, if it's omitted it will default to C and CXX. The custom shell example has LANGUAGES CXX but that still works for the example.
  • What is the best way to bypass PATH_MAX (on Linux)?

    Unsolved
    6
    0 Votes
    6 Posts
    144 Views
    RokeJulianLockhartR
    @Kent-Dorfman, yeah, it would be if these were part of a program. However, these are my own files manually-created files in my own data drive. Being able to manage them in a Qt-based file manager (like KDE's Dolphin) would be useful. A human can't feasibly interface with a database for every file transfer, and I don't want to fork Dolphin to add something so niche to it just for me, since that really wouldn't help anyone else.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • Accessibility for Custom Painted Items

    Unsolved accessibility screen reader focus issue
    1
    0 Votes
    1 Posts
    52 Views
    No one has replied
  • Issue in qvulkanwindow.cpp ?

    Unsolved
    6
    0 Votes
    6 Posts
    230 Views
    SGaistS
    You should check the bug report system to see if it's something known and if not, please open a ticket providing minimal compilable example that triggers the crash.
  • Specifying Color for progress bar in QProgressBar

    Unsolved
    5
    0 Votes
    5 Posts
    5k Views
    R
    I know I'm late the the game on this particular request, but I recently had the same need and found what I think is a better and easier solution. In particular, I liked the look of the base style and only wanted the color of the chunk, and for light colored chunks, have a dark text over it. The general principle is to make a copy of the QPalette for the QProgressBar in question. Then change QPalette::Highlight role color and the QPalette::HighlightText role based on the parameter being displayed in the copy and then assign the QPalette to the QProgressBar. Do this in the valueChanged(int) slot. In my example, I was assessing a motor speed. void MainWindow::on_TachometerBar_valueChanged(int value) { static QPalette p(ui->TachometerBar->palette()); //Static used here to only initialize once if (value < 600) { p.setColor(QPalette::Highlight, Qt::yellow); p.setColor(QPalette::HighlightedText, Qt::black); } else if (value < 1800) { p.setColor(QPalette::Highlight, Qt::darkGreen); p.setColor(QPalette::HighlightedText, Qt::white); } else if (value < 2000) { p.setColor(QPalette::Highlight, Qt::yellow); p.setColor(QPalette::HighlightedText, Qt::black); } else { p.setColor(QPalette::Highlight, Qt::red); p.setColor(QPalette::HighlightedText, Qt::white); } ui->TachometerBar->setPalette(p); } [image: 2a253b91-3d26-4d73-854c-af80d74579ee.png] [image: fffdcb68-1aa0-4487-8470-bcc6f6d706ba.png] [image: 0dc7e0c5-5377-4c7c-bc57-a883b7399bb8.png] [image: f31e6199-cbbe-4eec-8e87-e55a44b3e19e.png]
  • Dependent (that clearly exists) does not exist error when building Qt Creator project

    Unsolved
    24
    1 Votes
    24 Posts
    13k Views
    H
    @saurabhjadhav1911 Amazing! It works. Thank you very much!! But why?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • QWidget::mousePressEvent() fail to capture the left click event

    Unsolved
    4
    0 Votes
    4 Posts
    65 Views
    W
    @Pl45m4 Oh okay. I will have a look at the other part of the code. Do you know why the left click can be detected within the eventfilter? Does it mean that the event captured by eventfilter would be the higher priority?
  • Trying to use AddressSanitizer with Qt on Windows

    Unsolved
    13
    0 Votes
    13 Posts
    246 Views
    J
    There are lots of differences in the command line options between VS and Qt. Basic project in both cases is the default GUI application. Qt: -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -fsanitize=address -Zi -MDd -std:c++17 -utf-8 -W3 -w34100 -w34189 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\asan_test.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\..\dev\asan_test -I. -I..\..\Qt\6.9.0\msvc2022_64\include -I..\..\Qt\6.9.0\msvc2022_64\include\QtWidgets -I..\..\Qt\6.9.0\msvc2022_64\include\QtGui -I..\..\Qt\6.9.0\msvc2022_64\include\QtCore -Idebug -I. -I/include -I..\..\Qt\6.9.0\msvc2022_64\mkspecs\win32-msvc -Fodebug\ @C:\Users\jazzco\AppData\Local\Temp\main.obj.18184.15.jom VS: /JMC /permissive- /ifcOutput "WindowsASanTest\x64\Debug\" /GS /W3 /Zc:wchar_t /Zi /Gm- /Od /sdl /Fd"WindowsASanTest\x64\Debug\vc143.pdb" /Zc:inline /fp:precise /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /fsanitize=address /WX- /Zc:forScope /RTC1 /Gd /MDd /FC /Fa"WindowsASanTest\x64\Debug\" /EHsc /nologo /Fo"WindowsASanTest\x64\Debug\" /Fp"WindowsASanTest\x64\Debug\WindowsASanTest.pch" /diagnostics:column The options differ in VS are: /JMC = Just My Code /WX- = Treat Warnings as Errors OFF /sdl = Enables recommended Security Development Lifecycle /Od = disable optimization /D <> = define constant/macro /Gm- = disable miminal build (deprecated) /RTC1 = Enable fast runtime checks /GS = Checks buffer security /fp:precise = "precise" floating-point model; results are predictable. /Zc:forScope = Enforce Standard C++ for scoping rules (on by default). /Fo<> = Creates an object file. /external:W3 = Set warning level for external headers. /Gd = Uses the __cdecl calling convention. (x86 only) /TP = Specifies all source files are C++. /FC = Displays the full path of source code files passed to cl.exe in diagnostic text. /errorReport = deprecated I added several options to Qt, like -JMC -GS -sdl -RTC1 to get it up but the process still crashes in debug mode at the same spot even with a clean default project without the faulty source code. In release mode it works but doesn't recognize the malicious code. EDIT: fixed wrong VS command line
  • 0 Votes
    13 Posts
    270 Views
    Axel SpoerlA
    Looks like the bug doesn't reproduce anymore.
  • Qt and Apple 'Glass' UI in macOS 26

    Unsolved
    10
    1 Votes
    10 Posts
    724 Views
    AndyBriceA
    @Tor-Arne said in Qt and Apple 'Glass' UI in macOS 26: That depends on how easy it is for us to provide that look via the built in styles, which we are still researching. I hope you will be able to come up with something. Where will decisions on this be announced?