Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.9k Posts
  • Reporting inappropriate content on the forums

    Pinned Locked spam
    29
    4 Votes
    29 Posts
    36k Views
    A
    Thank you for the report. I have banned the user, which got rid of the spam posting. Not a loss, as this user did not post any other content on the site. Just deleting this one posting was not possible. Thanks for reporting this.
  • My built and deployed Qt application does not start.

    Unsolved
    5
    0 Votes
    5 Posts
    129 Views
    JKSHJ
    @Bonnie said in My built and deployed Qt application does not start.: this line is the problem qt_policy(SET QTP0001 NEW) I don't know why but it seems to disable the qrc system and make the qml can't be read by the application. That policy doesn't disable the qrc system. Rather, it puts QML modules under a new standard location (described at https://www.qt.io/blog/whats-new-for-qml-modules-in-6.5 ) @k_miya said in My built and deployed Qt application does not start.: const QUrl url(u"qrc:/QmlCppExample/main.qml"_qs); With the QTP0001 policy, the URL is now qrc:/qt/qml/QmlCppExample/main.qml. a warning message appeared, so I added this line to CMakeLists.txt to suppress it. I will comment out the relevant section in CMakeLists.txt and try building and deploying. The current recommended approach is: Change qt_standard_project_setup() to qt_standard_project_setup(6.5) (this has the same effect as writing "qt_policy(SET QTP0001 NEW)") Rename the file from main.qml to Main.qml ('m' -> 'M') Replace engine.load(url); with engine.loadFromModule("QmlCppExample", "Main"); (so that you only need to know the module name, you don't need to know the URL)
  • 0 Votes
    2 Posts
    37 Views
    JKSHJ
    Hi @jason1122, and welcome! Do you still see the memory leak with Qt 6.10.0?
  • Can not upload files to QT Forum

    Solved
    8
    1 Votes
    8 Posts
    170 Views
    A
    I copy pasted it.
  • Create a secure Grpc Channel without specifying certificates

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    J
    @talksik Thanks for that answer. I spent a few hours trying to figure out why my QGrpc client wouldn't connect using SSL. Calling the below on my SSLConfiguration fixed it. setAllowedNextProtocols({ "h2" }). I agree the documentation isn't great for this, which is a shame.
  • how to add description properties

    Unsolved
    9
    0 Votes
    9 Posts
    629 Views
    T
    @hskoglund I just tried using these 2 in our .pro file . The Qt Creator editor didnt recognize them (not color coded like other keywords in the pro file) and when I built the copyright was still not in the exe details. Did these show up in a Qt 6. version or were they available in Qt 5.12.11 (what we're currently on) Google said they should be available in 5 though.
  • Output message from Qt 6.10.0 when debugging code

    Unsolved
    3
    0 Votes
    3 Posts
    49 Views
    PerdrixP
    Application is a standard widgets application using QMainWindow. Windows 11, 1 screen.
  • QAbstractListModel with base and derived class

    Solved
    5
    0 Votes
    5 Posts
    76 Views
    JonBJ
    @Redman said in QAbstractListModel with base and derived class: I do not see the benefit here. Please elaborate. To me it looks the same, just switched positions of A and B property lookup. 100% yes. And as I wrote as a consequence: This would avoid doing two data lookups and would allow for a genuine null value in either case. So two benefits :)
  • QT5.9 Dialog stays on all workspace

    Unsolved
    5
    0 Votes
    5 Posts
    96 Views
    F
    @jsulm The problem was solved, I mainly want to know the reason. Thank you~~
  • Nested ScrollView

    Unsolved
    2
    0 Votes
    2 Posts
    76 Views
    Ronel_qtmasterR
    @nilsl Your code is a bit wrong. As you want to implement Nested ScrollView, the second scrollview shouldn't be inside ListView's delegate. It has nothing to do with the Listview ,nor it's delegate. In fact Listview itself has scrolling behaviour.Try something like this import QtQuick 6.0 import QtQuick.Controls 6.0 ApplicationWindow { visible: true width: 640 height: 480 title: "Nested ScrollView Example" // Outer ScrollView for vertical scrolling ScrollView { anchors.fill: parent clip: true contentHeight: column.height Column { id: column width: parent.width // Example content for the outer scroll view Rectangle { width: parent.width height: 200 color: "lightgray" Text { text: "Outer Scrollable Content" anchors.centerIn: parent } } Rectangle { width: parent.width height: 100 color: "lightblue" Text { text: "More Outer Content" anchors.centerIn: parent } } // Inner ScrollView for horizontal scrolling ScrollView { width: parent.width height: 150 contentWidth: 1000 // Make it wider than the parent horizontalAlignment: ScrollView.AlignLeft Row { spacing: 10 Rectangle { width: 200 height: 100 color: "lightgreen" } Rectangle { width: 200 height: 100 color: "lightcoral" } Rectangle { width: 200 height: 100 color: "lightsalmon" } Rectangle { width: 200 height: 100 color: "lightpink" } } } Rectangle { width: parent.width height: 300 color: "lightyellow" Text { text: "Final Outer Content" anchors.centerIn: parent } } } } }
  • Memory leak while using QOpenglWidget

    Unsolved
    6
    0 Votes
    6 Posts
    180 Views
    S
    @Christian-Ehrlicher This issue only occurs on workstation systems (in my case, an HP Z2 with an RTX A4000) and does not happen on laptops. I believe this may be due to the two systems using different branches of the NVIDIA driver. If i disable Threaded Optimization on the nvidia card then no leak happens. Also Drivers after 560XX.
  • install QT 6.6.0 / Macos Monterey

    Unsolved
    2
    0 Votes
    2 Posts
    43 Views
    SGaistS
    Hi, One possible way might be the aqtinstall project.
  • QSqlTableModel Network Performance

    Solved
    17
    0 Votes
    17 Posts
    659 Views
    Z
    Thanks again for all the replies here; circling back to mark this as solved. I ended up implementing a custom QAbstractTableModel based on the ModifiedRow class in the QSqlTableModel source code. The local data is populated via a QSqlQuery with setForwardOnly set to true. void CachedSqlTableModel::select() { if(m_select.isEmpty() || m_tableName.isEmpty()){ qDebug() << "Invalid select statement"; return; } //Initialize query QSqlQuery query; query.setForwardOnly(true); query.prepare(selectStatement()); query.exec(); if(query.isActive()){ beginResetModel(); //Reset data structure m_cache.clear(); //Populate header data m_record = query.record(); //Populate table data while(query.next()){ m_cache.push_back(CachedRow(CachedRow::Update, query.record())); } endResetModel(); } else { m_error = query.lastError(); } All of the related cached database operations are executed in the exact same way as the code in the QSqlTableModel database handlers. virtual bool updateRowInTable(int row, const QSqlRecord &values); virtual bool insertRowIntoTable(const QSqlRecord &values); virtual bool deleteRowFromTable(int row); A big thank you to @Kent-Dorfman for the additional insights here. I implemented all of the suggestions above (stored procedures, transactions, indexing, limiting datasets, etc.) and there is a noticeable speed difference on all fronts.
  • QFileDialog::getOpenFileName Fails to Display Dialog with Native macOS

    Unsolved
    5
    1 Votes
    5 Posts
    541 Views
    SGaistS
    Quoting the reasons from the ticket: The app is missing a bundle identifier, which apparently affects whether the OS shows native file dialogs. Set MACOSX_BUNDLE_GUI_IDENTIFIER to fix this. The reason qt_add_executable works is because it automatically sets MACOSX_BUNDLE_GUI_IDENTIFIER if not set.
  • How to make a round corner for the qwebengineview?

    Unsolved
    14
    0 Votes
    14 Posts
    306 Views
    JonBJ
    @Bonnie said in How to make a round corner for the qwebengineview?: Just because someone posts frequently it doesn't necessarily mean he/she is good :) I wasn't expecting good, these are just basics... You are (always) good! :)
  • is there a Qt +CMAKE +qmake Setup for Dummies out there?

    Unsolved
    6
    0 Votes
    6 Posts
    164 Views
    jsulmJ
    @bitbasher said in is there a Qt +CMAKE +qmake Setup for Dummies out there?: in Windows if you must use the path all the way to the cmake folder before the cmake.exe is found Not if you add C:\Qt\6.10.0\mingw64\lib\cmake\bin to PATH...
  • how to link libclang and libtooling to QT project

    Unsolved
    6
    0 Votes
    6 Posts
    130 Views
    jsulmJ
    @jdenv said in how to link libclang and libtooling to QT project: main.o: undefined reference to symbol '_ZN5clang14FrontendAction13EndSourceFileEv' Looks like one of the clang libraries is missing
  • Issue with QLabel and wordwrap

    Solved
    27
    0 Votes
    27 Posts
    2k Views
    F
    I stumbled upon this thread while looking for a solution about such unwanted word wrap, and I am pretty sure the following post on StackOverflow is about the exact same issue and has a few potential manual workaround for it : https://stackoverflow.com/questions/31535143/how-to-prevent-qlabel-from-unnecessary-word-wrapping I wish this would be fixed in Qt core instead though, as the current behavior definitely does not look like the intended behavior for that case...
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • QTableWidget

    Unsolved
    4
    0 Votes
    4 Posts
    691 Views
    M
    Well thanks @VRonin as it provided the solution that was unsolvable before. Here is a summary of my problem and how this solved it for the record. When using a dark stylesheet (dark.qss) the top-left corner button remains untargettable with styling. Calling findChild(QAbstractButton) and forcing a stylesheet in code helped for a moment, but the white square came back on resize, theme change, or first show. Root cause seemed to be Qt treats that corner button as part of the table header, not as a normal button. Header pieces are styled with the selector QHeaderView::section. The corner is a special header piece called QTableCornerButton::section. If you never tell Qt what colour that piece should be, it falls back to the system’s light colour even in dark mode which seems to be white. After hacking workarounds in the code and doing all sorts, I was still unable to resolve it permanently until approaching it treating the top-left select-all button as a header, not a button. Styling it with QTableWidget QTableCornerButton::section in my QSS and that was pretty much it. In my case adding this into my dark.qss theme file: /* Dark-theme top-left corner (select-all button) */ QTableWidget QTableCornerButton::section { background-color: #2b2b2b; /* same as table background */ border: 1px solid #555555; /* same as table border */ border-bottom: 2px solid #777777; /* optional – matches header underline */ } also adding into the python script: app.setStyle("Fusion") and loading the stylesheet after the style is set. a simple example as a test was: import sys from PySide6.QtWidgets import QApplication, QTableWidget from pathlib import Path app = QApplication(sys.argv) app.setStyle("Fusion") # ---- dark.qss (only the relevant part) ---- qss = """ QTableWidget { background-color: #2b2b2b; color: #e0e0e0; } QHeaderView::section { background-color: #2b2b2b; color: #e0e0e0; border: 1px solid #555555; } QTableWidget QTableCornerButton::section { background-color: #2b2b2b; border: 1px solid #555555; border-bottom: 2px solid #777777; } """ app.setStyleSheet(qss) w = QTableWidget(5, 3) w.show() app.exec() I hope that helps anyone running into this problem which clearly still exists in 2025 and until I found the info in the link shared by Vronin I was struggling to solve.