Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Mac In app purchase

    Solved
    9
    1 Votes
    9 Posts
    1k Views
    O
    While i installing Qt on my Mac i saw Qt is supporting in app purchase on Mac Os [image: V2Q4wSI.png]
  • Threaded OpenGL rendering, multiple QOpenGLWidgets with same parent

    Unsolved
    1
    0 Votes
    1 Posts
    756 Views
    No one has replied
  • Building static library doesn't merge the static libraries depends with it on Ubuntu

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    C
    If you're looking to create "one library and in the darkness bind them" ;) - you want to archive the dependent libraries into yours. Unlike with shared libraries, a static library is a loose collection of object files - this means that when your library code referencing other libraries - whoever uses your library is expected to have those other libraries as well. On *nix systems you can have accomplish this with a 'post link' (even though there's no actual linking) via something like: QMAKE_POST_LINK += libtool -static -o $$DESTDIR/myaggregatedsdk.a $$DESTDIR/mysdk.a $$PWD/../dependencies/libs/libsomeotherlibrary.a $$[QT_INSTALL_LIBS]/libQt5Core.a That made up example combines your sdk library, some other library, and just as an example of something a bit more advance - how to aggregate a Qt static library into your library (if you have build the static libraries.) On Windows using Visual Studio's nmake system - it's slightly different - you don't do it after you build, instead you pass some flags to nmake and it does it during the build process: QMAKE_LIBFLAGS += /OUT:$$TARGET "$$PWD/../dependencies/libs/somelibrary.lib" "$$[QT_INSTALL_LIBS]/Qt5Core.lib" "$$[QT_INSTALL_LIBS]/Qt5Network.lib" Be careful doing this type of thing though because you'll likely need to have many versions of your library available (especially on Windows.) There's a reason that this is an unusual request - and sometimes it's the right thing to do, but if you're not ABSOLUTELY certain you need to do this - then you should avoid it and go one of two ways. Either stick with providing your static library and listing the other libraries as dependencies that others must obtain in order to build - or build a shared library (which is quite often the best solution.) Sometimes, when building an SDK, you must support all forms though (which is why I had to do this myself once.) Hope this helps.
  • How to Query (join) two tables from two different sqlite databases?

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    fcarneyF
    I got to thinking about this and realized this might be a really good use of a temporary memory database. You could: query the tables of each respective database create a temporary memory database in sqlite create 2 tables from each query of each respective table do a join query on the two tables use the data delete the temporary memory database The neat thing is this should work regardless of the features of the source databases. They could even be completely different types of SQL (or even non sql) databases. One database to join them all and in the memory bind them...
  • undefined reference to qt_static _plugin

    Unsolved qt 5.5 static plugin
    14
    0 Votes
    14 Posts
    7k Views
    Ni.SumiN
    If it's solved, Please set it to "Solved" from unsolved.
  • How to encapsulate ui form inside another

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    P
    Ok, solved that issue. I've made an error, I can promote mainwindow.ui 'dropped' widget to another widget class and controls are loading properly :) The only flaw it has is that promoted widged isn't visible in mainwindow.ui.
  • How do I set some characters bold in QTableWidgetItem?

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    VRoninV
    @dheerendra said in How do I set some characters bold in QTableWidgetItem?: User your own Custom delegate. https://pastebin.com/XrppLZ3m
  • How to get QTableWidgetItem's text when it is editing?

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    mrjjM
    @Limer Hi For my test code, the value is saved when button clicked as button takes focus and editor then saves losing focus. However when using m_okBtn->setFocusPolicy(Qt::NoFocus); it means it will not take focus then and editor won't save then as editor won't lose focus then. If really need noFocus on the buttons, i think we can find another way to have it save.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    13 Views
    No one has replied
  • Video record from camera

    Unsolved
    4
    0 Votes
    4 Posts
    590 Views
    T
    Hi,@Bharth video recording did not happen to me on windows for some reasons but on Linux systems using Qt, you can test and develop video recording it. these may help: https://forum.qt.io/topic/74588/record-sound-and-video-using-qmediarecorder https://forum.qt.io/topic/97786/unable-to-run-qt-camera-example-on-qt-5-9-1
  • layout resizing for loadingbar

    Unsolved
    15
    0 Votes
    15 Posts
    2k Views
    D
    yes setted foreground widget as transparent,,,now foreground is resizing but background widget is not resizing?
  • DockWidget resize error.

    Unsolved
    4
    0 Votes
    4 Posts
    524 Views
    jsulmJ
    @Pada_ Then you should show the code.
  • QVector of Classes Example

    Solved
    2
    1 Votes
    2 Posts
    327 Views
    dheerendraD
    Cool. This is nice to know. Thanks for the contribution to community.
  • How to know "what changed" in QSyntaxHighlighter::highlightBlock() method?

    Unsolved
    1
    0 Votes
    1 Posts
    225 Views
    No one has replied
  • Understanding the need for Proxy Models

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    Chris KawaC
    @RaisinBread22 Basically you've got 4 layers: data source: the actual non-Qt data, be it some database, network storage, your own structure or whatever data access model : class implementing QAbstractItemModel e.g. QStandardItemModel or QSqlQueryModel filtering and sorting: class implementing QAbstractProxyModel e.g QIdentityProxyModel or QSortFilterProxyModel view: ui classes implementing QAbstractItemView e.g. QListView or QTreeView With that you can build hierarchies like this: sort/filter - view / data src - data access - sort/filter - view \ sort/filter - view \ view If I understand you correctly you're asking about doing something like this (without the proxies): data access/sort/filter - view / data src - data access/sort/filter - view \ data access/sort/filter - view \ view And you can do that if you want, but that means you'd need to manually synchronize all the models, which will get messy if you combine it with the sorting/filtering code. Proxy models are convenience classes that help you separate these tasks better, as the synchronization is automatic because there's only one data access model underneath. Also consider models that initialize some sort of resource to access the underlying data (e.g. establish database connection). It could be expensive to copy them around.
  • Write Qt code once and compile it on many platforms

    Solved
    17
    0 Votes
    17 Posts
    2k Views
    tomyT
    @aha_1980 Thank you. I suppose I'd better get back to the plan B. ;)
  • Why do you always encounter this kind of mistake and how to prevent it?

    Unsolved
    2
    0 Votes
    2 Posts
    345 Views
    VRoninV
    Looks like the compiler does not use the same text encoding as the editor. Make sure they are both set to use UTF-8. The editor: http://doc.qt.io/qtcreator/creator-editor-options-text.html#file-encoding The compiler depends on what you are using
  • QtRO - few RO with many properties vs many RO with few properties

    Unsolved
    5
    0 Votes
    5 Posts
    499 Views
    W
    @dheerendra I totally agree concerning the sensor type approach, that is standard object approach. But I wonder if it would be better to have one RO that holds a list of TempSensors, a list of PressureSensors etc. or to have each and every sensor be its own RO. I guess that one approach will have better performance than the other. for info, the client app will use the RO directly in QML. In one case we will have more info to be transmitted in one connection and in the other we'l have more connections. Any idea which is the better one?
  • UDP Socket - writeDatagram uses IPv6 and not IPv4

    Solved networking sockets ipv6 ipv4
    8
    0 Votes
    8 Posts
    3k Views
    P
    @aha_1980 said in UDP Socket - writeDatagram uses IPv6 and not IPv4: Then why not use QHostAddress::AnyIPv4 ? Looks more clear to me... Learn something new everyday :)
  • Changing QMouseEvent position

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    J.HilkJ
    @etiennedm I'm more thinking along the following line. you have 2 QPushButtons next to each other, seperated by (let's say) 10 px. The left one goes a page back and the right one a pge forwards ( in example a QStackedWidget). Now you have an offset of 50 in x direction. Now you press the touch screen, your calculation pushes the new postion to the forwards button, but physically QCoreApplication registered the back button as receiver object. As a result, your touchinput is ignored.