Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • How to create custom text within bar graphs?

    Solved
    2
    0 Votes
    2 Posts
    957 Views
    O
    @orsini29 Found it.. super simple and knew I'd kick myself over it. For anyone in the future, you need to use series->setLabelsFormat("@value enter text here"); Documentation: https://doc.qt.io/qt-6/qabstractbarseries.html#labelsFormat-prop
  • Qt6 RHI alpha texture support ?

    Unsolved
    1
    0 Votes
    1 Posts
    122 Views
    No one has replied
  • Qt DllMain doesn't get called

    Unsolved
    7
    0 Votes
    7 Posts
    949 Views
    jsulmJ
    @Ylvy said in Qt DllMain doesn't get called: what you mean mix debug and release build? I mean that if your application is built in debug mode you can't load DLLs built in release mode
  • This topic is deleted!

    Solved
    4
    0 Votes
    4 Posts
    33 Views
  • how to simplify convoluted UI signals?

    Solved
    7
    0 Votes
    7 Posts
    567 Views
    M
    In the end I refactored mediator QtObject from QML into a C++ QObject. However, I am surprised sender() returns NULL. Maybe it is so because I connect slots in QML with Connections on mediator instance set as a context property. Perhaps if I were to use QObject::connect() in C++ instead, sender() might have worked as expected.
  • Different property type for enum in 5.15/6.5

    Unsolved enum property qvariant qt5 qt6
    9
    0 Votes
    9 Posts
    2k Views
    crueeggC
    @kshegunov I have ~80 classes, each with 5-10 different properties (enums, POD, custom types, containers). The problem are all implicit (in a loop) conversions of these properties.
  • QStandardItem setData does not work

    Unsolved qvariant qstandarditem
    2
    0 Votes
    2 Posts
    513 Views
    JonBJ
    @johnco3 I'm afraid I know nothing about std::variant, but a couple of observations. Your setData() is void. QStandardItemModel's is bool. Have you checked the return result when you call that, you never know if it might be barfing? Your setData() defaults to Qt::UserRole + 1. How does your item->data().value<PortVariant>() pass that role to fetch? setData() copies its argument. I assume the equivalent code to test would be something like: PortVariant portVariant = port; QVariant v = QVariant::fromStdVariant(portVariant); QVariant v2 = v1; const auto& portVariant = v2.value<PortVariant>(); How does that come out? You might also call QVariant::canConvert<>() to check, including on your item->data(). I assume all the various component types in your structs are serializable to QVariant without further registration.
  • Display a custom ellipsis when text is elided

    Unsolved qstring elision ellipsis
    3
    0 Votes
    3 Posts
    874 Views
    S
    @Chris-Kawa Thanks for the quick reply! It might be helpful, I will think whether I can use it to my advantage.
  • QFileDialog QTranslator

    Unsolved
    4
    0 Votes
    4 Posts
    372 Views
    R
    Update to the DeprecationWarning: Using QLibraryInfo.path(QLibraryInfo.LibraryPath.TranslationsPath) the warning is gone.
  • Q_Property and reference data type

    Unsolved
    7
    0 Votes
    7 Posts
    964 Views
    jsulmJ
    @MasterQ said in Q_Property and reference data type: Why is "const" dropped? Because you were trying to return a non-const reference to a const object.
  • How to "make a copy of QDesigner form"

    Unsolved
    2
    0 Votes
    2 Posts
    222 Views
    Pl45m4P
    @AnneRanch Copy the class (cpp, h and ui) and add the changes you want to.
  • Dark mode doesn't work well in Qt 6.5

    Unsolved
    14
    0 Votes
    14 Posts
    3k Views
    lincolnL
    @SimonSchroeder Hello friend, I tried to do what you mention, but when querying this->windowHandle(); the result is always a nullptr.
  • How do add I rectangle to any position in a QGraphicsView?

    Solved
    2
    0 Votes
    2 Posts
    435 Views
    ?
    Never mind, I found out I needed to add to use setSceneRect() on the QGraphicsView window. I also found out that using Items instead of regular QRects allow moving allows moving the rectangle easily.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    13 Views
    No one has replied
  • QProcess not firing readyRead() or readyReadStandardOutput() signals

    Unsolved
    5
    0 Votes
    5 Posts
    703 Views
    JonBJ
    @Anthony-Abboud Both the issues @SGaist has mentioned. And when do you call readAllStandardError(), do you wait for the process to finish first? m_processUpdatesChecker->start("/bin/sh", QStringList() << "-c" << "'journalctl -q -u aktualizr* | grep \"Update available\"'"); Enclosing the argument to -c inside its own 's (single-quotes) is wrong. Remove those to make this work. m_processUpdatesChecker->start("journalctl", QStringList() << "-q" << "-u aktualizr*"); -u aktualizr* should not be a single argument.
  • Multilingual UI and Fonts?

    Unsolved
    9
    0 Votes
    9 Posts
    868 Views
    SGaistS
    @Taytoo said in [Multilingual UI and Fonts?]: Wouldn't that just set specified font for all widgets? I'like to substitute different fonts. I use three font styles so need to substitute them accordingly e.g. Font A -> B, Font X -> Y, Font J -> K Indeed, my bad, I misunderstood the scope of your issue.
  • QHttpServer: use function pointer as ViewHandler

    Solved
    19
    0 Votes
    19 Posts
    2k Views
    Christian EhrlicherC
    And fixed
  • QSortFilterProxyModel not called filterAcceptsRow

    Solved
    3
    0 Votes
    3 Posts
    201 Views
    JonBJ
    @Mihaill Show some minimal code, including your filterAcceptsRow() override with a qDebug() showing it is not called. Calling just sort(0) will not cause the filter to be re-evaluated. Ultimately QSortFilterProxyModel::invalidate(), QSortFilterProxyModel::invalidateFilter() or QSortFilterProxyModel::invalidateRowsFilter() must be called for filterAcceptsRow() to get invoked. setFilterRegualrExpression() will call these. And for your tree model both dynamicSortFilter and recursiveFilteringEnabled may be relevant to when re-filtering/calling filterAcceptsRow() gets done.
  • error building a window application

    Solved
    10
    0 Votes
    10 Posts
    499 Views
    R
    @Pl45m4 , @JonB , @JoeCFD Many thanks for your feedback :)
  • 0 Votes
    3 Posts
    237 Views
    D
    If you are using cmake another option will be to use a package manager like vcpkg or conan. This will save you a lot of effort compiling the libs and setting everything up.