Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Problem with Ui::Dialog not recognized

    Unsolved
    8
    0 Votes
    8 Posts
    739 Views
    JonBJ
    @auvonspam said in Problem with Ui::Dialog not recognized: The instructions say the 1st one should load the data. And it does. But why not the 2nd one, too? You are aware that in the first instance you push a button to tell it to load the data from file and push to shared memory while in the second instance you push a different button telling it to read from the shared memory? As for which of the two dialogs you click first or second that should not matter. Just you need to load from file to memory before you try to read from memory.
  • "No such file or directory" error qrc

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    jsulmJ
    @AstroFinch said in "No such file or directory" error qrc: needed to be listed as an executable It is not listed as an executable (your executable is named "test"). It is listed as a source item to build your executable (just like main.cpp).
  • QGraphicsView + QChart with explicit plotArea: Cannot set background brush

    Unsolved
    3
    0 Votes
    3 Posts
    328 Views
    U
    If I don't set an explicit plotArea, setting the QChart background will work as intended, so I don't think it's colliding with QGraphicsView's background per se. Btw in my application I'm also setting the QGraphicsView background explicitly, but the problem occurs either way.
  • 0 Votes
    18 Posts
    2k Views
    Z
    @Kevin-Hoang Hi,i tried to call QApplication::processEvents() in the screenAdd event,i found that it has no help. It still does not work. Thanks for your suggestion.
  • QByteArray losing first element Qt 6.8

    Unsolved
    5
    0 Votes
    5 Posts
    433 Views
    SGaistS
    Hi, Beside the good question of @Christian-Ehrlicher about your use case, if you want to use meta objects, then do it all the way for both signals and slots. That will make your life easier.
  • Do i have to check QModelIndex::isValid() in overriden methods of QAbstractListModel

    Unsolved
    2
    0 Votes
    2 Posts
    179 Views
    JonBJ
    @Youda0008 Most code does/should check. If you look at the base implementations in QAbstractListModel I think you will see they do check isValid()? Or at least all derived classes? Since you are overriding them, or doing your own stuff before you call them, I would check. It's only an if. Or at least check if compiling for debug?
  • Second call to setMenuBar does nothing

    Unsolved
    19
    0 Votes
    19 Posts
    2k Views
    Christian EhrlicherC
    This is mostly done through https://doc.qt.io/qt-6/qaction.html#visible-prop and https://doc.qt.io/qt-6/qaction.html#enabled-prop but not by replacing the entire menu bar... Please provide a minimal, compilable example to reproduce your problem (without wxwhatever) - @JonB 's example works fine so proove us and Qt wrong.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    30 Views
    No one has replied
  • typedef std::basic_string<unsigned char> ustring;

    Unsolved
    4
    0 Votes
    4 Posts
    419 Views
    Christian EhrlicherC
    As it's a removed c++ feature (or bug?) there is no relation to Qt. Fix your code to use e.g. std::vector<uchar> or QByteArray instead.
  • Screen overrun

    Unsolved
    19
    0 Votes
    19 Posts
    2k Views
    SGaistS
    I don't know your widget so I can't comment however since you are saying that you are resizing things manually then there lies your problem. You should consider using layouts and you will that automatic resizing based on screen size.
  • QProxyStyle & PE_IndicatorBranch Drawing logic

    Solved
    2
    0 Votes
    2 Posts
    184 Views
    D
    Ok figured it out, its suprisingly simple... https://doc.qt.io/qt-6/style-reference.html#tree-branch-indicators int xMid = rect.center().x(); int yMid = rect.center().y(); int dotRadius = 4; QRect indicatorRect(xMid - 5, yMid - 5, 10, 10); const auto state = viewOpt->state; if (state & State_Children) { painter->setPen(Qt::red); painter->drawRect(indicatorRect); if (state & State_Open) { painter->setPen(Qt::blue); painter->drawEllipse(QPoint(xMid, yMid), dotRadius, dotRadius); } else { painter->setPen(QColor(0, 0, 0)); painter->drawLine(0, yMid, rect.right(), yMid); } } if (state & State_Item) { painter->setPen(QColor(0, 150, 0)); painter->drawEllipse(QPoint(xMid, yMid), dotRadius / 2, dotRadius / 2); if (state & State_Sibling) { painter->drawLine(xMid, rect.top(), xMid, rect.bottom()); } else { painter->drawLine(xMid, rect.top(), xMid, yMid); painter->drawLine(xMid, yMid, rect.right(), yMid); } } else { painter->setPen(QPen(QColor(0, 150, 150), 4)); if (state & State_Sibling) { painter->drawLine(xMid, rect.top(), xMid, rect.bottom()); } } [image: 9976c1f5-c57d-4236-9c09-4e7222ed9cbc.png]
  • QT 5.15 OAuth2 with certificate flow

    Solved
    3
    0 Votes
    3 Posts
    309 Views
    D
    @SGaist Hi, sorry for the very late response! I got a little further with my project but I just opened a new thread for the next step I am stuck on... I am still not entirely sure if I am on the right track, but I got a python example to follow from the people who manage the server, which I could replicate pretty decently using the QT framwork. Based on the example I got, I need to use importpkcs12 to extract a private key which I can use to... go further in the process of sending the package. I immediately got stuck on that part which is what my new thread is about, where QSslCertificate::importPkcs12(...) returns false despite the seemingly correct inputs. I think I can close this particular thread for now.
  • QAbstractItemModel for a highly nested data structure

    Unsolved
    2
    0 Votes
    2 Posts
    216 Views
    SGaistS
    Hi, Did you already took a look at the simple tree example ? As for your refresh rate, people won't be able to follow them so you might want to consider batching these updates.
  • Context menus for a single column

    Solved
    5
    0 Votes
    5 Posts
    496 Views
    O
    Your program has memory leak, in customMenuRequested() every time you creating new object of QMenu on heap and not deleting it. I have two ways how to fix it: Create QMenu object not on heap (by new) but on stack, like this QMenu menu(this). Than execute it by menu.exec((table->viewport()->mapToGlobal(pos)). Create QScopedPointer<QMenu> menu as your MainWindow field. And change your customMenuRequested(QPoint pos) to this: void MainWindow::customMenuRequested(QPoint pos) { menu.reset(new QMenu(this)); menu->addAction(new QAction("Action 1", this)); menu->addAction(new QAction("Action 2", this)); menu->addAction(new QAction("Action 3", this)); menu->popup(table->viewport()->mapToGlobal(pos)); } Sorry for my bad english.
  • 0 Votes
    9 Posts
    1k Views
    A
    @Redman cool 😎
  • Best QThread practices

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    D
    That is basically the approach I am using. Only with a short timer to give up the core for a little bit. Messages average about 1/sec, but we want quick response as part of this effort is to do some timing analysis before creating the final app. I had looked at finish early on as an early approach, but at that point I was looking for an "in-thread" use with a subclassed QThread, and the slot invocations in that case were in the parent thread, not wanted. However, using the Worker pattern, when the finished signal function is called, it is even in the worker thread, which appears to solve my problem for now. Thanks, Dale
  • How to start camera in qt ?

    Unsolved
    9
    0 Votes
    9 Posts
    921 Views
    G
    @jsulm Also with Qt 6.9.0 ([image: 64f32689-61fd-404a-b870-fd38b1b1ad82.png] image ) as u see its a win 11 problem becase i open Qt project example "declarative-camera". But laptop sad me that camera is started.
  • How to move the scrollbar at the bottom of a QScrollBar?

    Unsolved qt designer pyqt5 pyqt6
    2
    0 Votes
    2 Posts
    337 Views
    JoeCFDJ
    @Rangerman said in How to move the scrollbar at the bottom of a QScrollBar?: QScrollBar https://doc.qt.io/qt-5/qabstractslider.html#orientation-prop
  • Crash on QWebEngineView::setPage() with app-sandbox entitlements

    Unsolved
    1
    0 Votes
    1 Posts
    126 Views
    No one has replied
  • Openssl for windows ARM64

    Unsolved
    2
    0 Votes
    2 Posts
    574 Views
    F
    We supply OpenSSL binaries for Windows. You can download the ARM64 build for OpenSSL 3.5.0 Beta 1 from https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-arm64-3.5.0-beta1.zip. When OpenSSL 3.5.0 is released you will be able to download the binaries from https://www.firedaemon.com/get-openssl