Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • Qt Multimedia not working

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    jsulmJ
    @Padawan said in Qt Multimedia not working: I should also deselect it from qt 6.1.0 ? If you don't need it then yes
  • For QTableWidget, what's the difference of cellChanged and itemChanged?

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    Hi, cellChanged is for all QAbstractItemView classes, itemChanged is specific to the convenience views (QListWidget, QTableWidget, QTreeWidget) where you use the corresponding item classes to interact with the model.
  • Is it possible to fill color inside a bounding rectangle?

    Unsolved
    2
    0 Votes
    2 Posts
    177 Views
    jsulmJ
    @Swati777999 There are various https://doc.qt.io/qt-5/qpainter.html#fillRect methods - aren't those what you need?
  • Why mouserelease event not working on qlable

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    S
    @Pl45m4 Ha yes i was using ui->label->installEventFilter(this); in the main window .Now disabled it and mouse release event is working
  • How do you save and restore the state of QTreeView?

    Solved
    3
    0 Votes
    3 Posts
    2k Views
    D
    @JonB, look at that: void ObjectsView::makeTree() { QStandardItemModel *model; QMap<QString, QStringList*> expanded; if(tree->model()){ for (int row = 0; row < tree->model()->rowCount(); row++) { auto index = tree->model()->index(row, 0); if(!tree->isExpanded(index)) continue; auto node = tree->model()->data(index).toString(); auto trimmed = node.left(node.indexOf(' ')); auto list = new QStringList; expanded.insert(trimmed, list); for (int child = 0; child < tree->model()->rowCount(index); child++) { auto childIndex = tree->model()->index(child, 0, index); if(!tree->isExpanded(childIndex)) continue; node = tree->model()->data(childIndex).toString(); trimmed = node.left(node.indexOf(' ')); list->append(trimmed); } } tree->model()->removeRows(0, tree->model()->rowCount()); model = qobject_cast<QStandardItemModel*>(tree->model()); } .... // rest of the code .... for (int row = 0; row < tree->model()->rowCount(); row++) { auto index = tree->model()->index(row, 0); auto node = tree->model()->data(index).toString(); auto trimmed = node.left(node.indexOf(' ')); if(!expanded.keys().contains(trimmed)) continue; tree->setExpanded(index, true); if(expanded.value(trimmed)->size()){ auto list = expanded.value(trimmed); for (int child = 0; child < tree->model()->rowCount(index); child++) { auto childIndex = tree->model()->index(child, 0, index); node = tree->model()->data(childIndex).toString(); trimmed = node.left(node.indexOf(' ')); if(list->contains(trimmed)) tree->setExpanded(childIndex, true); } } } qDeleteAll(expanded.values()); } and somehow it works: [image: f615ceb4-cfe8-48d3-ab1f-89056b3d1daf.gif] Any suggestion for improvement?
  • Can't adjust font size of QGraphicsTextItem in QGraphicsRectItem

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    JoeCFDJ
    @leinad override paint and set font to painter. It will work.
  • In QTreeView, it crashes when delete the last child

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    Christian EhrlicherC
    You should check your model with the model tester: https://wiki.qt.io/Model_Test
  • Get dimensions of QMovie and setScaledSize respecting aspect ratio

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    Glad you found a solution and thanks for sharing ! Please mark the thread as solved using the "Topic Tools" button or the three dotted menu beside the answer you deem correct so that other forum users may know a solution has been found :-)
  • Widgets style is not the same as my system's style

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    SGaistS
    Even if you use a different style explicitly ?
  • Graphing in PyQT takes over whole page rather than be a standalone portion of the GUI

    Unsolved
    3
    0 Votes
    3 Posts
    241 Views
    SGaistS
    Hi and welcome to devnet, You do no integrate it at all in any other UI component hence it's shown standalone.
  • QTableView: openPersistentEditor doesn't resize

    Unsolved
    5
    1 Votes
    5 Posts
    547 Views
    B
    I'm using the latest PySide2 package available through pip: https://pypi.org/project/PySide2 which is currently PySide2 5.15.2.
  • Why does the app crashes on delete QSqlQuery*

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    D
    @JonB, later after a break, I'll try with a global QSqlQuery* again and will try to use that in other view, where I've used QSqlQueryModel testModel (in previous post), to execute multiple statements AND instead of db.isOpen(), I'll use my global isConnected to see whether it crashes with that or not.
  • Same filed names in QWizard

    Unsolved
    4
    0 Votes
    4 Posts
    332 Views
    JonBJ
    @Maluna34 I don't see why you/one would use inheritance between your pages. Not doing so would avoid the issue.
  • Best layout for a virtual pinboard?

    Unsolved
    3
    0 Votes
    3 Posts
    247 Views
    D
    That's great, thanks for the response. Yes, it looks like QGraphicsScene is the way to go- I'll have a look.
  • Connect Signal with Argument via Lambda to Slot with Argument?

    Unsolved lambda argument signal & slot cpp
    4
    0 Votes
    4 Posts
    788 Views
    BDC_PatrickB
    @jsulm & @J-Hilk Thank you so much. You´re my Heroes :D Everyday something new to learn :)
  • This topic is deleted!

    Unsolved
    5
    0 Votes
    5 Posts
    12 Views
  • Can I get rid of the *.ui files?

    Unsolved cmake code editor cpp clion-ide
    4
    0 Votes
    4 Posts
    2k Views
    BDC_PatrickB
    Thanks Guys.. helped me out alot :D
  • Does Qt not have a switch widgets?

    Unsolved
    8
    0 Votes
    8 Posts
    3k Views
    jsulmJ
    @Publicnamer said in Does Qt not have a switch widgets?: I'm trying to avoid adding layers of bloat You don't have to add it, but you can check how they implemented this control...
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    18 Views
  • NSView embed in QWidget covers other sibling widgets, why?

    Unsolved
    5
    0 Votes
    5 Posts
    477 Views
    P
    @SGaist can you help me? Thanks very much!