Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Correct way of manually deleting QNetworkAccessManager

    qnetworkaccessm
    4
    0 Votes
    4 Posts
    4k Views
    M
    QObject::deleteLater() schedules the object to be deleted when there are no events related to it. So using it means "delete this object when is not used anymore". assigning to nullptr is to avoid to have dangling pointer so you can test if (manager) { // still used }
  • [SOLVED] PinchArea on top of a Flickable

    1
    0 Votes
    1 Posts
    344 Views
    No one has replied
  • Zorder. or Raise

    1
    0 Votes
    1 Posts
    299 Views
    No one has replied
  • Clearing a QTtableview

    4
    0 Votes
    4 Posts
    896 Views
    S
    You are welcome, There is another function as clear() - Removes all items (including header items) from the model and sets the number of rows and columns to zero.
  • Video timeline

    10
    0 Votes
    10 Posts
    4k Views
    G
    just for the records: my investigation into the Qt (5.5) code base and the mailing lists and fora have shown that there is no way to use the Qt APIs for my purpose. There once (5.0) was a plan to include something like QVideoDecoder in QtMultimedia, but that item has since disappeared. My solution is to wrap ffmpeg and use that
  • 0 Votes
    6 Posts
    4k Views
    sierdzioS
    You are welcome. Happy coding
  • [Solved] QML; Screen return nothing

    qml desktop android
    3
    0 Votes
    3 Posts
    1k Views
    M
    Thanks a lot! I put it in AppWindow object and it works.
  • Tool for generating statemachine images

    2
    0 Votes
    2 Posts
    834 Views
    JKSHJ
    Hi @nicesw123, that image is very old and I'm not sure if anyone even remembers which tool was used anymore. But anyway, there are plenty of tools out there which can produce state diagrams, including: Software Ideas Modeler yEd Dia
  • QTreeWidget::itemDoubleClicked signal not work...

    4
    0 Votes
    4 Posts
    2k Views
    Chris KawaC
    There's no better/worse. Both have pros and cons. Pro is it's less typing and it's type checked at compile-time. You can also connect lambdas and non-slot functions this way. Con is more typing in case of overloaded methods. You can read about it more here. There's no problem connecting this to this. I was just curious if you made an error, but if this derives from QTreeWidget then it's perfectly ok.
  • QResource::registerResource and "mapRoot"

    6
    0 Votes
    6 Posts
    2k Views
    sierdzioS
    OK, that pretty much rules out the possibility that Qt automatically picked up your resource.
  • row number is wrong in stackedwidget.

    qtcreator
    2
    0 Votes
    2 Posts
    519 Views
    simowS
    @darongyi Hi, I just downloaded your project and could instantly reproduce your behaviour. Your problem is that you added two empty pages to the stacked widget in the designer – and then – add more widgets in your CreateStackedPage() method. This results in: index 0 - empty index 1 - empty index 2 - Homepage ... So the homepage with the test label always comes at index 2. You may also want to have a look at the QStackedLayout if you just want to switch through the pages from another control like you do with your tab icons. Btw: I saw that you archived the whole git repository history. If you like you can create a github repository and I can send you a pull request.
  • How to size Label to resolution 1366 x 254

    2
    0 Votes
    2 Posts
    421 Views
    M
    Hi, you could try with; topLevelLabel.setFixedSize(pixmap.size());
  • Qt core dump after the program run hours.

    3
    0 Votes
    3 Posts
    814 Views
    M
    Hi and welcome to devnet, first step to solve the problem is to provide more information. Is your program using to many resources (for example you could have memory leaks and after a while you're not allowed to allocate more memory, ...)? There's a way to understand which line of code generated the crash? .....
  • Complete Qt5 CPackIFW example

    cmake cpack qtifw
    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Parse multiple Json

    json
    4
    0 Votes
    4 Posts
    2k Views
    M
    Hi, usually in TCP is a best practice to do one of the following: Send a header with some sync info (special values, length, ...) Using New-line for text information Are you sure there's no special character between JSON objects? Keep in mind that QJsonDocument doc(QJsonDocument::fromJson(json_data)); json_data.remove(0, doc.toJson().length()); could not work because QJsonDocument, make some formatting on the string so doc.toJSon().length() could return a value that is not the same you read.
  • How to make QTreeView and QListView use one model

    2
    0 Votes
    2 Posts
    480 Views
    sierdzioS
    Inherit from QAbstractItemModel, implement correct data() method, and all the other methods that need to be reimplemented.
  • App Store can not close my Qt application

    os x app-store
    1
    0 Votes
    1 Posts
    484 Views
    No one has replied
  • #include with the .h or without

    7
    1 Votes
    7 Posts
    5k Views
    N
    One benefit of using Qt header files without extensions is that it separates your custom header files from Qt ones in some way. It makes it more clear and clean that which header is for Qt and which one is yours.
  • 0 Votes
    1 Posts
    578 Views
    No one has replied
  • I'm new. Python or C++

    python c++
    6
    0 Votes
    6 Posts
    3k Views
    M
    If you are not interested to high performance Python is definitely simpler to learn; but this also depends to your experience (which languages do you know?). But, keep in mind that, as I said before, the official language for Qt in C++ and Python are available only using 3rdparty libraries. For the database could be interesting know if you want use a standard relational DB (SQLite, MySQL, PostgreSQL, ORALCE, ....) or something else (MongoDB, noSQL, ....). In the first case Qt offers opportunity to write write code independent of the DB using QtSql drivers; in the second case you have to use a 3rdparty library. If you need to have your application ready as soon as possible I suggest Python but if you want to learn Qt go to C++ Bye