Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.2k Posts
  • QTextBrowser and application font

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    R
    Now that I removed the font-family rule from the CSS file(s), I discovered that the application font is used after all! So I only need one CSS file which merely avoids specifying any font family at all ... exactly as I had imagined it SHOULD have worked!
  • How to sort a QMap<QString, ...> with a custom string order?

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    Chris KawaC
    You're trying to fit a square box into a round hole. QMap simply doesn't (publicly) support custom comparators. Wrapping the type is an unnecessary overhead. Adding custom operator< in global scope is harmful pollution. QMap has an undocumented mechanism for customizing comparison function by providing your own qMapLessThanKey implementation, but it's still a bad idea. Just use a container suited for the task e.g. std::map that allows for custom comparators.
  • How to build QT with GRPC

    Unsolved
    5
    0 Votes
    5 Posts
    4k Views
    semlanikS
    Hi, this https://github.com/semlanik/qtprotobuf might be useful for you
  • QString::fromStdString/toStdString convertion error

    Solved
    3
    0 Votes
    3 Posts
    572 Views
    semlanikS
    Probably https://github.com/semlanik/qtprotobuf will be useful for you
  • Protobuf with Qt 5.13

    Unsolved
    7
    0 Votes
    7 Posts
    862 Views
    semlanikS
    https://github.com/semlanik/qtprotobuf might be useful for you
  • Re: Qt 5.14 / Ubuntu 18.04 QMediaPlayer Welcome Example Application long start up time

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    SGaistS
    Re-try your test using your distribution provided Qt to see if there's any difference before formatting everything.
  • How to create the plugin of MYSQL for Qt in Linux

    Unsolved
    4
    0 Votes
    4 Posts
    308 Views
    transistor47T
    Thank you!!
  • How to change background-color of widget, but not items

    Solved qwidget qstylesheet
    4
    0 Votes
    4 Posts
    3k Views
    J.HilkJ
    @JonB said in How to change background-color of widget, but not items: [Looks like @J-Hilk types faster than I can... :) ] Sometimes, but I imagine I write with more errors as well :)
  • lupdate_only: showing QML and C++ files twice.

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    S
    @EStudley @dynamo72 This issue is still around. One workaround is to place the lupdate_only part in a .pri file, and include that .pri file in the .pro file. i18n.pri: lupdate_only { SOURCES += *.qml } project.pro: include(i18n.pri) This way, lupdate will still work properly, but QtCreator won't put all the QML files into your sources in the project browser
  • Cross-platform shortcut key sequences

    Unsolved
    8
    1 Votes
    8 Posts
    2k Views
    JonBJ
    @SGaist Right, I have now carefully read the whole of https://doc.qt.io/qt-5/qkeysequence.html as you advised. Yes, it explained a bit about Mac differences, I have yet to test that out with my Mac user. However, one of my questions remains unanswered. You will note the doc page admonishes: It is preferable to use standard shortcuts where possible. i.e. the enum QKeySequence::StandardKey you picked up I was thinking about: This enum represent standard key bindings. They can be used to assign platform dependent keyboard shortcuts to a QAction. I wholeheartedly agree this is desirable in a cross-platform situation. However, as I said earlier, how you are supposed to use this when designing from Qt Designer? No matter where I try to set the shortcut for an action in Designer, anything I type is taken as literal key presses and encoded as such into the .ui file. I do not have an "alternative" interface which I can pick/type in enum QKeySequence::StandardKey (I thought it might be pickable from a dropdown combo, but no). Sooo... is it correct that the docs could state "While using QKeySequence::StandardKey from code is the best way to do stuff in code, note that this approach cannot be used if the UI is designed via Qt Designer"? EDIT: Ah ha, I finally came across https://forum.qt.io/topic/6259/qt-designer-does-not-support-qkeysequence-standardkey in this forum. So exactly this issue was raised as a"bug" with qt.nokia.com in 2011, but left as not doable from Designer for the past 9 years?
  • Dynamic Scene exampe as CMake

    Unsolved
    1
    0 Votes
    1 Posts
    156 Views
    No one has replied
  • QT 5.13.1 More Features

    Solved
    2
    0 Votes
    2 Posts
    160 Views
    S
    Never mind. Found the answer. "Maintenance Tools"
  • How to change the height and text font size of qtreeview item

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    N
    Hey @Christian-Ehrlicher and @Gojir4 yes its works fine. thank you both for the help.
  • QTableWidget setColumnWidth didn't work

    Solved
    11
    0 Votes
    11 Posts
    5k Views
    A.A.SEZENA
    @chris_rookie Hi, I answered your question before I fully understood it. I always add elements to help others, if possible. I wanted to have a message with QTableWidget that I shared the data demonstration with side features.
  • Installation QT and OpenCV interfaces

    Solved
    11
    0 Votes
    11 Posts
    795 Views
    S
    Thank you @jsulm
  • upload file by http. when to call file->close()

    Solved
    3
    0 Votes
    3 Posts
    265 Views
    C
    @jsulm ok. Thank you.
  • calling function with functions

    Unsolved
    6
    0 Votes
    6 Posts
    475 Views
    jsulmJ
    @s002wjh said in calling function with functions: how can I access QTcpServer::listen() from another file? I really don't get what you want to do. To call QTcpServer::listen() in another file you do it in exact same way you do it in test (but create an QTcpServer instance as listen() is not static as I already told you). You really should read a book about C++.
  • QTableView Stretch Headers but keep Interactive

    Solved
    11
    0 Votes
    11 Posts
    5k Views
    A
    Hi Guys, after Struggling like 3 hours ive got it: for(int c = 0;c<=4;c++){ ui->tableView->horizontalHeader()->resizeSection(c, 150); } ui->tableView->horizontalHeader()->setStretchLastSection(true); Set first the width of each column to match the QTableView size and then Stretch the last section, thanks a lot!
  • 0 Votes
    6 Posts
    3k Views
    J
    @SGaist I tried the Qt 5.12.6 and it did the trick! Thanks. But interestingly, the title of the main application is no longer scaled by "Make text bigger" setting but the dockwidget ones does. I guess that there is an intention not to scale the main title. "Make everything bigger" setting does scale everything properly now except the titlebar height of only the main application looks not enough for the enlarged font size. I will give qt5.14 a try as well.
  • QTFtp

    Unsolved
    6
    0 Votes
    6 Posts
    477 Views
    whilajiW
    I solved the problem temporarily. When you want to compile with visual studio 2015, you need to open vs2015 and use "Qt VS Tools"-->"Open Qt Project.pro" to open qtftp(src) .That will create a vs solution and change "property Pages-->general-->configuration Type -->lib/dll" . Not use QtCreator to compile lib/dll .The two schemes will generate different mkspecs folder and different modules/qt_ftp.pri