Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • QT source code build keep fail in randomly with no error

    Unsolved
    3
    0 Votes
    3 Posts
    358 Views
    L
    @Axel-Spoerl I didn't copy a snapshot of the failure because it wasn't informative. It only shows the "FAIL" in red and the file name and path without any information. I will try without AV. I will try again soon and will share the output. If I cancel the parallel flag, it fails fewer times. If the build finishes successfully after restarting the compilation server multiple times, is it OK?
  • 0 Votes
    2 Posts
    193 Views
    JonBJ
    @Gabber I don't know, but if it were me I would do some more tests and make your code 100% consistent. In gSourceModel() what you actually do is call fetchMore() until the table is full. Does it get called (i.e. are there > 256 rows so that it needs to fetch more)? If so that leaves the table in a different state from your commented out line // m_sourceModel->select(); //If this enable all works as aspected since that call will only fetch some of the rows, and will affect its choice of value for sourceRows. Compare that value with and without your commented line. Change code to either do or not do the fetchMore() in both places. Remove the fetchMore() if it is not needed while debugging this. Remove your filterModel while debugging this, in case it interferes. Reverse the order you add to relational model followed by adding to source model, any difference? Move the code from addNewName() to, say, gSourceModel() and do it directly there so we are 100% sure we know what state we are in. Remove the query in addNewName() --- just look at what the highest Id is externally and hard-code that value without querying while you test. Those will do for a start! Let's get some answers before proceeding further.
  • QSplashScreen, center pixmap

    Solved
    8
    0 Votes
    8 Posts
    652 Views
    SPlattenS
    @Axel-Spoerl , @SGaist , fixed! the issue was solved by adding this to the bottom: //Get central widget QWidget* pobjCentral(centralWidget()); //Set the layout pobjCentral->setLayout(pvboxLO);
  • Context menu on QTreeView item?

    Solved
    5
    0 Votes
    5 Posts
    909 Views
    R
    Thanks, folks. That worked fine.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    44 Views
  • fatal error: QStringRef: No such file or directory

    Unsolved
    5
    1 Votes
    5 Posts
    1k Views
    V
    What I did is I installed the Qt5 as I wasn't able to get away with the error /home/devansh/repo/src/libs/languageserverprotocol/jsonkeys.h:6:10: fatal error: QLatin1StringView: No such file or directory 6 | #include <QLatin1StringView> | ^~~~~~~~~~~~~~~~~~~ compilation terminated. [76/2753] Building CXX object src/libs/extensionsystem/CMakeFiles/ExtensionSystem.dir/pluginmanager.cpp.o ninja: build stopped: subcommand failed.
  • Building Qt Creator from source

    Unsolved
    17
    0 Votes
    17 Posts
    4k Views
    J
    j@j-BOHB-WAX9:/$ find / -type f -name qtcreator 2>/dev/null /home/j/Downloads/qtcreator_build/bin/qtcreator
  • QGraphicsScene mousePressEvent event passing problem

    Unsolved
    4
    0 Votes
    4 Posts
    342 Views
    Pl45m4P
    @alvazz said in QGraphicsScene mousePressEvent event passing problem: void AItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { qDebug() << "A Item Pressed!"; } QGraphicsScene::mousePressEvent(event); } Is this your actual code? Used my own test case... You cant call the protected QGraphicsScene::mousePressEvent from a QGraphicsItem. It should be QGraphicsItem::mousePressEvent Besides that, I still cant reproduce... If I click item A, I get "A Item Pressed!" and B, when B is clicked, never both. Show your full code please or if possible make a short GIF/video that illustrates what you are doing [image: a8abd771-fbae-4bdf-8638-f800b65bd22b.gif]
  • Qt6 how to load qml sources at runtime

    Unsolved
    5
    0 Votes
    5 Posts
    675 Views
    D
    @Axel-Spoerl , fyi I got a reply in my bug report that got this working for me. The details are in the ticket, but the magic step is to manually remove the 'prefer' line from MyModule/qmldir in the build directory.
  • Dont know how to build QuaZip. Please help.

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    veryqtpersonV
    In short, you would just add the following right after project() in your CMakeLists.txt: set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED YES) Recent versions of MinGW should be C++17-compliant, so you can probably continue using that, although on Windows I'd recommend using MSVC or maybe Clang. On GNU/Linux the most common choice would be GCC or yet again Clang.
  • Mixing OpenGLFunctions and QPainter in QOpenGLWidget

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    S
    @OkTerrific said in Mixing OpenGLFunctions and QPainter in QOpenGLWidget: Is there an alternative to QOpenGLWidget that you would recommend for rendering with OpenGL in Qt? Well.. theres the QGLWidget and QGLWindow both now deprecated. Then there's the QOpenGLWidget and QOpenGLWindow. I Suppose it comes down to whether you need to compose the OpenGL rendered content with other widgets in the UI. I haven't tried the QOpenGLWindow myself but the QOpenGLWidget has absolutely terrible performance. So what I've ended up using myself is just a QWindow since it implements a QSurface. Then I create the context myself and makeCurrent with the QWindow. Finally I place the QWindow inside a widget with QWidget::createWindowContainer. In my tests this is an order of magnitude better in rendering perf vs. QOpenGLWidget but the caveat is that the Qt compositing is a bit broken so things such as Qt context menus won't work. Neither can you place any other widgets inside the QWindow. Long story short, I can't tell you to use any specific way, there are just too many issues here and it all depends what you want to do. VSYNC is also another related issue and a total PITA.
  • QTConcurent and lambda in QT6

    Solved
    23
    0 Votes
    23 Posts
    3k Views
    Christian EhrlicherC
    @JulsPower said in QTConcurent and lambda in QT6: then I cannot see a usage for future then function The documentation has a nice common use case for it.
  • How to keep track of real time ?

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

    Unsolved
    6
    0 Votes
    6 Posts
    38 Views
  • How to prevent Qt child windows from inheriting the style of the parent window?

    Unsolved
    3
    0 Votes
    3 Posts
    372 Views
    IPlayGenji6I
    Add the property parentName to all your QPushButton elements in parentWidget, and set the value to "parentWidget" for each of them. QObjectList buttons = ParentWidget->findChildren<QPushButton*>(); for (QPushButton* button : buttons) { button->setProperty("parentName", "parentWidget"); } in qss: QPushButton[parentName = "parentWidget"] { background: #123456; } [image: 39bfa2b3-660b-414a-acae-28f849731bcd.png]
  • 0 Votes
    13 Posts
    2k Views
    8Observer88
    @Chris-Kawa please, help me with building for Android
  • mac: QTabWidget with large icons: how?

    Solved
    10
    0 Votes
    10 Posts
    2k Views
    D
    @Ans1 i do not know if this helps, but here's my init code: void QtDlgTabs::Panel_Setup() { CDialog* dlgP(GetDialog<CDialog>()); QListWidget *listP(dlgP->QtGetItem<QListWidget>(Dlg_Tabs_ICON_BAR)); Rect iconR = { 0, 0, 64, 64 }; CPixels pix(iconR); ScCGContext context(pix); Qt::ItemFlags flags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); float scaleF(devicePixelRatio()); // doesn't work pix.setDevicePixelRatio(scaleF); static int s_awidthI = 61; static int s_heightI = 50; int s_widthI = 150; bool is_prefsB(dlgP->GetPanelSet() == PrefPanelSet_PREFS); if (is_prefsB) { s_widthI = 70; } int widthI = s_widthI; if (is_prefsB) { if (dlgP->GetAllControlsVisible()) { widthI = s_awidthI; } } listP->setGridSize(QSize(widthI, s_heightI)); PrefPanelSet panelSet(dlgP->GetPanelSet()); SInt16Vec& panelVec(GetPanelVec(panelSet)); for (SInt16 indexS: panelVec) { PanelRec& curPanel(*GetIndPanelRec(panelSet, indexS)); QListWidgetItem *listItemP(new QListWidgetItem()); SuperString nameStr(GetLocalizedPrefPaneName(panelSet, curPanel.prefPanelS)); SDB_SourceType iconType(static_cast<SDB_SourceType>(curPanel.sourceType)); QFont itemFont(listItemP->font()); pix.clear(); gApp->Draw_icns(&context, iconType, iconR, kTransformNone); itemFont.setPointSize(itemFont.pointSize() - 1); listItemP->setFont(itemFont); listItemP->setText(nameStr); listItemP->setIcon(pix); listItemP->setFlags(flags); listP->addItem(listItemP); } }
  • 0 Votes
    10 Posts
    2k Views
    C
    @Pl45m4 said in QTreeView child of QMainWindow not resizing with main window: Remove the current layout and the ElementView. Drag a new ElementView straight on the centralWidget and then rightclick and "lay out". I was doing this, but I misinterpreted what the rightclick applied to. I thought it applied to the new Element View I dragged onto the centralWidget, and its "Lay out" menu had most everything disabled. When I tried rightclicking on the centralWidget outside of the ElementView, its menu had the selections all available. All is working now and I have removed my resizeEvent(). @Pl45m4 and @JonB - All comments are much appreciated!
  • Unable to build from source in debug config

    Unsolved
    1
    0 Votes
    1 Posts
    265 Views
    No one has replied
  • I have a problem with QTabWidget

    Unsolved
    4
    0 Votes
    4 Posts
    276 Views
    SGaistS
    @HelpForTabWidget not directly no. As @Christian-Ehrlicher suggested, it looks like a QToolBar.