Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Disabled menu item not greyed out

    Unsolved qmenu
    9
    0 Votes
    9 Posts
    1k Views
    SGaistS
    Thanks for the report. You should add which distribution you are using as well as desktop environment (KDE, Gnome, etc.) and window manager (Xorg, Wayland, etc) and their respective versions.
  • Connect to MySQL database outside LAN Qt C++

    Unsolved
    10
    0 Votes
    10 Posts
    478 Views
    artwawA
    @DiogoIDENG if your company allows site2site tunnelling then you can do with pure AWS and OpenVPN on top. If said company lacks in the devops/sysadmin department look for a paid solution. Either way, you can either do split vpn between a vlan or a dedicated subnet or even a host (or a class of hosts but that's a tad more complex) - that's more safe solution; or something less tailored. Also with OpenVPN you can do per machine/client on-demand service, there is also integration between Google security groups and clients AWS side... Lots of free options, lots of paid ones too. All depends what kind of manpower and resources you have to configure it. Once properly done, however, it is rather maintenance free.
  • Qt Creator 14.0

    Solved
    6
    0 Votes
    6 Posts
    599 Views
    posktomtenP
    Now that I switched from Windows 11 to a cloned copy, it works with Qt Creator 14.0.0. No idea why! Must have done something weird during installation.
  • Kit Selection

    Unsolved
    6
    0 Votes
    6 Posts
    961 Views
    Pl45m4P
    @Davey-Crocket said in Kit Selection: I have the same problem "No suitable Kits found" I'm just trying to create my first project type QT for Python and Qt Quick application I've been searching forums for hours but I'm lost :( See here: https://doc.qt.io/qtcreator/creator-python-development.html
  • Touchscreen "HOLD" (long-press) event gets converted to a right-mouse-button press

    Unsolved
    4
    0 Votes
    4 Posts
    605 Views
    Axel SpoerlA
    If memory serves well, this has been a long standing issue since the old days of Qt 4. The underlying problem is that converting touch events into mouse events is a compromise. Making everything work as expected for all touch screen types is like nailing jelly to a tree :-) I that particular case, nobody ever added reproducing steps to the bug report, so it was closed. I remember to have experienced it in Qt5 (probably 5.15.x), but not in Qt 6. Qt 5.14 is really outdated. The only workaround that comes to mind, is to actually implement touch behavior without relying on mouse event translation. That requires specific implementation for each platform, by using native event filters.
  • QtTreePropertyBrowser / Getting mouse double click

    Unsolved
    7
    0 Votes
    7 Posts
    376 Views
    Pl45m4P
    @excelitas_pco Hi, do you inherit from QtTreePropertyBrowserPrivate directly? Might not be the best idea, since your widget depends on that specific Qt version as the internal Qt code may change just like that. Then your widget does not work anymore. The initial mouse double click hits QTreeView and not the widget I've derived from QtTreePropertyBrowser. Events always start at the innermost child widget at that position and then go bottom-up to the topmost. Probably the QTreeView "eats"/accepts the event, so the propagation ends there. If your code was "inpired" by the Qt source you can fix that, if you inherit the Qt private classes directly, you cannot.
  • How to select an ALPN protocol when using QSslSocket (TLS)

    Solved
    3
    0 Votes
    3 Posts
    256 Views
    Linus JahnL
    Ahhh okay, sorry, yeah I read that as "if you host a server, these are the allowed protocols clients can negotiate with it".
  • QSignalTransition setSignal

    Solved
    2
    0 Votes
    2 Posts
    113 Views
    R
    QByteArray sig = QMetaMethod::fromSignal(&MySender::echoStateChange) .methodSignature() .constData(); transition.data()->setSignal(sig);
  • How to make animated backgrounds?

    Unsolved
    24
    1 Votes
    24 Posts
    3k Views
    artwawA
    @Mizmas please check the release version of your program, the debug ones can be laggy for obvious reasons.
  • How to extract characters from QString...?

    Solved
    12
    1 Votes
    12 Posts
    946 Views
    S
    @JoeCFD said in How to extract characters from QString...?: Is it easier to use std::string to handle it and convert it to QString when needed? I had bad experiences with mixing QString and std::string. There have been times (on Windows with MSVC) where some references to std::string could not be found when using QString::toStdString(). Now, we have set the regular C++ locale to be UTF-8 (which means all std::strings are UTF-8). This also means that we need to use QString::fromUtf8(stdstring.c_str()) and qtstring.toUtf8().data() to convert between QString and std::string. (Under some circumstances the conversion from QString to std::string has some weird behaviour because of calling data() on a temporary object. It would be better to store the result of toUtf8() in a QByteArray before.) So, bad experiences with QString::toStdString/fromStdString() together with UTF-8 std::strings tell me it is not easier to go back and forth between std::string and QString. (Also, QString::mid() might have worse performance than QString::midRef(), but certainly better performance than converting back and forth.)
  • QPushButton default windows style sheet

    Solved qpushbutton sty stylesheet windows
    12
    0 Votes
    12 Posts
    10k Views
    Chris KawaC
    To remove stylesheet style simply set an empty string i.e. someWidget->setStyleSheet("border: 1px solid red; background-color: blue;"); // sets a stylesheet someWidget->setStyleSheet({}); // removes a stylesheet
  • which is better, MinGW64 or MSVC 2019 64bit for general use applications.

    Unsolved
    5
    0 Votes
    5 Posts
    835 Views
    S
    I have personally always been using MSVC on Windows and would always pick this as a compiler. The Visual Studio debugger is a lot better than the one built in to Qt Creator (debugging in Qt Creator can be terribly slow on Windows taking several minutes for just a single step). vc_redist can be a little bit annoying. However, when you are using an installer for your software this can be included as a dependency and will be fine. @Blackzero said in which is better, MinGW64 or MSVC 2019 64bit for general use applications.: if I use open source static it is not possible because my goal is for my own small commercial. This is not entirely true. In order to use open source static you need to compile Qt yourself. This is doable. The LGPL requires for the user to be able to relink with a different Qt version. As long as you are willing to provide your objects files (maybe already linked into a static library) together with an explanation of how to link to static Qt libraries, this is also feasible. Even though the LGPL provides these rights to the user, in general it is highly unlikely that anyone will make use of this right. This might be a risk you are willing to take (i.e. the risk that you never have to effectively provide a way for a user to relink with a different static Qt version because noone will ever make use of this right). (I'm not a lawyer; this is not legal advice.)
  • QComboBox/QStyledItemDelegate, Icon Size for selected item.

    Unsolved
    2
    0 Votes
    2 Posts
    222 Views
    P
    Here's an image of what I'm talking about, seem the spam filter doesn't stop it here. [image: d4ca4419-e1a6-497a-9b0b-a34f5e4c4844.png]
  • how to set responsive on large screen resolutions

    Unsolved
    4
    0 Votes
    4 Posts
    198 Views
    Christian EhrlicherC
    So either upgrade to a recent Qt6 version where high-dpi support is highly improved or try to play around with QT_SCALE_FACTOR and Qt::AA_EnableHighDpiScaling: https://doc.qt.io/qt-5/highdpi.html
  • Qt creator Update text file with input data

    Solved
    14
    0 Votes
    14 Posts
    879 Views
    JonBJ
    @Ruben12313 You (attempt to) "truncate" the file you are writing to as you write each line to it! You have a stream named in3 which is only used for output. If there are no lines now in the widget you fail to truncate/clear out any lines which were in the file (e.g. after deleting). Etc. It makes no sense. I leave it to you.
  • 0 Votes
    7 Posts
    353 Views
    JonBJ
    @Torch said in The application crashes after 3 seconds.I'm writing a task manager in qt with a database,.: Adding task: "Task 1" Error adding task: "Parameter count mismatch" Failed to add Task 1 So don't you think this code needs showing?
  • Frameless widget shakes during resizing

    Unsolved qt6 resize frameless c++
    3
    0 Votes
    3 Posts
    751 Views
    D
    I have the same problem, looking for someone to answer it.
  • 0 Votes
    2 Posts
    126 Views
    Axel SpoerlA
    Hi, that's a known issue, related to the touch screen driver for Windows. Not related to Qt.
  • How to fix inconsistent window placement?

    Solved
    3
    0 Votes
    3 Posts
    180 Views
    D
    @mpergand using size() would discard the height of the bottom dock and place the window behind it. However I found the solution to correctly calculate the position by using availableVirtualGeometry(). The returned QRect does take into account the top menu bar height and the calculation basically is now as follows: const auto geom = logWindow->screen()->availableVirtualGeometry(); //qDebug() << "avail virtual geo: " << logWindow->screen()->availableVirtualGeometry(); logWindow->resize(static_cast<int>(std::round(geom.width() * 0.75)), 240); logWindow->show(); logWindow->move(0, geom.height() + geom.y() - logWindow->frameGeometry().height()); This does work on both platforms.
  • This topic is deleted!

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