Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • 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
    240 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
    782 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!
  • How to show uncommitted records of SQLite in QTableView and save/commit later?

    Solved
    8
    0 Votes
    8 Posts
    645 Views
    D
    No idea how it's fixed automatically! In the original posit I'd this if(model->lastError().type() != QSqlError::NoError) instead of ... testModel.lastError().type() ... and emit ... QString::number(model->rowCount()) + " row(s)"); due to copy/paste BUT those were changed long before and the private model/QTableView on the right pane kept getting cleared even after correction! After a break, I just hit Ctrl+R and executed same set of statements and the private model/QTableView doesn't get cleared anymore even if I have those copy/paste errors in my code.
  • Decreasing the size of QCalendarWidget

    qcalendarwidget
    2
    0 Votes
    2 Posts
    2k Views
    V
    To decrease the size of QCalendarWidget you have to find the QTableView inside QCalendarWidget and then set the headers size to zero (or any size you want). You can also set the font size to a small (but visible) value. In the following code cal is a pointer to QCalendarWidget QTableView* calendarView = 0; for(auto i : qAsConst(cal->children())) { calendarView = dynamic_cast<QTableView*>(i); if(calendarView) { qDebug() << "View Found"; QHeaderView* hh = calendarView->horizontalHeader(); QHeaderView* vh = calendarView->verticalHeader(); QFont font = calendarView->font(); font.setPointSize(8); calendarView->setFont(font); hh->setMinimumSectionSize(0); vh->setMinimumSectionSize(0); } }
  • Qpainter drawing semi-transparent line, transparence changes when overlapping

    Unsolved
    2
    0 Votes
    2 Posts
    477 Views
    I
    [image: c0670d4c-398a-4e4c-98ed-7d1cd88a046e.png] This is the main part of my code. I want to use drawline in Qpainter to draw the semi-transparent line, but it does not give me the correct effect.
  • Qmake include order

    Unsolved
    3
    0 Votes
    3 Posts
    423 Views
    D
    I guess the problem is that rather than putting the Qt6 include locations first (specified by Qt Creator), it puts the Qt5 ones first (specified by a separate include folder of vcpkg that also has QtCore(qt5) as well as the library I actually want to include (zeromq). This is causing Qmake to find the Qt5 files first on things that are not included in the .pro file. By that I mean things like QtGui and Qt Widgets end up coming from Qt6, and other things inluded by QtWidgets end up coming from the Qt5 (obviously not desired). This is fixed if I manually change the order of INCPATH in the makefile.debug. If QMake instead put it's own includes first, or at least in the order they appear in the .pro file, then there would not be a problem. Does this make sense? As it is now, it appears that QMake put's things like the include directory for QtCore (-IC:\Qt\6.2.1\msvc2019_64\include\QtCore in my case) at the END of the includes, even if I explicitly include it at the beginning of my .pro file.
  • How to generate xcode project for ios?

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    SGaistS
    It's doesn't change the fact that you need an iOS build of Qt.