Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Is there a cmake variable like QT_TRANSLATIONS_DIR which holds the real path?

    Unsolved
    2
    0 Votes
    2 Posts
    224 Views
    Christian EhrlicherC
    You can install your translation in whatever location you want.
  • QTableView with QAbstractTableModel derrived class not displaying data

    Solved qtableview
    3
    0 Votes
    3 Posts
    627 Views
    C
    @Christian-Ehrlicher said in QTableView with QAbstractTableModel derrived class not displaying data: Elements I don't see where you fill this container. Sorry, I should have mentioned that Elements is being filled, and has been tested. I was originally using a QListView with QStringListModel which worked to show that Elements was being filled. When I switched to QTableView and QAbstractTableModel I had added a debug statement to rowCount() to also confirm that Elements was filled. void RailDocModel::operator<<( LayoutObject * NewElement ) { Elements << NewElement; } And here you're missing some important signals: https://doc.qt.io/qt-6/model-view-programming.html#inserting-and-removing-rows That pointed me to what I was missing. Changing operator<<() to this was the solution: void RailDocModel::operator<<( LayoutObject * NewElement ) { beginInsertRows( QModelIndex(), Elements.count(), Elements.count() ); Elements << NewElement; endInsertRows(); } I had tried adding beginInsertRows() and endInsertRows() recently, but had used nullptr as the first parameter to beginInsertRows() instead of QModelIndex().
  • Track Cursor Events With Window Click Through

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    Axel SpoerlA
    @HOSHI The architecture seems off and overly complicated to me: You implement a class inheriting from QWidget, which looks like an application's main window. This class' mouse events are intercepted to eventually move a highlighter with the cursor. We don't know anything about this highlighter, so I assume it's just a normal cursor, surrounded by a halo. => Why don't you write your own cursor(s), inheriting from QCursor and use setOverrideCursor()?
  • load plugin Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so

    Unsolved
    3
    0 Votes
    3 Posts
    864 Views
    aha_1980A
    @JonB @grafenocarbono For me it was: sudo apt install libxcb-cursor0 (with trailing zero) The -dev is not needed for running Creator.
  • 0 Votes
    4 Posts
    389 Views
    Chris KawaC
    @Sauntor Or, like the documentation I linked suggests, merge all translations into one file using lconvert.
  • What event is Command+W in Qt

    Solved
    2
    0 Votes
    2 Posts
    210 Views
    M
    @CompSciDude said in What event is Command+W in Qt: Does anyone know if Command+W triggers a specific type of event The event is of type QEvent::ShortcutOverride:
  • Qt::SingleShotConnection only

    Solved
    2
    0 Votes
    2 Posts
    813 Views
    Christian EhrlicherC
    @DungeonLords said in Qt::SingleShotConnection only: Does this codes equals? Simply try it out - both are the same because Qt::AutoConnection is 0 as you can see in the documentation.
  • `QTextEdit::moveCursor()` works abnormally when the signal is emitted from websocket

    Solved
    4
    0 Votes
    4 Posts
    333 Views
    S
    @Christian-Ehrlicher I did nothing, but it works fine now😂
  • 0 Votes
    8 Posts
    575 Views
    SGaistS
    Complexity is in the eye of the beholder. Libssh has a chapter about that matter. Note that I have not used it directly.
  • Preventing user interaction with a widget

    Unsolved
    2
    0 Votes
    2 Posts
    406 Views
    SGaistS
    Hi, You can use an event filter however it might be surprising to your users that nothing happens when they try to interact with your widgets. Another solution might be to have a modal dialogue that states there's something going on.
  • Qt 6.7 beta1 Windows11 style and windeployqt

    Unsolved
    7
    0 Votes
    7 Posts
    3k Views
    V
    @Christian-Ehrlicher ah.. Ok. I remember that i had many different styles on Linux. Thank you. Enjoy the holidays.
  • This topic is deleted!

    Unsolved
    4
    0 Votes
    4 Posts
    185 Views
  • 0 Votes
    2 Posts
    206 Views
    D
    I am sorry, I meant to put this in QWebEngine. I found my program's cache and deleted it. I think this helped. QtWebEngine appears to cache in C:\Users\WIN_USER\AppData\Local\PROJECT_NAME Under two folders "cache", and "QtWebEngine"
  • 0 Votes
    13 Posts
    835 Views
    JonBJ
    @arost So it was always working correctly. This is why you should always be prepared to show a minimal example of your code.
  • How to write and read without interrupts using QSerialPort

    Unsolved qserialport
    3
    0 Votes
    3 Posts
    700 Views
    H
    When working with QSerialPort in Qt, you can perform reading and writing operations without using interrupts explicitly. However, it's essential to manage the communication in a way that doesn't block the main thread, especially in a GUI application where blocking operations can freeze the user interface.
  • Can I use QStateMachine to simulate a flow processing? And how?

    Unsolved
    3
    0 Votes
    3 Posts
    297 Views
    S
    @JonB By what I know now, if implement this flow, one should create at least tow mediator component for choice node and join node, and many other intermediate QState for transitions. That's too complicated! 😂 If you do not use state machine, things may go a little simple! But it's still complicate 😂
  • Displaying bool values as "boxes" in a QChart

    Solved
    2
    0 Votes
    2 Posts
    229 Views
    A.A.SEZENA
    QScatterSeries might be what you're looking for. https://doc.qt.io/qt-6/qscatterseries.html
  • Problem with the installation of the Qwt (Qt6 installed from source)

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    L
    Thank you guys for your help. I made it work. Actually I should have execute qmake6 not qmake. At least this worked. So. /home/lparadox/Tools/qt/qt6-install/bin/qmake6 qwt.pro make -j8 After this I was able to make my project using Qwt.
  • XCB event XCB_VISIBILITY_NOTIFY not received

    Unsolved
    18
    0 Votes
    18 Posts
    2k Views
    E
    @Axel-Spoerl My current Linux X Window platform has some Motif Apps running which receive the VisibilityNotify event to make some Window stay_on_top. I'm working on to replace the Motif Apps with Qt. So the VisibilityNotify event is there. So in Qt, all the X Window events should go through XCB to the Apps and there is no need to enable them, right? I'm asking because there is the function xcb_configure_window (xcb_connection_t *, winId(), XCB_CW_EVENT_MASK, XCB_EVENT_MASK_VISIBILITY_CHANGE ) that you can enable the events. I tried the function and it does not help.
  • macro in .rep file

    Unsolved
    8
    0 Votes
    8 Posts
    710 Views
    Chris KawaC
    You can run preprocessor on any file you want at any build stage you want. Just make a custom build step and pass it to the compiler with the right options to only run preprocessor stage. MSVC has a /P option for that. GCC has -E. You can then pass the result to repc.