Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • How can I replace the default action for QTextEdit's Ctrl + Z shortcut?

    Unsolved
    8
    0 Votes
    8 Posts
    813 Views
    SGaistS
    You should implement that in a subclass of QTextEdit.
  • Oauth2 ssl support

    Unsolved
    16
    0 Votes
    16 Posts
    2k Views
    SGaistS
    Seems like you do know of such a service. Can you provide a minimal example with setup instructions so that it can be reproduce ?
  • 0 Votes
    2 Posts
    653 Views
    SGaistS
    Hi, My guess is that it still wraps the previous style. I would recreate the proxy style when switching between your themes.
  • Problem in integration of the QT5GStreamer in the QT5

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    JoeCFDJ
    add this -DCMAKE_INSTALL_PREFIX=/opt/thirdParties/QtGstreamer to build it. It is better to install it under /opt/ since it is a customized build. Purge your old installation. Then link it to your app. I did this without issues.
  • Proper way to Windows Qt development with pthread

    Unsolved
    5
    0 Votes
    5 Posts
    543 Views
    JoeCFDJ
    @RahibeMeryem said in Proper way to Windows Qt development with pthread: #pragma omp parallel sections OpenMP is supported by VS. You do not need pthread for it. https://docs.microsoft.com/en-us/cpp/build/reference/openmp-enable-openmp-2-0-support?view=msvc-160
  • Qt app crashes

    Solved
    12
    0 Votes
    12 Posts
    882 Views
    artwawA
    @HenkCoder learning opportunity, even if you have to go round in circles for some time, is a time never wasted. Happy you got around to fix it!
  • QFileDialog - How to load and display image in a QLabel

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    L
    @jsulm There is an option in the Qt Designer which can be enabled, I did so and the Popup is working perfectly now. Thanks for your response
  • Switching Styles at runtime?

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    BDC_PatrickB
    @SGaist Not with my past method.. My current method involves a Change of the Palette of fusion, to get dark mode.. and simply switch palettes from lightPalette to darkPalette. New problem following...
  • Hex string convert back to QByteArray

    Solved
    4
    0 Votes
    4 Posts
    379 Views
    SPlattenS
    @artwaw , it works, thank you.
  • QAbstractTableModel run data() several times even if there are no modifications

    Solved
    22
    1 Votes
    22 Posts
    3k Views
    JonBJ
    @JonexElectronic said in QAbstractTableModel run data() several times even if there are no modifications: Thanks, probably is something that emit a signal to repaint all de Dock? Is it posible?? Again, sorry, not my area. But if something calls for a repaint/update of a view onto your model you would indeed see the model's data() method being called many times. You need someone else to comment on your currently reported situation with data() being called repeatedly on your dock widget, as this needs not to be happening.
  • Are there any tool available to create Qt application as debian package

    Unsolved
    5
    0 Votes
    5 Posts
    951 Views
    K
    Thank you all for the details. Will try all the above mentioned options..
  • 0 Votes
    18 Posts
    2k Views
    S
    @sierdzio said in How to not interrupt back ground thread and also allow foreground ui function to get executed ?: BTW. be very careful with SQLite and threads, by default it does not support them. You need to compile SQLite yourself. See https://sqlite.org/threadsafe.html The link you provided states that by default SQLite uses serialized access, i.e. it is thread safe by default. @Qt-embedded-developer You should not use mutexes to access SQLite. With the proper settings multiple connections to the same SQLite file can be open. SQLite will do all the synchronization. You might get into trouble if one of the threads reads quite often and the other thus cannot lock it for writing. Maybe you can clarify what you are actually trying to do. You should not use a database to communicate between two threads (one polling if there is something new to be sent over the network). My guess is that you don't need mutexes at all. In order for the GUI thread to communicate that there is something new to be sent, just use signals and slots between the two threads to communicate. All requests from the GUI will be queued inside the event loop of the network thread and handled one after the other. This is how Qt should be used.
  • Qt Creator project organization

    Solved
    7
    0 Votes
    7 Posts
    883 Views
    T
    OK thanks
  • reading bytes of data from binary file

    Unsolved
    9
    0 Votes
    9 Posts
    2k Views
    K
    @jsulm yes i have many data types this seems helpfull thank you :)
  • 0 Votes
    19 Posts
    3k Views
    S
    Here are a few things I have learned over the years: Make sure your source code files are stored as UTF-8 (if you have non-ASCII characters in there). Make sure you let the Microsoft compiler know that you are using UTF-8 (I don't remember the switches; there might be one for the source files and another one for the object files). On Windows add the code line setlocale(LC_ALL, ".UTF8"); which will make sure that std::cin, std::cout and all file I/O will be UTF-8 (also filenames!). The last one is the most important one. I guess this would also tell your program that your command line parameters are UTF-8.
  • QJsonObject, how to get size in terms of bytes

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    SPlattenS
    @JKSH , thank you, this is exactly what I wanted.
  • 0 Votes
    4 Posts
    897 Views
    P
    @chilarai - Could you please let me know what exactly you did to get rid of this assertion? I'm having a similar problem with my tree view and struggling for two days. ANy help is greatly appreciated. Thank you!
  • QListWidget - Keep track of moved rows

    Solved
    5
    0 Votes
    5 Posts
    632 Views
    H
    @JonB So I came up with a solution. I use a variable to store the difference between the position of the row I want to keep track and the last row position out of the selected rows. //mRowsDifference - holds the position of the row I want to keep track of void PlaylistPage::onRowsMoved(const QModelIndex &, int start, int end, const QModelIndex &, int row) { mCurrentPlayingIndex = this->selectedIndexes().last().row() - mRowsDifference; // after the last row is moved mCurrentPlayingIndex will be holding the new position } void PlaylistPage::dragMoveEvent(QDragMoveEvent *event) { mRowsDifference = this->selectedIndexes().last().row() - mCurrentPlayingIndex; QListWidget::dragMoveEvent(event); } I will be making more tests but until it seems to be working
  • Bug in QMediaPlayer version 6.2

    Unsolved
    3
    0 Votes
    3 Posts
    313 Views
    F
    Even with the final version identical error on every Linux, while with the beta libraries QMediaPlayer works normally. Does anyone have the same error? In QGraphicsView the error does not occur. In the Mediaplayer present in the example code, the one based on qml works normally, the one on widget has the same bug.
  • QT Virtual Keyboard not appears

    Unsolved
    22
    0 Votes
    22 Posts
    3k Views
    SGaistS
    Did you check that all the dependencies of it are also deployed/available ?