Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • How to divide a project? (For readability)

    Unsolved c++ qmainwindow project management
    7
    0 Votes
    7 Posts
    2k Views
    fcarneyF
    Seperation of Concerns (SoC): https://en.wikipedia.org/wiki/Separation_of_concerns There are design approaches that go further, but SoC is a good place to start.
  • Should I manage my data in-memory or use SQLite?

    Unsolved
    6
    0 Votes
    6 Posts
    3k Views
    fcarneyF
    I have used SQLite successfully in python applications. It is a very convenient data format. In python I used SQLAlchemy which abstracted the database to not have to deal with queries directly. I have not used the SQL interface in Qt, but it does look like it abstracts at least the different database types just like SQLAlchemy does (at least the Qt 5.12 docs show this), but it looks like you have to deal with queries still. Anyway, you don't have to choose JSON or not JSON. Just store your sub JSON objects in the database and reassemble into higher tier objects. Or if it works out store the whole thing as a database entry. You might also consider abstracting how you communicate with the data store (file) so that QSortFilterProxyModel does not know which format you are using. This might give you more flexibility if you choose another format. Not sure if that makes sense. Since you are considering SQL can I assume your data format lends to the layout of a database well? So each note could be a database table entry? JSON I think has more flexibility than SQL for structure if I remember right. For me, I have had many positive experiences with SQLite as a datastore. It is nice and contain just about anything, like blobs of binary data if you really wanted. I just like it. I am biased.
  • QPrinter initialization

    Unsolved
    6
    0 Votes
    6 Posts
    918 Views
    mrjjM
    @mads-l Hi You can check out what QPrintDialog does via https://code.woboq.org/qt5/qtbase/src/printsupport/dialogs/ all code is hot linked so its easy to navigate.
  • Send multipart/form-data json to webserver using cUrl

    Unsolved
    9
    0 Votes
    9 Posts
    2k Views
    darongyiD
    @darongyi If any idea, leave comment. I decide to use qnetworkaccessmanager. Thank u all.
  • QScrollBar setStyleSheet please..

    Unsolved
    2
    0 Votes
    2 Posts
    362 Views
    Pl45m4P
    The scrollbar inside the QGraphicsView is inherited from QAbstractScrollArea, which "provides a scrolling area with on-demand scroll bars." QAbstractScrollArea Qt Doc I think you have to override your QGraphicsView to create a custom QAbstractScrollArea with your custom QScrollBar design, in fact that you can not just change the design (CSS) of the ScrollBar provided by your QGraphicsView (correct me if I'm wrong). QAbstractScrollArea StyleSheets QScrollBar StyleSheet
  • Add Item to QComboBox

    Solved
    12
    0 Votes
    12 Posts
    4k Views
    ODБOïO
    @VRonin every time im trying to past only part of code that may cause the problem, thats why there is no layouts and dtor @Christian-Ehrlicher said in Add Item to QComboBox: Your testapp works very fine apart from the missing dtor and semicolon after the connect. My misstake was to create my Widget on the heap inside the ctor of another 'main' widget... MainW::MainW(QWidget *parent) : QWidget(parent) { Widget *w = new Widget; WidgetForce *wf = new WidgetForce; } ... //main.cpp MainW mw; mw.show() I moved it (Widget w) as member to solve this issue. Thank you all and sorry for not being explicit about this from the beginning
  • QGraphicsView & Scene update error.

    Unsolved
    2
    0 Votes
    2 Posts
    243 Views
    dheerendraD
    It is not a problem. We need to see what you have done. Can you give some simple sample to check the behaviour ?
  • QQuickWindow in 5.12

    Solved qquickwindow mac os x qt 5.12
    22
    0 Votes
    22 Posts
    7k Views
    J.HilkJ
    A quick and final update: https://bugreports.qt.io/browse/QTBUG-72641 The topic was reopened - in no small part due to @Kalileo I believe ;-) - and the error seems to be found and fixed. The fixed version seems to be the upcoming 5.12.1 and onwards. Thanks everyone for the interest and help in the issue.
  • Emit signals too frequently can eat up the memory?

    Solved
    3
    0 Votes
    3 Posts
    632 Views
    J.HilkJ
    @jsulm I hadt to be reminded myself, but that is not true. You can not reacte to signals in that thread, that has the while loop running. But you can send (emit) signals to other threads and process them in slots there without problems. @Mr-Pang and, that can be a problem. Even more so, when your signal has arguments, as the data from that argument has to be copied for each signal that is emitted. If no argument you still have some memory allocated for each signal Signals are not simply forgotten, they are queued up to be processed in the next eventloop cycle. That means the while-loop may create thousands of signals for the other thread, while the other threas had no chance to process any. During processing the signals new signals are emitted and queueud as well. So this can and will run out of controll quickly.
  • Help,coredump analyze

    Unsolved
    4
    0 Votes
    4 Posts
    471 Views
    dheerendraD
    Yes it is very random & my usual suspect is QString variables only. You should opt some work-around for these QString variables.
  • 0 Votes
    1 Posts
    336 Views
    No one has replied
  • Qt5.12.0 QMYSQL plugin

    Unsolved
    21
    0 Votes
    21 Posts
    5k Views
    D
    @SGaist said in Qt5.12.0 QMYSQL plugin: source Thanks for the help. The current out of source build is missing the following modules/plugins webenginewidgets positioning webview Can you please point me to a linux version with sql, webenginewidgets, positioning and webview plugins that I can re-install?
  • How to set a nice app picture to my Android program

    Solved
    7
    0 Votes
    7 Posts
    862 Views
    SGaistS
    Hi, Sorry I didn't manifested myself. I did it based on the @tomy's answer to @sierdzio suggestion.
  • Can mainwindow be the password input window ? what problems will it have?

    Unsolved
    3
    0 Votes
    3 Posts
    283 Views
    SGaistS
    Hi and welcome to devnet, As @mrjj wrote, it should not get you any problem. However, the question would rather be why use a QMainWindow for such a task ? It's not really the correct tool.
  • Qt Creator auto completion problem

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    aha_1980A
    @jronald I guess the root cause for that is the same as for QTCREATORBUG-21767, so you could track that too.
  • What is the correct way to show only one instance of QMdiSubWindow?

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    mrjjM
    Hi Instead of "close", should I just hide the subWindow when the "X" button is clicked? How do I achieve this? class MyQMdiSubWindow : public QMdiSubWindow { Q_OBJECT protected: void closeEvent( QCloseEvent *closeEvent ) { closeEvent->accept();// eat event hide(); // just hide it } }; and the logic is then (still) void MainWindow::on_pushButton_released() { if (!mywin) { // create instance if not have one already mywin = new MyQMdiSubWindow(); ui->mdiArea->addSubWindow(mywin); } // all other cases we just call show again. mywin->show(); }
  • Exceptions and its messages

    Unsolved
    2
    0 Votes
    2 Posts
    715 Views
    Christian EhrlicherC
    @AndrzejB said in Exceptions and its messages: I must subclass QException? How, this way Yes
  • Can I resize the form I am currently in?

    Unsolved
    3
    0 Votes
    3 Posts
    310 Views
    mrjjM
    Hi Just as a note. if you only want to change the height and width then resize(x,y) could be used.
  • Can Qt access EGL through a static library?

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

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied