Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Set QComboBox popup's size

    Solved
    3
    0 Votes
    3 Posts
    249 Views
    MykolaQtM
    I found the solution! void ComboWithElision::showPopup() { view()->window()->setFixedWidth(100); QComboBox::showPopup(); } so the solution is view()->window() instead of view()
  • SSL Handshake failed with rest API

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    M
    Hello, Thanks for the link. It helped me. But, in my case, I've used the solution given here and the problem was fixed. Regards.
  • How to insert/delete row in Qtableview faster?

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    JonBJ
    @n-2204 said in How to insert/delete row in Qtableview faster?: for this i have to store the spinbox number ? to check its increased/decrease ? If you really need to. However, in the value changed you can simply look at the new value, call rowCount() to get the current number, and insert/delete the difference, can't you?
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    23 Views
  • How to write another Thread data in txt file?

    Unsolved qtimer qthread qt5 c++
    4
    0 Votes
    4 Posts
    1k Views
    jsulmJ
    @duckrae said in How to write another Thread data in txt file?: How can I handle it? Simply emit the signal: QTimer *timer = new QTimer(this) timer->start(60000); emit myTimeoutSignal(text);
  • Why qt draws sub widget on super bottom not on native nsview

    Unsolved
    1
    0 Votes
    1 Posts
    143 Views
    No one has replied
  • ptrinting content in text edit

    Solved
    3
    0 Votes
    3 Posts
    258 Views
    K
    @jsulm thank you so much it works :)
  • How to alter perimeter around a QTableWidget cell?

    Unsolved
    7
    0 Votes
    7 Posts
    605 Views
    mrjjM
    Hi Premature optimization is also a topic you should consider. Stylesheets are not inherently slow but if overused can become heavy. They are parsed on load and values are set to internal structures used by QStyle. So its not Interpretered over and over.
  • What about legality when copying the idea or design of Qt?

    Solved
    3
    0 Votes
    3 Posts
    253 Views
    jsulmJ
    @jronald said in What about legality when copying the idea or design of Qt?: view/model Qt did not invent model/view pattern to my knowledge. It is a modified model/view/controller design pattern which is not patendet ot something, so everyone can implement it.
  • Read In and Print .dat file

    Unsolved
    6
    0 Votes
    6 Posts
    628 Views
    C
    @WesLow said in Read In and Print .dat file: does this code look fine? Not really. Quite apart from the file not containing what you expect (as others have said), this could be failing because the file is not found or not openable. You should at least check the return value from QFile::open(). If that is false then QFile::exists() and QFileInfo::absoluteFilePath() could be useful to understand why.
  • can't emit a signal from a Thread that is inside of another Thread in QT(GUI)

    Unsolved
    19
    0 Votes
    19 Posts
    2k Views
    KroMignonK
    @solidtyper said in can't emit a signal from a Thread that is inside of another Thread in QT(GUI): however i find it not very efficient. How many sockets do you want to handle? Are you really sure that using multiple thread will increase application performances? If you want to do multi-threading, please take this hints in account: avoid creating too many threads, the best is not to create more than your CPU has core (cf QThread::idealThreadCount()) override QTcpServer::incomingConnection() to be able to create a QTcpSocket instance and move it in the working thread (as descibred in https://wiki.qt.io/WIP-How_to_create_a_simple_chat_application)
  • can't emit a signal from a class, error: LNK2019: unresolved external symbol

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    S
    @mchinand what i meant is that it might have something under the hood, IDK but it's acting very different. but i'm noob at this i might be wrong. anyhow. i deleted that class definetly and add the properties directly to the thread i tried to send the signal to. it was only for categorizing methods, nothting else. thank you BTW
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    55 Views
    No one has replied
  • Using GLES2 in QT?

    Unsolved gles2 qopenglwidget gl context
    1
    0 Votes
    1 Posts
    598 Views
    No one has replied
  • Using ChartView for real time plotting

    Unsolved
    2
    0 Votes
    2 Posts
    181 Views
    M
    Are you updating the axis as well when you update the data? I've done some real time plotting and while I don't find QtCharts to be that intuitive, once I figured it out it was really very nice.
  • 0 Votes
    8 Posts
    620 Views
    ?
    Thank you very much for your explanations and your support.
  • blocking read of QUDPSocket

    Unsolved
    2
    0 Votes
    2 Posts
    378 Views
    AxelViennaA
    waitForReadyRead() basically holds your application until the UDP packet you are awaiting is ready to be read out of the buffer. Note that you “are sending to the event loop” already in this case. You are just blocking it in order to wait for an external condition to be met. Taking that risk may just fail in Windows (i.e. you loose the packet) but also cause misbehaviour on other platforms (you can wait forever). It can still be useful for small, technical applications which you just kill if they hang. Connecting your read method to the readyRead() signal is the robust way of implementation. It does not block the event loop ans reads your UDP stream in the right order.
  • Qt method to learn how many cores, other CPU characteristics

    Unsolved
    11
    0 Votes
    11 Posts
    3k Views
    mrjjM
    @Publicnamer Hi That library has a C API and is from 2015. Qt threading support is at a much higher level of abstraction than this and would really be a downgrade in many use cases. But nothing stops you from using it in Qt if it provides some information you find useful. That said, did you try (c++ 11) #include <thread> auto processor_count = std::thread::hardware_concurrency();
  • Problems with QSqlTableModel

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    D
    Hi, @JonB said in Problems with QSqlTableModel: in particular a particular thread showing a working example using a proxy model ... I tried that code and it turned out, that it is the same as the model I already have (subclass of QAbstractItemModel). QAbstractProxyModel is a subclass of QAbstractItemModel, so ... My question was, whether it is possible to create a model suitable for treeview as a child of QSqlTableModel. Apparently it is not possible. Proxy uses a QSqlTableModel - as I do with my model - so nothing new in that linked thread. I changed my editor to use insertRecord and setRecord only. No things seem to work. For me, this usecase was not obvious from documentation. @JonB said in Problems with QSqlTableModel: Lots of people us SQLite without problem. Apparently I'm not cute enuf. ... any way: thank you for your attention and support!
  • QPrinter doesn't print with colors.

    Unsolved
    4
    0 Votes
    4 Posts
    515 Views
    artwawA
    @HenkCoder Try simple check. I assume that by TextEdit *edit{getTabTextEdit()}; you get the QTextEdit instance from the Ui, right? So I'd check acceptRichText() and the flags from autoFormatting(). Also doing qDebug() << edit->toHtml(); will show you if formatting tags are present. On logic if you see rich text in the Ui it should also get printed, unless you mismatched printer settings or something.