Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • 0 Votes
    4 Posts
    642 Views
    Axel SpoerlA
    @AbhimanyuD Generally, please format posted code. It’s just so much easier to read for everybody. What exactly happens in the modified example? Autoconnect by name will not work without the on_ Have you tried connecting the PMF way?
  • Qt serial port is not found in Qt Build 5.15.2

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    D
    @dan1973 I have checked my other source folder it is present in that. I'll reinstall Build frm source. Thank you. i'll get back to you
  • How to set different text for a QDockWidget's tab and window title?

    Unsolved
    2
    0 Votes
    2 Posts
    138 Views
    SGaistS
    Hi, You can use the topLevelChanged signal and update the text accordingly.
  • Virtual method in library causes unresovled external

    Solved
    3
    0 Votes
    3 Posts
    172 Views
    D
    @Christian-Ehrlicher did you miss "More frustrating, I've not been able to reproduce a simplified example that I can post. (My attempt at a "hello" reproduction of the same scenario fails to produce the unresolved external complaints.)"? :-) In any case, I discovered the issue: Apparently, moving a project in Qt (maybe only with cmake) is not an obvious operation. In fact, I'm still not quite sure how to do it, what parts of the build directory need to be controlled, etc. But it was rebuilding the library in the OLD build directory rather than the one under the new location of the project. Gah! Why isn't everything that's project-specific based on relative directories by default!?
  • paintEvent called incorrectly when monitor changed

    Solved
    12
    0 Votes
    12 Posts
    976 Views
    Christian EhrlicherC
    @Artem-Shapovalov said in paintEvent called incorrectly when monitor changed: setGeometry(global); // <- fault and crash You must not call setGeometry inside a paint event as this may trigger a repaint and therefore an infinite loop.
  • QT5.15.2 and qilinv10 and arm64

    Unsolved
    20
    0 Votes
    20 Posts
    2k Views
    Q
    @quan-wei-jun The Error:In file included from io/qprocess_unix.cpp:105: In file included from ../../include/QtCore/qsocketnotifier.h:1: ../../include/QtCore/../../src/corelib/kernel/qsocketnotifier.h:117:35: error: constexpr function never produces a constant expression [-Winvalid-constexpr] Q_DECL_CONSTEXPR_NOT_WIN bool isValid() const noexcept { return *thi... ^ ../../include/QtCore/../../src/corelib/kernel/qsocketnotifier.h:117:75: note: undefined function 'operator!=' cannot be used in a constant expression ...bool isValid() const noexcept { return *this != QSocketDescriptor(); } ^ ../../include/QtCore/../../src/corelib/kernel/qsocketnotifier.h:124:42: note: declared here friend Q_DECL_CONSTEXPR_NOT_WIN bool operator!=(QSocketDescriptor lhs, key: qsocketnotifier.h constexpr function never produces a constant expression [-Winvalid-constexpr]
  • Grid Layout arrangement

    Solved
    7
    0 Votes
    7 Posts
    866 Views
    V
    @Vijaykarthikeyan Even I explicitly coded the width of each item, it is not changing still GridLayout { id:grid anchors.fill: parent rows:5 columns: 3 rowSpacing: 0 property int cellWidth: 10 property int cellHeight: 10 Text { id:row1;text: "Three";width: grid.cellWidth;height: grid.cellHeight;Layout.row: 0;Layout.column: 0;Layout.alignment: Qt.AlignTop; font.bold: true; } Text { text: "words";width: grid.cellWidth; height: grid.cellHeight;Layout.row: 0;Layout.column: 1;Layout.alignment: Qt.AlignTop;color: "red" } Text { text: "in";Layout.row: 0;width:grid.cellWidth; height: grid.cellHeight; Layout.column: 2;Layout.alignment: Qt.AlignTop;font.underline: true } Text { text: "a";width: grid.cellWidth;height: grid.cellHeight; Layout.row: 1;Layout.column: 0;Layout.alignment: Qt.AlignTop;font.pixelSize: 20 } Text { text: "row";width:grid.cellWidth; height: grid.cellHeight; Layout.row: 4;Layout.column: 0;font.strikeout: true } }
  • QThreadPool based on QMap(msecs) instead of QQueue

    Unsolved
    4
    0 Votes
    4 Posts
    222 Views
    jsulmJ
    @coucougael94 Why do you need threads?
  • Online installer is complete trash

    Unsolved
    7
    0 Votes
    7 Posts
    367 Views
    S
    @Jimbro said in Online installer is complete trash: Nah, It was not 20 years ago, and it isn't now. I hope you don't feel attacked, but I am honestly curious about your opinion. Saying Qt is a piece of garbage is a bold claim (though I fully agree about their online installer). I personally don't think that Qt is the best framework that could be imagined by today's standards. However, I also don't know anything better. Can you provide pointers to a good replacement of Qt? I only would only need a replacement for QtWidgets as I don't use QML. It still needs to be C++ and support crossplatform portability (Windows, Linux, macOS). Any suggestions (provided with reasons) are highly appreciated.
  • How to remove padding on columns QTreeview

    Unsolved
    2
    0 Votes
    2 Posts
    354 Views
    C
    @Tater The space is for the text of the DisplayRole you are not providing, and is at least as big as the section width. Start by looking at the QHeaderView::minimumSectionSize(). If you want to provide a completely custom rendering for the items then you probably need to roll your own QStyledItemDelegate.
  • QCameraImageProcessingControl errors logs, but QCamera works as well

    Unsolved
    10
    0 Votes
    10 Posts
    706 Views
    jsulmJ
    @acetone said in QCameraImageProcessingControl errors logs, but QCamera works as well: There is no GStreamer item in the online installer @SGaist suggested to try with Qt provided by your Linux distribution, not Qt online installer
  • Eigen libarary linking error

    Unsolved
    11
    0 Votes
    11 Posts
    857 Views
    jsulmJ
    @eswaramrth03 Please post the whole build log as text
  • Qt designer icon problem

    Unsolved
    3
    0 Votes
    3 Posts
    191 Views
    LahearleL
    Okay so now I fixed the white background, by switching to "flat", but when I click the white box appears again with each click to indicate click, how to get rid of?
  • Keeping aspect ratio of images in a QTabBar

    Unsolved qtabbar aspect ratio svg
    1
    0 Votes
    1 Posts
    300 Views
    No one has replied
  • How to specify font-variant-numeric in QT?

    Unsolved
    4
    0 Votes
    4 Posts
    352 Views
    SGaistS
    Based on this bug report, I think: not yet.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • forcing proxy model to update

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    mzimmersM
    Well...it's working now, without my having to use the invalidate() method. Not sure what I changed, but here's the relevant code: // qml ListView { id: spaceRow model: spaceModel delegate: TabButton { contentItem: Text { text: name MouseArea { anchors.fill: parent onClicked: { spaceRow.currentIndex = index equipmentProxyModel.setSpaceIndex(index) // c++ void EquipmentProxyModel::setSpaceIndex(int index) { m_spaceIndex = index; } m_spaceIndex is used here: bool EquipmentProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { bool rc = false; QModelIndex qmi = createIndex(sourceRow, 0); QUuid equipmentUuid = m_equipmentModel->data(qmi, m_equipmentModel->UuidRole).toUuid(); QUuid spaceUuid = m_spaceModel->getUuid(m_spaceIndex); if (m_spaceIndex == 0) { // all spaces rc = true; } else if (equipmentUuid.isNull()) { // don't bother } else { rc = m_spaceModel->equipmentInSpace(spaceUuid, equipmentUuid); } return rc; } And this seems to suffice. Thanks to everyone who replied... EDIT: And...just like that, it stopped working (after some changes to the model. I followed the advice of @sierdzio and (re)inserted the invalidate() call: void EquipmentProxyModel::setSpaceIndex(int index) { m_spaceIndex = index; invalidate(); } And now it works. No idea how I got it to work (temporarily) without this...
  • QSqlTableModel - Check for invalid cells in QTableView?

    Unsolved qsqltablemodel qtableview qsqlrecord
    4
    0 Votes
    4 Posts
    760 Views
    R
    From what I've seen online, the QValidator approach requires subclassing QItemDelegate and it's setData() method. How is this different from the last point suggested ?
  • "no suitable kits found"

    Unsolved
    4
    0 Votes
    4 Posts
    373 Views
    JoeCFDJ
    @xqz5222 You installed Qt Design Studio. But it is not Qt. Check Custom installation in the second screenshot and press next button. Then select the latest Qt to install.
  • This topic is deleted!

    Unsolved
    13
    0 Votes
    13 Posts
    63 Views