Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • QTableWidget or QTableView - Presenting many info in one table cell

    Unsolved
    6
    0 Votes
    6 Posts
    540 Views
    gde23G
    For the layout on the delegate you can use a grid layout or cascaded horizontal/vertical layouts, that really does not matter. However, if you are not familiar with basic widget layouts I would suggest starting with something more basic than delegates. E.g. you can first setup the model/view, then make a standalone widget to be used as delegate, and finally setup the delegate.
  • Crash on QBluetoothDeviceDiscoveryAgent start method on W7

    Unsolved
    4
    0 Votes
    4 Posts
    423 Views
    A
    Did you find a solution / workaround for this issue? I am experiencing the same issue. I realized that it is somehow related to CPU stress, however, could not find a solution yet. Any hint would be appreciated, thanks.
  • How to step into the Qt source code (Qt 5.15.2 / Windows) ?

    Solved
    10
    0 Votes
    10 Posts
    3k Views
    AlveinA
    @Bonnie That made it. I just needed the c:/users/qt/work/qt target, though. And no CDB paths at all. I'm pretty sure I used the Add Qt sources button before, but ATM, IDK (and IDC) about what happened. Thank you very much! I've been on this for a long while.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • Open source ....

    Unsolved
    2
    0 Votes
    2 Posts
    279 Views
    JKSHJ
    @AnneRanch said in Open source ....: Could somebody with experience analyzing Qt Open source code help me to find actual code for "code formatter / beautifier " . At least give me some pointers where to start looking - github link ? Is https://github.com/qt/qtbase good place to start ?. The Beautifier is in Qt Creator IDE. qtbase contains Qt libraries, not the Qt Creator IDE. https://github.com/qt-creator/qt-creator/tree/master/src/plugins/beautifier yes I have asked this before AND GOT NOWHERE. You can add a link to your original post here.
  • How to set background color of my QTextEdit?

    Unsolved
    3
    0 Votes
    3 Posts
    3k Views
    mrjjM
    Hi It has to be the right role. QWidget::backgroundRole() is not used it seems. Try QPalette p = ui->textEdit->palette(); p.setColor(QPalette::Base, Qt::red); // BG p.setColor(QPalette::Text, Qt::white); // (plain) TEXT ui->textEdit->setPalette(p); [image: 1byfHV.png]
  • Unclear sceneRect behavior when scaling QGraphicsView

    Unsolved
    1
    0 Votes
    1 Posts
    101 Views
    No one has replied
  • Deleting object after QQmlEngine quit. How?

    Solved
    4
    0 Votes
    4 Posts
    480 Views
    sierdzioS
    Yeah, this started appearing a few versions ago, around 5.13 or 5.14. I think some bug fix must have changed QQmlEngine destructor or something. In every case I noticed these TypeError logs, it was enough to change parenting or initialization order to fix the issue.
  • Can't save an image from a QLabel to disc

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    SGaistS
    Use the selectedFilter output parameter to get the information.
  • How to set fixed width in qtextdocument?

    Unsolved
    4
    0 Votes
    4 Posts
    644 Views
    raven-worxR
    @qwe3 try https://doc.qt.io/qt-5/qtextdocument.html#textWidth-prop
  • CMAKE_MAKE_PROGRAM is not set.

    Unsolved
    2
    0 Votes
    2 Posts
    4k Views
    JoeCFDJ
    @Flaviu-0 said in CMAKE_MAKE_PROGRAM is not set.: CMake Error: CMake was unable to find a build program corresponding to "Ninja" Your problem is not qt related. https://ninja-build.org/manual.html cmake uses ninja in your case. Try to install ninja and you will be all right.
  • Proper resetting the transformation

    Solved
    4
    0 Votes
    4 Posts
    474 Views
    JoeCFDJ
    @jan-tosovsky after resize event, the image position has to be adjusted for center alignment. Otherwise, its position will not change.
  • qt.qpa.xcb: could not connect to display error

    Unsolved
    22
    0 Votes
    22 Posts
    23k Views
    D
    @jsulm yes you did but my problem is not about deploying. I cannot run my project on qt creator
  • How to use Qt translation resources?

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    B
    Actually the usual way is just deploying the translation files with the executable file. When you use windeployqt tool on Windows, some translation files will be copied just like the plugins by default. If you want to add them to the resource it is also possible. I think you can't use MACROs in qrc file. But you can use them in the .pro file and let it generate a qrc file for you. qm_file.files = $$[QT_INSTALL_TRANSLATIONS]/qtbase_bg.qm #can be multiple files qm_file.base = $$[QT_INSTALL_TRANSLATIONS] #add relative alias automatically qm_file.prefix = i18n RESOURCES += qm_file This will generate a qrc file qmake_qm_file.qrc in the build folder and add it to the Makefile. Then you would be able to access the file by :/i18n/qtbase_bg.qm.
  • Cannot see the Build & Run panel in my QtCreator

    Solved
    4
    0 Votes
    4 Posts
    255 Views
    K
    The Build & Run pages magically appeared again. Must have been something wrong with the kits afterall.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • My modbus connection status stay on connecting forever.

    Unsolved
    10
    1 Votes
    10 Posts
    1k Views
    Z
    @J-Hilk said in My modbus connection status stay on connecting forever.: connect(modbusDevice, &QModbusTcpClient::errorOccurred, this, [](QModbusDevice::Error error)->void{qDebug() << "error happened :" << error}); check this link you will find a solution: https://forum.qt.io/topic/125391/modbusclient-as-a-console-application-stuck-in-connectingstate-loop/3
  • setIcon crash when i'm using tableView

    Solved
    3
    0 Votes
    3 Posts
    280 Views
    F
    @eyllanesc Thank you! Indeed, the (2,2) case was empty...
  • Is "moc" actually helping to debug?

    Unsolved
    6
    0 Votes
    6 Posts
    848 Views
    kshegunovK
    @AnneRanch said in Is "moc" actually helping to debug?: Let me put this the silliest way - if I do not have an object BT_TabWidget constructed nowhere in the code then I am getting "you are missing destructor SOMEWHERE " from all of this. And I will not ask why I am not getting "no BT_TabWidget (object) found " instead., So I will go back to code and verify all BT_TabWidget CODE myself. When you compile stuff, the assembly is generated for the classes not the objects. There's no requirement that you must have an instance of some class to have the latter compiled into code. Or to put it the silliest way I can think of: classes are not objects, nor vice versa. As far as C++ goes, all virtual functions shall be defined if they're not a pure virtual for the build process to succeed, and if you go through your code I'm sure you're going to find out that this particular class has a destructor, which was declared (hence it's an override due to its base class' destructor being virtual), and that destructor hasn't been defined. @wrosecrans said in Is "moc" actually helping to debug?: I don't have any children. Can you tell me where my son Gary isn't? It's impossible to point to a specific place and say that's where something isn't. lol! If it doesn't exist, it isn't everywhere. We could argue some quantum mechanics about that ... ;)
  • Redirecting all cout statements to textEdit box

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    Kent-DorfmanK
    https://stackoverflow.com/questions/18086193/redirect-stdout-stderr-to-file-under-unix-c-again top link in google search. moving the text from the redirected stream is left as an exercise for the reader. Hint involves a stream reader and a signal linked to the TextEdit::SetText() slot.