Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • forcing proxy model to update

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    mzimmersM
    Well...it's working now, without my having to use the invalidate() method. Not sure what I changed, but here's the relevant code: // qml ListView { id: spaceRow model: spaceModel delegate: TabButton { contentItem: Text { text: name MouseArea { anchors.fill: parent onClicked: { spaceRow.currentIndex = index equipmentProxyModel.setSpaceIndex(index) // c++ void EquipmentProxyModel::setSpaceIndex(int index) { m_spaceIndex = index; } m_spaceIndex is used here: bool EquipmentProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { bool rc = false; QModelIndex qmi = createIndex(sourceRow, 0); QUuid equipmentUuid = m_equipmentModel->data(qmi, m_equipmentModel->UuidRole).toUuid(); QUuid spaceUuid = m_spaceModel->getUuid(m_spaceIndex); if (m_spaceIndex == 0) { // all spaces rc = true; } else if (equipmentUuid.isNull()) { // don't bother } else { rc = m_spaceModel->equipmentInSpace(spaceUuid, equipmentUuid); } return rc; } And this seems to suffice. Thanks to everyone who replied... EDIT: And...just like that, it stopped working (after some changes to the model. I followed the advice of @sierdzio and (re)inserted the invalidate() call: void EquipmentProxyModel::setSpaceIndex(int index) { m_spaceIndex = index; invalidate(); } And now it works. No idea how I got it to work (temporarily) without this...
  • QSqlTableModel - Check for invalid cells in QTableView?

    Unsolved qsqltablemodel qtableview qsqlrecord
    4
    0 Votes
    4 Posts
    760 Views
    R
    From what I've seen online, the QValidator approach requires subclassing QItemDelegate and it's setData() method. How is this different from the last point suggested ?
  • "no suitable kits found"

    Unsolved
    4
    0 Votes
    4 Posts
    374 Views
    JoeCFDJ
    @xqz5222 You installed Qt Design Studio. But it is not Qt. Check Custom installation in the second screenshot and press next button. Then select the latest Qt to install.
  • This topic is deleted!

    Unsolved
    13
    0 Votes
    13 Posts
    63 Views
  • How to create .bin file?

    Solved
    22
    0 Votes
    22 Posts
    11k Views
    V
    @JonB Thank you.. I followed QStandardPath and tested in different target systems. It is able to create and write into the files independent of directories
  • Stylesheets for colour blind users

    Unsolved
    4
    0 Votes
    4 Posts
    234 Views
    sierdzioS
    @pocruadhlaoich ah ok, this I don't know, sorry.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    63 Views
    No one has replied
  • Two Questions

    Unsolved
    6
    0 Votes
    6 Posts
    346 Views
    mzimmersM
    @Lahearle glad to help. If you have more questions pertaining to your original ones, feel free to ask; otherwise consider marking the topic as solved.
  • Reading .desktop files

    Solved
    4
    0 Votes
    4 Posts
    585 Views
    EbonJaegerE
    @SGaist Thanks for pointing me in the right direction; it looks like what I am after is KDesktopFile.
  • widgets and modules

    Unsolved
    5
    0 Votes
    5 Posts
    606 Views
    M
    @ChrisW67 thanks for that. Still seems very clunky and time consuming. I have written a short program that finds the correct module. I'll post this separately. cheers Mick
  • QTest cleanupTestCase not calling (QueuedConnection) slot

    Unsolved qtest slot
    2
    0 Votes
    2 Posts
    395 Views
    SGaistS
    Hi, Are you sure your database connection is still opened when arriving in the cleanup function ?
  • Windows 11 Named Pipe QLocalServer

    Solved
    1
    0 Votes
    1 Posts
    324 Views
    No one has replied
  • CUDA. Windows. Can't get build to work in QTCreator

    Solved cuda windows 10
    6
    0 Votes
    6 Posts
    2k Views
    J
    @Christian-Ehrlicher That would be ideal, but QMake was the system used when the project started. We're considering porting everything to CMake, but it looks like it's going to take some doing. @Pl45m4 I tried to use the search function, but those seem to be good sources that I hadn't seen yet. I'll take a look at those right now. But I was able to find an answer on StackOverflow that I somehow missed until now: https://stackoverflow.com/questions/32279193/cuda-win7-qt-creator-lnk1104-cannot-open-file-cuda-file-obj I just copy-pasted it and it worked (after changing the version number from 7.0 to 12.1). Then I used the code I pasted above and it worked. Then I used a legit CUDA program and it worked. So I'm going to go through it line by line to understand why that .pro works. Thank you for the links!
  • Layout alignment with fixed spacers is inconsistent (Qt 5.15)

    Unsolved
    7
    0 Votes
    7 Posts
    979 Views
    JoeCFDJ
    @rdowell does not cost anything. Simply go for it.
  • QHttpServer and WebSockets

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    I
    @ivanov-ivan At Qt 6.5.0 works code like this: m_pHttpServer->route("/websocket/<arg>", [this](const QString &arg, const QHttpServerRequest) { qDebug() << __func__ << request << arg; return QFuture<QHttpServerResponse>(); });
  • This topic is deleted!

    Solved
    2
    0 Votes
    2 Posts
    32 Views
  • Qt 5.15 download on linux

    Unsolved
    4
    0 Votes
    4 Posts
    242 Views
    sierdzioS
    @QtsCOde No worries. If installer UI was better there would be no need for such questions ;-)
  • This topic is deleted!

    Unsolved
    12
    0 Votes
    12 Posts
    73 Views
  • open terminal at user defined coordinates

    Unsolved
    7
    0 Votes
    7 Posts
    476 Views
    C
    @JacobNovitsky The command to execute your program after launching gnome-terminal is added by Qt Creator. following the -e or --command flag. See the gnome-terminal man page The --geometry flag is a little vague. The size components are either in pixels or characters depending on the application. The man page does not shed any light on this and I do not have it to test. Have you tried the command from a shell prompt? /usr/bin/gnome-terminal --geometry 80x24+2720+0 -e /bin/bash # or /usr/bin/gnome-terminal --geometry 800x600+2720+0 -e /bin/bash You can also try it with a single hyphen before geometry rather than two. If the window cannot be placed 2720 pixels from the left of the screen then I would expect it will usually be moved somewhere it can fit.
  • 0 Votes
    7 Posts
    711 Views
    G
    @SGaist Just for information and if you are interested. After weeks of daily use of ksensors qt/kde 4, I started porting it to qt/kde 5. This time there are a ton of changes in the cmake configuration, in the kde api (several things have been eliminated, you have to use qt directly or rebuild from scratch) and some in qt (a few things even if delicate). It's much more difficult and heavier than I had hoped, on the other hand the progress is much faster, in leaps. After this port I would say that ksensors has definitely entered on modern/recent projects, at least more than many others.