Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Problem to convert QImage to cv::Mat

    Solved
    3
    0 Votes
    3 Posts
    957 Views
    H
    @Bonnie you made my day ! Many thanks for your help !
  • Update QTableView when my datasource gets a new record from remote server.

    Unsolved
    3
    0 Votes
    3 Posts
    312 Views
    VRoninV
    From https://doc.qt.io/qt-5/qabstractitemmodel.html#subclassing implementation must call beginInsertRows() before inserting new rows into the data structure, and endInsertRows() immediately afterwards.
  • Align two QGraphicView widgets vertically

    Solved
    3
    0 Votes
    3 Posts
    314 Views
    M
    @JonB Oh, that was easy using your suggestion. Was hunting much more complex solutions :( Thanks much!!
  • MYSQL error in Qt

    Solved
    23
    0 Votes
    23 Posts
    3k Views
    A
    @jsulm Actually I did get it working. But then I ran into the problem that although the problem was gone, none of the sql commands would not work so I was trying to fix that. Then, I ran into a problem with the computer which meant I had to reset the computer. So now I have to do it all over again (hahaha). (I've tried all the steps I did before)
  • Big problem with QStyle

    Unsolved
    3
    0 Votes
    3 Posts
    374 Views
    T
    @jsulm Thank you, but this is good only for QStyleSheet. I would like the same for QStyle documentation.
  • Confused by QApplication::setFont(font, classname)

    Unsolved
    13
    0 Votes
    13 Posts
    3k Views
    J
    @Shiny Were you able to get the menubar/menu update their font when setting the QApplication::font()?
  • QCanBusFrame timestamp

    Unsolved qcanbusframe timestamp
    4
    0 Votes
    4 Posts
    1k Views
    aha_1980A
    I've created QTBUG-87343 to track this suggestion. Please comment and vote there. Thanks and regards
  • Avoid warning: "qt.qpa.fonts: Populating font family aliases took 20 ms." How?

    Unsolved
    1
    0 Votes
    1 Posts
    932 Views
    No one has replied
  • QVector append QString in member function crash application

    Unsolved
    4
    0 Votes
    4 Posts
    284 Views
    aha_1980A
    @ryman please do not delete posts once you received an answer - that is bad habit. Thanks and regards
  • App crashes when using 2 TableWidgets

    Solved
    3
    0 Votes
    3 Posts
    203 Views
    DriftwoodD
    @mrjj - I've decided that I'm not so far in to this that my work can be considered set in stone. So I'm going to tear it all down and start anew, learn how to properly use these Qt tools and never look back. I'll be here to ask more questions; you can count on that. But I'm done with trying to fit a size-6 shoe on a size-12 foot.
  • QPrinter, PDF and margins ...

    Solved
    5
    0 Votes
    5 Posts
    656 Views
    HoMaH
    @koahnig Thx! That is much better. The add. margins do not show up in a pdf created with QPdfWriter (everything else the same as with QPrinter in "PDF mode"). I will update my sample on GitHub - maybe others can benefit, too.
  • QListView scrolls up on list item drop.

    9
    0 Votes
    9 Posts
    4k Views
    K
    actual in qt5.11 it seem what glitch happens within QAbstractItemView::rowsAboutToBeRemoved or so... QAbstractItemView::rowsAboutToBeRemoved(parent, start, end); { Q_D(QAbstractItemView); setState(CollapsingState); .... CollapsingState... for qlistview ??? workaround for some cases class listviewscrollfix: public QListView{...} void listviewscrollfix::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) { // Q_D(QListView); // // if the parent is above d->root in the tree, nothing will happen ///QAbstractItemView::rowsAboutToBeRemoved(parent, start, end); { //Q_D(QAbstractItemView); setState(NoState);/// !!! CollapsingState ///main glitch reason // Ensure one selected item in single selection mode. QModelIndex current = currentIndex(); if (selectionMode() == SingleSelection && current.isValid() && current.row() >= start && current.row() <= end && current.parent() == parent) { int totalToRemove = end - start + 1; if (model()->rowCount(parent) <= totalToRemove) { // no more children QModelIndex index = parent; ///we dont have access to some metods so skipped // while (index != d->root && !d->isIndexEnabled(index)) // index = index.parent(); // if (index != d->root) setCurrentIndex(index); } else { ///we dont have access to some metods so skipped // int row = end + 1; // QModelIndex next; // do { // find the next visible and enabled item // next = d->model->index(row++, current.column(), current.parent()); // } while (next.isValid() && (isIndexHidden(next) || !d->isIndexEnabled(next))); // if (row > d->model->rowCount(parent)) { // row = start - 1; // do { // find the previous visible and enabled item // next = d->model->index(row--, current.column(), current.parent()); // } while (next.isValid() && (isIndexHidden(next) || !d->isIndexEnabled(next))); // } // setCurrentIndex(next); } } ///we dont have access to some metods & and our list not editable so skipped // Remove all affected editors; this is more efficient than waiting for updateGeometries() to clean out editors for invalid indexes // QEditorIndexHash::iterator i = d->editorIndexHash.begin(); // while (i != d->editorIndexHash.end()) { // const QModelIndex index = i.value(); // if (index.row() >= start && index.row() <= end && d->model->parent(index) == parent) { // QWidget *editor = i.key(); // QEditorInfo info = d->indexEditorHash.take(index); // i = d->editorIndexHash.erase(i); // if (info.widget) // d->releaseEditor(editor, index); // } else { // ++i; // } // } } ///we dont have access to some metods & we dont have hidden rows so skipped // if (parent == d->root) { // QSet<QPersistentModelIndex>::iterator it = d->hiddenRows.begin(); // while (it != d->hiddenRows.end()) { // int hiddenRow = it->row(); // if (hiddenRow >= start && hiddenRow <= end) { // it = d->hiddenRows.erase(it); // } else { // ++it; // } // } // } // d->clear();//??? // d->doDelayedItemsLayout(); } or just void listviewscrollfix::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end){} and bool SomeListModel::removeRows(int row, int count, const QModelIndex &parent) { if (parent.isValid()) return false; ... for (int i = 0; i != count; ++i){ ... beginRemoveRows(parent, row, row); someitemcontainer.removeAt(row);//for small listst it will be ok 1 by 1 endRemoveRows(); dataChanged(index(row),index(row));//scroll glitch workaround...dont ask why so...//for update scrollbar max value ... } return true; }
  • QGraphicsScene frame rate throttling / coalescing?

    Unsolved
    6
    0 Votes
    6 Posts
    478 Views
    D
    no, i want to know what the spec is for Qt's refresh rate. if i have a dozen timers each firing separately, possibly at different frequencies, possibly drifting, calling present() whenever they fire, does QGraphicsScene do coalescing? I know that macOS has coalescing but doe Qt?
  • Map based application (QSslSocket::connectToHostEncrypted)

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    M
    I installed Openssl from this .msi installation and it fix the same issue for me: http://slproweb.com/products/Win32OpenSSL.html
  • call function when close second windows

    Unsolved
    2
    0 Votes
    2 Posts
    169 Views
    SGaistS
    Hi and welcome to devnet, You are modifying the wrong part of the code. The Ui_XXX classes are generated based on the .ui file you created with designer. They are not even widgets. You need to modify the widget code that uses the Ui_XXX classes.
  • How to find a widget through QApplication::instance()?

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    M
    @Bonnie Thanks for your answer!
  • I don't know why QTimer don't work, I think I did this good.

    Solved
    5
    0 Votes
    5 Posts
    306 Views
    mrjjM
    Hi Without code, we have to use the crystal ball... I would guess on your QTimer object maybe runs out of scope? Do you new it?
  • QT compile Mac App with Circle and Slash over App Icon

    Solved
    5
    0 Votes
    5 Posts
    285 Views
    S
    ISSUE RESOLVED. Even though visually, everything looked correct in the Info.plist, I trashed and redid it from scratch, and now it compiles find, showing the proper app icon and running as expected.
  • QTextDocument: Style vs. Attribute

    Solved
    4
    0 Votes
    4 Posts
    220 Views
    HoMaH
    Rtfm, I get it. There it says „block attribute“ align is supported. But text-align not ... Thx and sorry...
  • QPrinter, PDF, margin issue

    Unsolved
    2
    0 Votes
    2 Posts
    223 Views
    K
    @HoMa I see the same reasoning as in https://forum.qt.io/topic/119833/font-size-in-qprinter/2