Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Is the following assignment operation on a QByteArray reference safe?

    Solved
    3
    0 Votes
    3 Posts
    357 Views
    S
    @Christian-Ehrlicher I incorrectly assumed that QByteArray would always create a deep copy of the data which was not true for QByteArray::fromRawData (documented behaviour, that I didn't read). So just wanted to confirm if this would behave as intended.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • QChronoTimer doesn't work as expected

    Unsolved
    4
    0 Votes
    4 Posts
    619 Views
    C
    @Christian-Ehrlicher said in QChronoTimer doesn't work as expected: /edit: Looks like it's a windows only issue which will be fixed in the near future. Good, so I am not going mad then :)
  • Add New Localisation Language to Qt6

    Unsolved
    2
    0 Votes
    2 Posts
    198 Views
    No one has replied
  • How to receive mouse events for QDoubleSpinBox

    Solved
    23
    0 Votes
    23 Posts
    3k Views
    S
    @JonB Oops! My Bad :) The solution worked. Thank you for your patience.
  • Label cut off

    Unsolved
    1
    0 Votes
    1 Posts
    182 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • Trouble creating QMYSQL plugin for macOs.

    Solved
    3
    0 Votes
    3 Posts
    370 Views
    H
    @hskoglund -DCMAKE_OSX_ARCHITECTURES="arm64" did not work; the additional command in your post fixed the issue. Thank you.
  • Touchscreen not working with any Qt based application. But it works fine with GTK ones.

    Unsolved
    4
    0 Votes
    4 Posts
    303 Views
    I
    @Asperamanca I have set that flag in QML. But even if that was the only problem in my case, I don't understand why Qt based apps don't even register taps as clicks by default like GTK does. Here's the code for my simple app. import QtQuick import QtQuick.Window import QtQuick.Controls import QtQuick.Dialogs Window { width: 640 height: 480 visible: true title: qsTr("Hello World") flags: Qt.WA_AcceptTouchEvents Rectangle { id: button signal clicked property alias text: buttonLabel.text height: 50 width: 150 radius: 3 color: "gray" TapHandler { id: tapHandler onTapped: console.log("clicked2") } MouseArea { anchors.fill: parent onClicked: console.log("clicked") } Text { id: buttonLabel text: "Click Me" color: palette.buttonText anchors.centerIn: parent } } }
  • QSslKey: Unsupported encryption cipher OID: "2.16.840.1.101.3.4.1.42"

    Unsolved
    3
    0 Votes
    3 Posts
    250 Views
    C
    You really should check that your various QFile open calls succeeded. QSslKey may be the one complaining, but your certificates may be null.
  • Could Someone Give me Advice on Optimizing QTableView with Large Data Sets?

    Unsolved
    3
    0 Votes
    3 Posts
    501 Views
    S
    One million rows is nothing, but the trick is of course to have a data model that is well suited for it. In my system where I'm throwing hundreds of thousands to millions rows of data at a QTableView I have: Data that has been organized for quick loading ahead of time System that provides quick access to data without creating objects or having allocate stuff with new. Basically the data is split into chunks that are stored on disk. Each chunk is then memory mapped and each chunk contains "records". Since the records can have variable size each data chunk has a header and and offset table which stores a starting offset for reach record in the data part of the chunk. (You can think of this as a jump table) So when a QTableView needs to display any particular row it all essentially boils down to taking a base pointer to a chunk of data and then reading data at offsets relative to the base pointer. The system is extremely fast.
  • Qt6 upload multiple files

    Unsolved
    7
    0 Votes
    7 Posts
    487 Views
    Christian EhrlicherC
    @jennif56 said in Qt6 upload multiple files: is always the last one in the loop ("C:\notice_lego\4656079.pdf") What do you expect? Since QNetworkManager is async your loop is already done when the download of the first item finished. QNetworkAccessManager* man = new QNetworkAccessManager( this ); You create a new QNetworkManager here in every call ... connect(man, SIGNAL(finished(QNetworkReply*)), this, SLOT(reply(QNetworkReply*))); Please use the pmf style syntax for connects as shown in the documentation. And while you're at it you can pass the filename in a lambda void MainWindow::getPdf(const QUrl &url, const QString &filename) { auto rpl = man->get(QNetworkRequest(url)); connect(reply , &QNetworkReply::finished, this, [this, rpl, filename]() { reply(rpl, filename); }); }
  • Subclassing QFileDialog

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    JonBJ
    @RoXus said in Subclassing QFileDialog: itm_open = layg.itemAtPosition(2, 2) itm_open.widget().accepted.connect(self.accept_button) Just an observation. For you or anyone else reading this, obviously this relies on the dialog having a QGridLayout and the desired button being positioned in cell (2, 2). Probably a more robust approach is to find the QDialogButtonBox, or better the actual button. From Python you can start from box = self.findChild(QDialogButtonBox) # or buttons = self.findChildren(QPushButton) Look at the docs for these, you can e.g. add the objectName() if you know what it is for the button you want, or similar.
  • Qt5.15.2 vs2019_64 I get a crash from QTreeWidgetItemWidget

    Unsolved
    5
    0 Votes
    5 Posts
    289 Views
    jsulmJ
    @Qtwbj Without more information nobody will be able to say why it is crashing. Show relevant code (how you're handling BaseItemWidget). Maybe a double delete? And what kind of crash is that? SIGSEGV or something else?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • 0 Votes
    3 Posts
    521 Views
    H
    @jsulm I'm sorry, I wrote it wrong. I meant to say that it changes depending on Windows theme. (if qt creator Windows theme is light) & (if qt creator Windows theme is dark)
  • 0 Votes
    2 Posts
    419 Views
    C
    Does this summarise the problem? Load web page in your application. Page displays correctly Wait until machine sleeps Wake machine Page no longer displays in your application but remainder of screen is fine. What platform? What Qt version? What web site? What features is it using? What does reloading the web page every three seconds have to do with it? What was this supposed to do? What did it do? What else have you done to try to repair this? Are all your drivers, especially video, up to date?
  • Making the QMenu Background Curved in Qt

    Unsolved
    8
    0 Votes
    8 Posts
    755 Views
    C
    @FDK2077 Applying your style sheet to a basic application template results in multiple warnings in the applications console output: Unknown property border_radius Unknown property border_radius Unknown property border_radius Fixing that would be the first step The border of the QMenu is indeed styled correctly as you can see here: [image: d5157e89-cc19-464c-bf8d-eccaeab28c58.png] The border is a line around the edge of the style box. The background fills the same style box. There is a background-clip property but its documentation does not indicate support by QMenu. The QMenu border does not clip or contain the background (it does work as advertised on supported widgets).
  • Use of QML files in projects' previous folder fails in Windows using MSVC

    Unsolved
    5
    0 Votes
    5 Posts
    392 Views
    R
    I am doing that to create an alias for resources, and try to workaround this issue. Even without that, the build fails. The thing is, the same project builds fine in Linux.
  • Why does my application require libQt6OpenGLWidgets.so

    Unsolved
    11
    0 Votes
    11 Posts
    710 Views
    SGaistS
    Simply because Qt Charts makes use of both unless built without OpenGL support.