Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 457.9k Posts
  • how to add description properties

    Unsolved
    9
    0 Votes
    9 Posts
    682 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.
  • QAbstractListModel with base and derived class

    Solved
    5
    0 Votes
    5 Posts
    117 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
    144 Views
    F
    @jsulm The problem was solved, I mainly want to know the reason. Thank you~~
  • Nested ScrollView

    Unsolved
    2
    0 Votes
    2 Posts
    108 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 } } } } }
  • install QT 6.6.0 / Macos Monterey

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

    Solved
    17
    0 Votes
    17 Posts
    817 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
    599 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
    379 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
    184 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
    147 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
    707 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.
  • How to use qt_generate_deploy_qml_app_script?

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    L
    For me it was because when I switched to a 6.8 kit, the "deployment configuration" quietly got set to "Automatic Application Manager Deploy Configuration". As far as I know, I have no need for Application Manager (and evidently, like you, don't even have it installed). I also don't know why it happened for this project and not another, but perhaps because this one is a QtQuick application? I just changed the configuration back to "Deploy Configuration" (which has No Deploy Steps) and all is well. You can find these settings by clicking on "Projects" in the left hand button pane in the Qt Creator window. [image: e47f7762-eb4c-434e-b793-8405a5fbc3d6.png]
  • How to register application to handle custom uri:// scheme?

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    G
    Thank you, @JKSH. That's great there's a facility in cmake for this on some platforms.
  • Git is down

    Unsolved
    8
    0 Votes
    8 Posts
    689 Views
    M
    @cristian-adam Thanks for the attempt for a workaround. I'm using 'init-repository' ; so not sure how to implement that trick + code.qt.io links are hard coded in QT src files, thus I've poor expectations :( Thanks !
  • 3D Textures support on all backends?

    Solved
    4
    1 Votes
    4 Posts
    142 Views
    febiodeveloperF
    Sorry took me a while to get back to this. I found the error and it turns out I did not use consistent uniform bindings between my vertex and fragment shader, you know, one of those ID-10-T errors :). Interestingly, OpenGL didn't seem to care and worked fine regardless. Anyways, the volume rendering is now working on all backends.
  • Dark color scheme on Windows best practises

    Unsolved
    5
    0 Votes
    5 Posts
    662 Views
    M
    @SimonSchroeder said in Dark color scheme on Windows best practises: As of Oktober this year almost nobody should be using Windows 10 anymore (though many will). Official support is ending by then and you'll be vulnerable to attacks. A few people might opt-in to extended support for a couple more months. I would say it's more than a few people who will be getting the Extended Security Updates for the next 11 months, and, after that, there still remain long term supported Enterprise versions of Windows 10, with support through January 2027 and 2032. There are definitely going to be lots of people trying to find ways to not make unnecessary e-waste out of their otherwise still functioning hardware.
  • QJsonObject::value causing segfault

    Unsolved
    12
    0 Votes
    12 Posts
    333 Views
    T
    @Axel-Spoerl I can try later after rewriting some of the code to compile on Qt 6.
  • Uuidv7 NULL character

    Unsolved
    3
    0 Votes
    3 Posts
    133 Views
    piervalliP
    Thanks, for comments