Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • QNetworkAccessManager with Socks5Proxy with HostNameLookupCapability error

    Unsolved
    9
    0 Votes
    9 Posts
    690 Views
    SGaistS
    Since you already built your own version of Qt, did you try to do it with QSOCKS5SOCKETLAYER_DEBUG defined to get more details about what is happening ?
  • How to get GPS data from serialPort?

    Solved
    3
    0 Votes
    3 Posts
    462 Views
    W
    @jsulm Use Qt5 connect syntax, could get. Thanks!
  • missing libHCI

    Unsolved
    3
    0 Votes
    3 Posts
    229 Views
    C
    The component attempting to use libHCl will probably have either a qmake project file containing something like: ... LIBS += -lHCl ... or a cmake CMakeLists.txt like: ... add_library(HCl ...) ... You can find these fairly easily with grep.
  • Online installer won't "run" on (latest) Ubuntu 22.10

    Unsolved
    6
    0 Votes
    6 Posts
    457 Views
    C
    @AnneRanch said in Online installer won't "run" on (latest) Ubuntu 22.10: Anybody else having SAME issue ? Yes, probably, there is at least one other "developer" out there that cannot manage this. However, most developers can mark a file executable and execute it. $ chmod u+x ~/Downloads/qt-unified-linux-x64-4.4.2-online.run $ ~/Downloads/qt-unified-linux-x64-4.4.2-online.run As usual, you have been given this information before.
  • Error maxsize behavior of QMdiSubwindow

    Unsolved
    2
    0 Votes
    2 Posts
    155 Views
    SGaistS
    Hi and welcome to devnet, Can you show how you setup your QMainWindow ?
  • Make program without .dll

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    P
    @kshegunov windeployqt in Release mode worked flawlessly for me, thanks
  • How to create a window without focus all the time?

    Solved
    2
    0 Votes
    2 Posts
    751 Views
    SamurayHS
    I don't think you can achieve your goal using Qt flags. Since you only want to support Windows, then what you're looking for is WS_EX_NOACTIVATE. Here's a quick example: #include "myvirtualkeyboard.h" #include <Windows.h> MyVirtualKeyboard::MyVirtualKeyboard(QWidget *parent) : QWidget(parent) { // Add WS_EX_NOACTIVATE and WS_EX_TOPMOST to the default extended style HWND hWnd = (HWND)winId(); LONG_PTR exStyle = GetWindowLongPtr(hWnd, GWL_EXSTYLE); SetWindowLongPtr(hWnd, GWL_EXSTYLE, exStyle | WS_EX_NOACTIVATE | WS_EX_TOPMOST); // ... } This will give you the exact behavior of the on-screen keyboard. However, if you want to use this keyboard with other windows in the same process (e.g. same Qt app) too, then you still need an extra step.
  • The program has unexpectedly finished

    Unsolved
    7
    0 Votes
    7 Posts
    414 Views
    JonBJ
    @thomasGl There is no need to be "sorry" :) But you should understand why those variables are uninitialized and why that would cause crashes/undefined behaviour.
  • QEvent to QEnterEvent

    Unsolved
    2
    0 Votes
    2 Posts
    853 Views
    Christian EhrlicherC
    @Roberrt said in QEvent to QEnterEvent: void enterEvent(QEnterEvent *event) override; error: Non-virtual member function marked 'override' hides virtual member function I modified it to: protected: void enterEvent(QEnterEvent *event) override; What did you change? It's both the same InteractiveButtonBase::enterEvent(new QEvent(QEvent::Type::None)); You must not generate such events by yourself - they're created by Qt. If your function needs QEnterEvent you should create an QEnterEvent and not a QEvent.
  • :-1: error: Project ERROR: libbluetooth-dev development package not found

    Unsolved
    3
    0 Votes
    3 Posts
    241 Views
    A
    @ChrisW67 OK, I did try to build and run "scanner" example ( 6.5.0) and got this error :-1: error: Project ERROR: Cannot run compiler 'clang++'. Output: =================== Maybe you forgot to setup the environment? Then I build and run "plain application" - no errors at all. 12:32:57: Running steps for project untitled... 12:32:57: Starting: "/home/q1/Qt/Tools/CMake/bin/cmake" --build /home/q1/Qt/TEST_Programs/build-untitled-Desktop_Qt_5_15_2_GCC_64bit-Debug --target all ninja: no work to do. 12:32:57: The process "/home/q1/Qt/Tools/CMake/bin/cmake" exited normally. 12:32:57: Elapsed time: 00:00. The working code is using "gcc" The "brscanner" (6.5.0 example ) is looking for "clang"": - why ? What "environment" is missing ? I had that error before and never really found out any SPECIFICS about "environment". That error is pretty vague (guess what is missing... ) and not helpful To make a comparison between my code and "small sample program " I need to have this "environment " resolved next. PS How do I set "gcc verbose " option in QT ? .
  • Fixing the ratio of width and height in the QMainWindow Component(PyQt 6.4)

    Unsolved
    1
    0 Votes
    1 Posts
    168 Views
    No one has replied
  • QMdiArea tabs background color to transparent?

    Unsolved
    4
    0 Votes
    4 Posts
    447 Views
    P
    @JonB I think that setting style to the tab actually works. Because doing : tab->setStyleSheet(QString::fromLatin1("QTabBar { background-color: red; }")); Works as expected. The background becomes red. So I think the tab bar background do become transparent with the code I mentioned above. The issue is that the 3DView (ie the mdi content) is not drawn underneath the tab bar, it's drawn next to. So the transparancy only shows the empty 'mainwindow' behind. So I think what I need is to have the QTabBar drawn ON TOP of the Mdi area. See the following drawing to explain, on the left the default behaviour, on the right what I want : [image: a904ac92-12ac-4c60-ab00-2e3c4bc870cc.png] Do you know how I could get the tab bar of the MDI to be drawn on top of the Mdi content?
  • How to apply stylesheet only to parent?

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    JonBJ
    @Roberrt Other than the #objectName selector the only other way I see is the .ClassName one. For that you would need to make your desired target widget(s) be of a derived class named ClassName you would need to create. See https://doc.qt.io/qt-6/stylesheet-syntax.html#selector-types Class Selector .QPushButton Matches instances of QPushButton, but not of its subclasses. This is equivalent to *[class~="QPushButton"]. Having said this: it only talks about not applying to subclasses, not children. So I don't know that this is the right approach. Mind, I do not actually see where the documentation states that #objectName selectors only apply to that widget and not its children, so it's guesswork.
  • Qt 5.14.1 on Linux,Dialog Close Card

    Moved Unsolved linux
    6
    0 Votes
    6 Posts
    816 Views
    J
    @jsulm void MainWindow::on_pushButton_clicked() { TestDialog *test = new TestDialog (); test->setAttribute(Qt::WA_DeleteOnClose); test->show(); } #include "testdialog.h" #include "ui_testdialog.h" TestDialog::TestDialog(QWidget *parent) : QDialog(parent), ui(new Ui::TestDialog) { ui->setupUi(this); connect(ui->pushButton_2,&QPushButton::clicked,this,&TestDialog::pushButton_2_clicked); } TestDialog::~TestDialog() { delete ui; } void TestDialog::closeEvent(QCloseEvent *event) { event->accept(); } void TestDialog::pushButton_2_clicked() { this->close(); } Does qt have requirements for computers? Computers with high configuration will not get stuck.
  • Disable children (shortcuts) of a qmenu

    Unsolved
    2
    0 Votes
    2 Posts
    249 Views
    SGaistS
    Hi, Are these actions associated only to the QMenu ? Can you provide a minimal compilable example that shows this behaviour ?
  • 0 Votes
    2 Posts
    455 Views
    SGaistS
    Hi, AFAIK, no. You should re-implement your purple widget to handle the button as an invisible widget will not resize even if its containing widget does.
  • 0 Votes
    8 Posts
    2k Views
    JoeCFDJ
    saved interface names for these ip adresses and check QNetworkInterface::interfaceFromName(const QString &name).isValid() before any ip address is sent out. the crash seems gone. But no 100% guarantee.
  • QSortFilterProxyModel: Reset model shows ghost items

    Solved qsortfilter qt5
    8
    0 Votes
    8 Posts
    2k Views
    Joel BodenmannJ
    @FPEY said in QSortFilterProxyModel: Reset model shows ghost items: EDIT: Nevermind, my issue was also a stupid mistake: I was simply not calling the function to make the whole reset model stuff when I had multiple lines selected ^^ Glad to hear that you managed to resolve your issue :) I'm not exactly sure where the problem I was facing originated from hence I didn't leave any details as I don't want people to be mislead. This was my first time working with QStandardItemModel. So far I have always implemented models directly by deriving from QAbstractItemModel. When using the QStandardItemModel with the proxy model, the proxy's state was not invalidated when rows were inserted or removed (again, I don't know (yet) why). The quick fix without actually understanding the problem was to invoke the QStandardItemModel::invalidate slot whenever rows were either inserted or removed: connect(m_model, &model::rowsInserted, m_proxy_model, &QSortFilterProxyModel::invalidate); connect(m_model, &model::rowsRemoved, m_proxy_model, &QSortFilterProxyModel::invalidate); Where: m_model is of type QStandardItemModel* m_proxy_model is of type QSortFilterProxyModel*
  • 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
    693 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.