Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • How to map a ui->Widget to PaintEvent

    Solved
    2
    0 Votes
    2 Posts
    165 Views
    SGaistS
    Hi, You can't. If you want to do custom painting, you need to subclass. You can then use the promote feature of designer to use your subclass.
  • QODBC3 driver not loaded

    Unsolved
    3
    0 Votes
    3 Posts
    714 Views
    hskoglundH
    Hi, are you sure you're installing on your Raspberry and not on a PC? On my Raspberry, unixODBC gets installed in /usr/lib/arm-linux-gnueabihf not in /usr/lib/i386-linux-gnu (for example the libodbc.so.2 dll needed by Qt5's libqsqlodbc.so is in the /usr/lib/arm-linux-gnueabihf directory) Also, to build the libqsqlodbc.so ODBC3 driver you need to download Qt5 source files (that matches the version of Qt5 you have installed). More here
  • QtWebEngine and QtWebChannel deployment issue

    Unsolved
    4
    0 Votes
    4 Posts
    551 Views
    KH-219DesignK
    I have seen others mention on various forum threads that they point --qmldir to the root of where the entire Qt QML distribution exists, as in: --qmldir C:\destination\dl_third_party\Qt_desktop\5.14.0\msvc2017_64\qml This has the side-effect (which can be "good" or "bad" depending on your opinion) of shipping ALL of Qt's QML into your deployed app (even parts of the Qt QML distro that your app does not need). As I understand it, this "kitchen sink" approach bypasses whatever issue is preventing windeployqt from properly analyzing your app for its minimum needed amount of Qt QML. We bypass the problem by just deploying all QML known to humankind, essentially.
  • Updating c++ data in Qml

    Solved
    46
    0 Votes
    46 Posts
    7k Views
    J.HilkJ
    @dziko147 WUHUH congrats! If you would be so kind and use the topic tool button and set the topic to solved :D
  • Add DLL paths at runtime

    Unsolved cmake dll windows
    4
    0 Votes
    4 Posts
    4k Views
    hskoglundH
    Do you mean how to add paths so that your .exe files can be run from Qt Creator, or adding paths so that your .exe files can be run without Qt Creator? In the first case (starting .exe files from Qt Creator) as long as you only have a single version of Qt installed on your PC, there should be no need to add any paths, as I said earlier, Qt Creator adds the path to the Qt dlls for you. In the second case (starting .exe files without Qt Creator) then there are 2 ways to do it: copy the Qt dlls to the same directory that your .exe file is in, either manually or by using the windeployqt.exe program adding the path to the Qt dlls to the PATH env. variable Note: LIBS += -LMyPath has no effect on runtime lookup of .dlls or .so files QMAKE_RPATHDIR has no effect on Windows, because Windows does not support adding a list of paths to your .exe/elf file where to find the Qt dlls/so files (works only on Linux and MacOS) Also on Linux, QMAKE_RPATHDIR is not needed for the first case (starting .exe/elf files from Qt Creator) since Qt Creator does that automatically for you (by issuing a linker command e.g. -Wl,-rpath,/home/user/Qt/5.15.2/gcc_64/lib)
  • BUG or feature ?

    Unsolved
    12
    0 Votes
    12 Posts
    729 Views
    KroMignonK
    @AnneRanch said in BUG or feature ?: Are you saying that "item" as in "addItem" works differently when "item" is QString ? Yes, and it is documented, if you have read the link given by @ChrisW67 void QListWidget::addItem(QListWidgetItem *item) Warning: A QListWidgetItem can only be added to a QListWidget once. Adding the same QListWidgetItem multiple times to a QListWidget will result in undefined behavior.
  • Display issue with Qt application windows over SSH/X11

    Unsolved
    4
    0 Votes
    4 Posts
    7k Views
    Y
    This is the first place where Google gets me, when I was trying to find a solution for the issue I had, which was: Qt: QOpenGLWidget: Failed to make context current composeAndFlush: makeCurrent() failed when I used a Qt application over WSL2 with X11 forwarding to my Windows host with VcXsrv. I understand this topic/question is old, but It would save me Googling time if someone described here a similar problem as I had. What I did wrong in my case was setting LIBGL_ALWAYS_INDIRECT env variable (it was set to 1). As suggested in this Stackoverflow post - unset it, and unset the "Native opengl" checkbox in VcXsrv XLaunch UI, and that fixes the runtime: export LIBGL_ALWAYS_INDIRECT= I'm on latest Windows 11 Preview with VcXsrv 1.20.9 + Ubuntu 20.04 over WSL2 with Qt 5.15.2. My Qt Application also sets: QGuiApplication::setAttribute(Qt::AA_UseDesktopOpenGL); QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
  • Change the colors of tabs without using StyleSheets

    Solved
    11
    0 Votes
    11 Posts
    748 Views
    L
    @leinad said in Change the colors of tabs without using StyleSheets: direct base 'QObject' is inaccessible dur to ambiguity Yes, that was the original code but I still got no such slot. I got around it by using eventFilters which basically does the same thing. Thanks.
  • Resizing parent QLayout, and resizing QForm widget rows

    Unsolved
    5
    0 Votes
    5 Posts
    258 Views
    C
    To resolve it, I used a gridLayout as the parent widget, then I set the scrollArea widget to be resizable(True)[image: 910f10ef-6155-41e1-aec9-a60a6b11002a.JPG] This makes everywhere in the gbox which I set as the scrollArea widget to be resizable. I ensured the other widgets are coded inside. I set the first layout, vbox to the gbox
  • How to save double value as 0.0 instead of 0 from QJsonDocument to a file

    Unsolved
    2
    0 Votes
    2 Posts
    124 Views
    JonBJ
    @niks_entire You cannot do this. Unless you save it as a string, "0.0", but that's a different data type. JSON has only one numerical type, "number". This covers integers and floating point. You cannot control how it outputs the number. 0 will be its representation for the number with value zero, you cannot make it output 0.0 for a number.
  • multi_device_qt.exe crashed during run qt project

    Unsolved
    2
    0 Votes
    2 Posts
    129 Views
    jsulmJ
    @kamlesh-sim Please use debugger to see what happens. You will have a stack trace after the crash which should give you hints about the reason for the crash.
  • This topic is deleted!

    Solved
    14
    0 Votes
    14 Posts
    481 Views
  • QLabel scaling issue

    Unsolved
    10
    0 Votes
    10 Posts
    860 Views
    S
    @mrjj Thanks :) I tried running app with -platform windows: dpiawareness = 0 and tried setting the follwoing in the main.cpp QApplication :: setAttribute ( Qt::AA_DisableHighDpiScaling); None of them seemed working. If I change enlarge the screen from 100% to 125% , some labels and widgets parts are being cutoff. I also tried running the app on Win10 but the issue is same.
  • QGradient showing invalid color?

    Unsolved
    6
    0 Votes
    6 Posts
    700 Views
    CJhaC
    @mrjj Hi, even if I do void GuiStyle::drawControl(QStyle::ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const { if(element == QStyle::CE_PushButton) { const QStyleOptionButton* comboOption = qstyleoption_cast<const QStyleOptionButton*>(option); QStyleOptionButton newComboOption = *comboOption; QBrush nBrush(Qt::green, Qt::DiagCrossPattern); qDebug() << nBrush; newComboOption.palette.setBrush(QPalette::Button, nBrush); QProxyStyle::drawControl(element, &newComboOption, painter, widget); } else { QProxyStyle::drawControl(element, option, painter, widget); } } The color of the button appears as Qt::green without any pattern. Can it point to something I am missing in my Qt installation?
  • CMake configuration error "Current configuration mixes up CLang and MSVC"

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    VRoninV
    @jsulm said in CMake configuration error "Current configuration mixes up CLang and MSVC": And you did not say how you're calling CMake... This is crucial, you probably just need to specify the correct generator. In any case it looks like your PATH is well polluted which is never great
  • The SVN Path

    Unsolved
    2
    0 Votes
    2 Posts
    161 Views
    mrjjM
    Hi and welcome to the forums Im not sure what information you are trying to get from the SVN server but Qt cannot really do that for you. you have to use the API. https://subversion.apache.org/docs/ You could run the svn client via QProcess to make it do things on your behalf.
  • QFileInfo::birthTime not updated each time?

    Unsolved
    2
    0 Votes
    2 Posts
    454 Views
    KroMignonK
    @Maluna34 said in QFileInfo::birthTime not updated each time?: Do you have any idea? Did you notice that file always have same creation timestamp? I am quiet sure, this is because you are always recreating the same file, and the file system layer of your OS is optimizing it, to avoid to always create a new file descriptor. Nothing to do with Qt, it is system relevant.
  • Direct connect a built-in signal from one class to a slot on another class

    Unsolved
    23
    0 Votes
    23 Posts
    5k Views
    H
    @SGaist said in Direct connect a built-in signal from one class to a slot on another class: Hi, That's exactly the point of @JonB, there's no reason to remove the ui-> from your code. Got it and thank you for pointing it out.
  • 0 Votes
    2 Posts
    746 Views
    ademmlerA
    @kitekat I try to run your example - but my texture stays dark. I have applied my own image. Have you ever git it working?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied