Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • 0 Votes
    4 Posts
    717 Views
    M
    In Qt6, there's no version of setSource() that takes a network request like setMedia() in Qt5. It might work if you add a QUrlQuery to your QUrl; e.g. QMediaPlayer player; QUrl mediaUrl("https://example.com/xxx.mp3"); mediaUrl.setQuery({"uid", "123456"}); player.setSource(mediaUrl); player.play();
  • Pass parent to non-pointer `QObject`-derived members?

    Solved
    6
    0 Votes
    6 Posts
    695 Views
    B
    @Christian-Ehrlicher 's explanation in particular helped me nail what was missing from my understanding but thanks all for your replies. It was all useful discussion.
  • In Q creator how can i compare listwidget index 1 string with string?

    Unsolved
    18
    0 Votes
    18 Posts
    1k Views
    JonBJ
    @Maddy @JonB said in In Q creator how can i compare listwidget index 1 string with string?: Or, pick a number of random words, put them in a QStringList and pass that to void QListWidget::addItems(const QStringList &labels). is the answer. If you already have a QStringList ("the fonts is qstringlist ") then pass that to addItems(). Your earlier ui->listWidget_2->addItems("Task 1(RandomWord):" fonts(x)); passes "Task 1(RandomWord):" fonts(x), which is neither a legal C++ expression, nor if it were would it be a list (QStringList), which is what you say you want to pass and what addItems() accepts. If you say you want to add a list and are going to call addItems() then there is not much point trying to pass it something like a single item....
  • Interconversion of Qt types

    Unsolved
    8
    0 Votes
    8 Posts
    510 Views
    JonBJ
    @Swati777999 l points to an invalid variant. addWidget(QWidget *) will not accept a QVariant *.
  • QTableView Does not work

    Solved
    3
    0 Votes
    3 Posts
    201 Views
    C
    @jsulm said in QTableView Does not work: Your model is a local variable... thank you sir I confused :)
  • QMetaObject::invokeMethod call QML method from C++, with more than 10 arguments

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    S
    @Developer123 said in QMetaObject::invokeMethod call QML method from C++, with more than 10 arguments: I wish QT was simpler... Well, language interoperability (and C++ and QML are two different languages) is usually complicated at first. Once you have figured out how to interoperate it'll get a lot easier.
  • Building ibase sqldriver for Qt 6 on mac can’t find qconfig.h

    Unsolved
    4
    0 Votes
    4 Posts
    383 Views
    hskoglundH
    Or use Firebird's ODBC driver...
  • 0 Votes
    1 Posts
    435 Views
    No one has replied
  • Missing bluez and bluetooth dev package ?

    Unsolved
    15
    0 Votes
    15 Posts
    2k Views
    C
    @AnneRanch said in Missing bluez and bluetooth dev package ?: Sorry - I do not have a "small program" and logically if I run a small program and I get SAME error it is pretty much futile step backwards. And it it works (without an error ) - how will it help me to solve my problem? This exercise of creating a small program that reproduces the problem helps because: It forces you remove any extra stuff that may be confusing the situation and distill the problem down to essential components. It may well result in you stumbling across exactly what was causing the problem. If it does not result in you identifying the problem, then it is something you can share with us so that we have some visibility of exactly what you are doing. I asked for something that does not work. If you are unable to reproduce the failure then the difference between the minimal, working program and the current failing situation contains the answer you seek.
  • QTextCursor position at any line and column

    Solved
    3
    0 Votes
    3 Posts
    466 Views
    0
    @JonB Well, seems like i need to go a little deeper and write my own widget. Thank you very much for explanation and example links, appreciate it!
  • Qt5. VERSION of lib

    Unsolved
    6
    0 Votes
    6 Posts
    585 Views
    SGaistS
    Hi, A simple and clean way to do it is to use QMAKE_SUBSTITUTES. See a complete example here.
  • 0 Votes
    6 Posts
    419 Views
    ?
    @Chris-Kawa I followed your advice and implemented both resizeEvent and showEvent. It worked as you said. Thanks for helping me understand Qt more.
  • my application doesnt work:( can you help me to understand why?

    Unsolved c++ command usb terminal
    14
    0 Votes
    14 Posts
    1k Views
    JonBJ
    @RuWex Please look at the QTimer documentation, and the examples there. This does not work by "inserting a delay" into the code where it is called. Rather, it sets off a timer which keeps running, and you supply a "slot"/"callback" which will be invoked when the timer expires. It is in that function/lambda that you do whatever work you wish to perform each time the repeating or singleshot timer expires, e.g. in your case maybe it sends the next character.
  • How to read a field from HTML Code.

    Unsolved
    3
    0 Votes
    3 Posts
    236 Views
    E
    @Pl45m4 thanks a lot!
  • No such plugin:"peakcan" on Raspi

    Solved
    15
    0 Votes
    15 Posts
    940 Views
    jsulmJ
    @y-exars said in No such plugin:"peakcan" on Raspi: doesn't install qtserialbus plugins ?? No libqt5serialbus5-plugins does
  • libGL error occurs when QWebEngineView App runs on ubuntu22.04

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    jsulmJ
    @gaojinhsu I don't use Parallels, but in VMWare there is a way to install VMWare specific drivers in the guest OS. Check whether you can do the same in Parallels.
  • 0 Votes
    6 Posts
    659 Views
    A
    @Samuel-Lourenco said in How to cause a modeless dialog to block input only to his direct parent (but not to any other windows), as if it was modal?: Thanks! However, wouldn't that gray out the parent window? It is kind of what I want, but the disabled aspect, even if only momentarily, may send the wrong message to the user. I don't believe "enabled" has visual cues, but that might depend on the platform. However, if memory serves, the enabled property propagates to children. So if the progress dialog is a child of the device window, disabling the device window would also block input into the progress dialog itself (e.g. to a "cancel" button) EDIT: That said, the "enabled" flag (on the platform side) is what modal dialogs (at least on the Windows platform) actually use to disable UI input to all other windows.
  • How to change the text color of a specific row in a QTreeWidget?

    Unsolved
    4
    0 Votes
    4 Posts
    295 Views
    jsulmJ
    @n34rt Depends on what is in the cell, see https://doc.qt.io/qt-6/qtreewidgetitem.html#foreground Why don't you simply try it out to see whether it does what you want?
  • How to color any row of Qtablewidget if cell (row, 1) have text (Total) ?

    Unsolved
    5
    0 Votes
    5 Posts
    301 Views
    JonBJ
    @ChrisW67 said in How to color any row of Qtablewidget if cell (row, 1) have text (Total) ?: It is a QTableView that underlies a QTableWidget Whoops, corrected :)
  • Deleting file after creating QPixmap

    Solved
    4
    0 Votes
    4 Posts
    322 Views
    A
    @SGaist I'm making a pet project with PyQt5. It's messenger. I would like users avatar images to be stored at server storage and loaded from there by client. My idea was to load all images, make qpixelmaps with them and delete image files by no need. So I was wondering will the pixelmap work properly after theese manipulation. But now I realised, that I shouldn't delete all images, but store them as cache.