Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Detect current CMake configuration type. How?

    Solved
    22
    0 Votes
    22 Posts
    1k Views
    B
    Just look on situation when you developing application that is for Android, Unix, iOS, MacOS from one source. And you application has DIFFERENT sets of files for Debug and Release. ONLY ONE way to use this different sets with XCode - to have debug/release settings in CMake, BEFORE XCode. Using expressions in CMake for definitions sets for XCode is impossible. All things that you've got written is about blocking normal developing for iOS. You require me to develop in separate way for iOS. CMAKE_BUILD_TYPE IS USED FOR CREATING DIFFERENT VERSIONS OF PROJECT AUTOMATICALLY BEFORE XCODE. Think of real world application but not of what XCode using or not. This settings for defining project structure not for XCode. The sets of file require NOT ONLY the CPP sources. It require icons, settings, even different Info.plist files and many other things. How you going to setup this things with #ifndef NDEBUG??? If you going to advise me to use something like this: $<$CONFIG:Debug:${CMAKE_CURRENT_SOURCE_DIR}/dbgsrc.cpp> Try to do it by yourself you will have error from XCode that it's not supported sources that have vary in configurations from expressions. In this case only one way is using CMAKE_BUILD_TYPE to set different type of projects within different sets of files at time of scanning and this scanned project passing to XCode.
  • Genericity, extensibility and reuse: QWidgets Vs QML

    Solved qml c++ qml qwidget performance template
    8
    1 Votes
    8 Posts
    2k Views
    G
    I have picked up QML about three weeks ago and I am liking it very much; I have been implementing some small program with PySide6 and QML and it is a pleasure to program in it, but I do find that I can't find examples; currently, I can't get a TableView to work with the ability to edit values....where can I get some assistance?
  • Issue in qvulkanwindow.cpp ?

    Unsolved
    7
    1 Votes
    7 Posts
    660 Views
    J
    Happens to me for version 6.9.2. Swapchain image count is 3. validation errors are sporadically appearing, would suggest that sometimes timing is just right to divide 3 swapchain images to synchronization with 2 semaphores isnt it also exactly this? https://docs.vulkan.org/guide/latest/swapchain_semaphore_reuse.html
  • Whither (many) examples?

    Unsolved
    4
    1 Votes
    4 Posts
    127 Views
    SGaistS
    @FeRDNYC hi, This being a user forum you might not reaching the right people. I would recommend opening a ticket on the bug report system to spark the discussion around the issue of moving the examples.
  • Question about SUBDIRS template in qmake

    Unsolved
    2
    0 Votes
    2 Posts
    56 Views
    SGaistS
    Hi, Subdirs project are full-blown so your original idea won't work. The static libraries is the correct option.
  • Q_INCLUDE_MOC vs Q_DECLARE_OPAQUE_POINTER

    Unsolved
    4
    0 Votes
    4 Posts
    589 Views
    F
    I got into similar situation today, but I had to use Q_MOC_INCLUDE because the class is a Q_OBJECT in my case. The Qt docs suggest that Q_DECLARE_OPAQUE_POINTER is incompatible in this case. Hope this helps!
  • Drag and drop to a QgraphicsView

    Unsolved
    2
    0 Votes
    2 Posts
    57 Views
    JonBJ
    @electric-dev And what happens? Are you going to tell us whether either your dragEnterEvent() or dropEvent() are ever called? Please use the forum's Code tags (``` above & below, or the </> toolbutton) when pasting code especially for Python where indentation matters.
  • vkAcquireNextImageKHR say that Semaphore must not have any pending operations

    Solved
    1
    0 Votes
    1 Posts
    81 Views
    No one has replied
  • QPageSetupDialog not displaying, returns error

    Solved
    5
    0 Votes
    5 Posts
    320 Views
    SprezzaturaS
    Also, the "Qt...DLL" files should not be copied to the EXE directory.
  • 0 Votes
    2 Posts
    57 Views
    Pl45m4P
    @vedansh If your account was upgraded to Enterprise you need to downgrade to a free / open source license somehow. Or create a new Qt account. Best is to contact Qt sales directly.
  • How to include files from the subproject dll library in a unit testing subproject

    Unsolved
    3
    0 Votes
    3 Posts
    71 Views
    Pl45m4P
    @Stanislav228 Hi and welcome to the forum, I don't quite understand your issue. You don't need to add the EXPORT to all functions/classes of your library. You can still hide some classes or functions that you don't want in your target that imports the lib. Everything works until I add the q_decl_export directive to the classes in the dll. What should I do? What does not work then?! How do you add the import/export directives to your project? Are you using the "Qt-Global" style?!
  • 0 Votes
    15 Posts
    218 Views
    S
    To add on to this, I discovered why it was trying to insert NULL for relation fields. I did the select before setting my relations. And it wasn't enough to have a separate model load the related table. It has to be loaded in the QSqlRelationTableModel for it to work. So the very original comment here (sorry if this pings you) turned out to be 100% correct. I'm just also posting this here for future reference @JonB said in QSqlRecord forces null in composite primary key on QSqlTableModel::insertRecord: Isn't that actually a consequence of you using a QSqlRelationalTableModel? Isn't it that the Qt side expects to see in the related FoodData table/model an entry for the value of your food column in FoodDay table/model equal to it? You have "broken the contract" you establish with QSqlRelationalTableModel that Qt will see in-memory models maintaining the relationship? It is not good enough if you say the row does exist at the backend database side, if you want to use QSqlRelationalTableModel (you don't have to, it's only for value lookup) you must have the FK model/table up-to-date in memory.
  • How to exclude a specific widget from the global stylesheet?

    Unsolved
    5
    0 Votes
    5 Posts
    102 Views
    S
    You can see if any of the selectors (https://doc.qt.io/qt-6/stylesheet-syntax.html) work for you. You could create your own subclass of QPushButton. As long as all the other buttons are actual QPushButtons the class selector .QPushButton would only style these, but not your subclass. Or you could try to use a Property Selector with your own property. But I'm not sure if that works for buttons that don't have that property. (You see, it is a lot easier to just specify something for a specific button, but a lot harder to specify something for all other buttons.)
  • QSqlTableModel Network Performance

    Unsolved
    16
    0 Votes
    16 Posts
    316 Views
    Kent-DorfmanK
    Full tableview models over an internet are bad ju-ju. You should switch to a client/server transaction model. It's ok to load managable chunks into a local table presentation, but you MUST limit the number of returned rows and use indexes properly. Never blindly load a table. Doing that means you are not using the relational database properly. Only time you should ever need full table access is during maintenance as a DBA, but even then it's not strictly necessary. trying to predict and manage latency won't solve your problems. When you switch to a networked database model your access mechanisms have to allow for unpredictable latency. Some hints make sure your SQL is being executed as stored procedures on the database server where the data is hosted, not the local machine..."cloud" should make you nervous if the table data isn't stored on the same machine as the DB server. switch to a rigid transaction model rather than a table view model make effective use of proper indexing and limiting of SQL result sets Sorry to be the voice of gloom, but local DB and network are two different worlds.
  • How to force a style sheet recalculation

    24
    0 Votes
    24 Posts
    29k Views
    Pl45m4P
    @JonB Maybe even https://doc.qt.io/qt-6/qwidget.html#ensurePolished https://doc.qt.io/qt-6/qstyle.html#polish That might force the style(sheet) to update too. But usually the widget should do this when a new style(sheet) is applied.
  • Cannot install

    Unsolved
    17
    0 Votes
    17 Posts
    13k Views
    M
    Hey! If you're on windows, ensure that your date/time is up to date.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    13 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • QRemoteObjectReplica.Suspect when busy in while loop

    Unsolved
    3
    0 Votes
    3 Posts
    64 Views
    M
    @jsulm The loop has something to do with a special libusb device waiting to be established etc. I don't want to change the logic of this code (not from me). Just want to wrap the QRemoteObjectReplica class around it, call it from the connection and wait until its finished with QRemoteObjectPendingReply But i guess it works only if the function returns "immediately".
  • Qt class for Contour plots

    Unsolved
    3
    0 Votes
    3 Posts
    78 Views
    PerdrixP
    No, but I will now :). Thank you