Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Get transparency of qt theme

    Unsolved
    1
    0 Votes
    1 Posts
    170 Views
    No one has replied
  • Sorting with MVC and database. Row number confusion - conceptual question

    Solved
    2
    0 Votes
    2 Posts
    218 Views
    JonBJ
    @ocgltd said in Sorting with MVC and database. Row number confusion - conceptual question: Does the QSFPM translate view row numbers to QAIM row numbers as read from the DB? Yes. And note that QSortFilterProxyModel has a bunch of map...() methods for converting QModelIndexes between it and the source model when these are needed. Or I have to have the QAIM perform SQL Selects using a different 'sort by' order based on the View's sort order? Noooo :) And note that any model could be used by multiple views, each with different sorting/filtering, so the model never needs to do anything about, or know anything about, what views might do with its data.
  • QMediaPlayer works with QVideoWidget, but not with QAbtractVideoSurface

    Solved
    2
    0 Votes
    2 Posts
    181 Views
    KutyusK
    Resolved the problem: supportedpixelformat method need more formats: return QList<QVideoFrame::PixelFormat>() << QVideoFrame::Format_RGB32 << QVideoFrame::Format_ARGB32 << QVideoFrame::Format_ARGB32_Premultiplied << QVideoFrame::Format_RGB565 << QVideoFrame::Format_RGB555;
  • Selected QLabel?

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    JonBJ
    @apalomer said in Selected QLabel?: You have to imagine that label1 lives in two different UI files that end up composed in the same GUI Then you need to use the UI file/class somewhere in the selector to distinguish. (To be clear: you can use your own class names in the selector, not just Qt inbuilt ones like QFrame or QLabel.) Anyway, I have tried the descendant selector but I would like to have the name of the ascendant. Something like this: The available facilities are in the reference I gave, and that does not include "ascendant" direction, only "descendent", as per CSS too. I guess I will have to change the names at the end.... I don't see why. Presumably the different .ui's classes are different, and that should be usable in the selector. There is also a supplementary way of distinguishing your labels which may suit. In that same reference page see Property Selector QPushButton[flat="false"] and https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-using-dynamic-properties. You can add your own dynamic properties even in Designer on a widget, there is some "add property plus-button" on the properties on any widget.
  • Why QApplication::processEvents(QEventLoop::AllEvents, 20);?

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    F
    @JonB Thank you for clarification
  • Qt Creator is unable to import module PyQt5 PySide

    Locked Unsolved
    2
    0 Votes
    2 Posts
    216 Views
    jsulmJ
    @NewProgrammer Please don't double-post! https://forum.qt.io/topic/134003/first-steps-in-qt-creator-modulenotfounderror-no-module-named-pyqt5-beginners-issue
  • Howto neglect these bytes while downloading file from http server

    Solved
    12
    0 Votes
    12 Posts
    856 Views
    P
    @ChrisW67 Yes, that's what i thought at first but when I STDOUT QByteArray, then i realized that serializing data to stream is causing those extra bytes.
  • Qt QSql: cannot create a new MDB-File per ODBC

    Unsolved
    2
    0 Votes
    2 Posts
    222 Views
    C
    In general, you cannot connect to a database that does not already exist: as a file in the case of Access, or a service for MySql/Oracle etc. Sqlite is unusual in that it will create the file referenced if it does not exist (that can also fail). You can programmatically create an Access database by automating Access (ActiveQt) and probably a bunch of other ways, including copying an "empty" template.
  • How to use QtConcurrent::functions and what is my error?

    Solved concurrent map qtconcurrent
    2
    0 Votes
    2 Posts
    482 Views
    SGaistS
    Hi, If you want to use a member function, the array you pass to the map method must contain items of that class.
  • Clicked signal and slot for a QStyleOptionButton drawn inside paintEvent

    Solved
    6
    0 Votes
    6 Posts
    673 Views
    H
    @Christian-Ehrlicher sorry. that's true, that doesn't make sense. I was thinking about it in a different way ( a wrong way btw). Using the regular qpushbutton does the job.
  • QTcpServer with QProcess

    Unsolved
    6
    0 Votes
    6 Posts
    614 Views
    JonBJ
    @Pepijn There is a https://doc.qt.io/qt-5/qprocess.html#CreateProcessArgumentModifier-typedef for Windows only. The Qt docs don't seem to state what its members are. From https://code.woboq.org/qt5/qtbase/src/corelib/io/qprocess_win.cpp.html#_ZN15QProcessPrivate17callCreateProcessEPi there should be a cpargs->inheritHandles you could set/override? However from line https://code.woboq.org/qt5/qtbase/src/corelib/io/qprocess_win.cpp.html#564 I already see true being passed for that. So.... are you really sure this does not already work? I know the bug you referenced says inheritance was switched off, but that was from 2012..... Ah, I now see it talks about DuplicateHandle. I don't know what the Qt code does about that perhaps prior to calling CreateProcess? You should also read https://docs.microsoft.com/en-us/windows/win32/sysinfo/handle-inheritance. I suggest you look in the code at what you claim is happening. You state As far as I can tell from this issue at some point sockets were made to be not inheritable, meaning it would no longer be possible to access the open socket in the child process. but I have yet to find that definitively. Are you sure, have you tested? You claim a "change" and an "old default" but have not mentioned anything about Qt versions, which you might compare/read about for this change?
  • Calling toLatin1().data() via a wrapper function c_str()

    Solved
    4
    0 Votes
    4 Posts
    604 Views
    Christian EhrlicherC
    C++ basics - in your second example the temporary is deleted after the usage. Simply said: Temporaries are deleted when the ; is processed.
  • QtCreator Widget Plugin custom class

    Unsolved
    1
    0 Votes
    1 Posts
    131 Views
    No one has replied
  • QWidget - the drawn image is erased

    Unsolved
    7
    0 Votes
    7 Posts
    507 Views
    SGaistS
    Hi, Keep the QPixmap rather than execute the conversion each time.
  • Save number with high decimal

    Unsolved
    15
    0 Votes
    15 Posts
    2k Views
    kshegunovK
    Use a stable solver. Your matrix is quite close to singular. QR comes to mind, eigen already provides it out of the box.
  • QTableView field (related to other db table) does not get refreshed

    Unsolved
    1
    0 Votes
    1 Posts
    89 Views
    No one has replied
  • Example of calling a function to parent?

    Unsolved
    38
    0 Votes
    38 Posts
    5k Views
    M
    This code looks strange ... class positionsForm *form = new class positionsForm(model, this); The class name doesn't start with a capital letter and looking like a function, confusing. Why are you using class , obviously positionsForm is a class. and finally: connect(ui->positionsTable->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(emitSignal())); since model is defined in ArticlesWindow why not make the connection straight away in that class ?
  • Qt5 default text encoding has chaged

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    Christian EhrlicherC
    @hskoglund said in Qt5 default text encoding has chaged: Utils.h:173: error: C2440: 'return': cannot convert from 'const char8_t [4]' to 'QString' Because of QT_NO_CAST_FROM_ASCII which should be enabled for all projects by default - a QString and a char* are two completely different types which should not implicitly convert into each other.
  • What causes error " called on pointer returned from a mismatched allocation function"

    Unsolved
    7
    0 Votes
    7 Posts
    5k Views
    ocgltdO
    I'm using GCC 64 bit I found a bug report about this, so I think it's a known error (to compensate for an MSVC issues). I am ignoring it and all seems to work (though I don't like such scary messages suggesting I'm going to free memory incorrectly)
  • How do you re configure a Qt build from source?

    Solved
    3
    0 Votes
    3 Posts
    901 Views
    R
    Thanks - I was following some internal documentation which is probably not the best idea. Your answer makes sense.