Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Cannot find feature windows_vulkan_sdk

    Unsolved
    9
    0 Votes
    9 Posts
    3k Views
    Pablo J. RoginaP
    @Bill_2019 said in Cannot find feature windows_vulkan_sdk: Fix worked great Great! Time to mark your post as solved then? Thanks.
  • Adding data processing class - inherit from QObject or not ?

    Unsolved
    2
    0 Votes
    2 Posts
    254 Views
    JonBJ
    @AnneRanch If your class simply has nothing to do with Qt, it should not inherit from QObject. You should inherit from QObject --- or any other class --- if and only if your code needs to do so, for some reason.
  • Can we create documentation of QStateMachines used in code?

    Unsolved
    2
    0 Votes
    2 Posts
    120 Views
    dheerendraD
    Qt does not have any mechanism to generate the documentation based on your code.
  • QSqlTableModel does not work

    Unsolved
    3
    0 Votes
    3 Posts
    333 Views
    S
    @JonB Quite right: QTBUG-79033. More of a change in PostgreSQL 12 than a Qt bug, I think, but enough to make QSqlTableModel unusable with PostgreSQL 12 for the time being.
  • How to add a Menu in a QDialog window

    Unsolved
    4
    0 Votes
    4 Posts
    3k Views
    F
    Thank you @mrjj ...I think that will be good to block user click in the MainWindow when the second window is enable. So QDialog will be better for my case. I'm newer in Qt and I don't know how to add QMenu in the layout. Should I do this in the Qt Creator Designer or by code? Beyond the drop-down menu (File->Open, etc...) is possible to create a UI Toolbar at the top of the QDialog window? With some icons like "New File", "Save", etc...? How can I do that? Is there any examples? I already tried this, but doesn't work: QVBoxLayout *mainLayout = new QVBoxLayout(this); QToolBar *toolBar = new QToolBar(); mainLayout->addWidget(toolBar); QAction *action1 = new QAction("Add", toolBar); QAction *action2 = new QAction("Del", toolBar); Thank you @JonB too. Very interesting point! I will use that in the future projects.
  • Avoiding widgets to overlays the corner widget place of the QScrollArea

    Unsolved
    3
    0 Votes
    3 Posts
    382 Views
    F
    The structure of the widget was already in this way, but the code was converted from Qt3 to Qt5. It seems that in the Qt3 QScrollView it wasn't possible to move a widget such that a part of it was displayed on the corner widget place. In the Qt5 QAbstractScrollArea it's possible, and I would like to not let the textedit draw this area. Do you have any suggestions?[image: c88701ef-ec4f-44c7-b995-e7b66dae695a.png] P.s. it's not a QTableWidget/QTableView, it's a completely custom widget.
  • How to add a QListView to QFileDialog?

    Unsolved
    4
    0 Votes
    4 Posts
    413 Views
    JonBJ
    @patrickkidd Yes, the Qt one looks a bit different. If you want to interact with the native one, then you become platform-specific (and you haven't mentioned which platform(s) you target). I don't know how/think that Qt gives you access to the native dialog. But if you are Windows look at, say, https://www.qtcentre.org/threads/21337-Native-QFileDialog-position-under-Win32. It's very old, but I think it's showing how you can call the native dialog yourself from Qt, and then maybe you can add those checkboxes if you think the native API has that?
  • No Audio-Output with QAudioOutput::start(QIODevice*)

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    G
    @SGaist No, I would rather just write every 4096-Byte Block directly into the device when I get the callback with the data. I tried it with first loading the buffer and to call QAudioOutput::start(QIODevice*) after the VE_MSG_ENDPROCESS callback. Still didn't work, although it should, as far as I know. Nothing seems to work and I'm currently using the push-mode method, which lags sometimes.
  • MVC Pattern (Custom QSqlQueryModel) - Relay a DB Error message to User

    Solved
    5
    0 Votes
    5 Posts
    384 Views
    R
    @JonB thank you, it makes perfect sense. (don't know what I was thinking lol)
  • Why there is no QList<T>::append(T &&)

    Solved
    4
    0 Votes
    4 Posts
    251 Views
    Christian EhrlicherC
    @Mr-Pang said in Why there is no QList<T>::append(T &&): What about QMap? Feel free to add a patch for it.
  • Qt 5.13.1 QNX Build fails on Windows

    Unsolved
    1
    0 Votes
    1 Posts
    149 Views
    No one has replied
  • How to get the page in QTabWidget

    Solved
    2
    0 Votes
    2 Posts
    278 Views
    VRoninV
    Just iterate. for(int i=0;i<tabWidget->count();++i){ if(tabWidget->tabText(i) == QStringLiteral("Tab1")) qDebug("Bingo!"); }
  • Integrate my own CMainWindow in Qt Creator

    Unsolved
    4
    0 Votes
    4 Posts
    297 Views
    L
    @Christian-Ehrlicher Yes, we develop many apps with the same base-functions but different details. e.g. as stackedwidgets
  • system vs process command

    Solved
    15
    0 Votes
    15 Posts
    4k Views
    JonBJ
    @Mijaz Here is your command, copied & pasted into triple-backticks here on this forum so that we can actually read it: process1.start("echo /sys/kernel/iio/devices/iio:device4/ 0x418 0x2 > direct_reg_access"); So, this will put the characters /sys/kernel/iio/devices/iio:device4/ 0x418 0x2 into a file named direct_reg_access. Now, as I have said before, this will create/overwrite that file in the current directory of whichever process it is run from. Why do you need any special permissions? Please log onto your Linux or whatever box, open a shell/terminal, and copy & paste the command you have written into it as the very first thing you do in the shell: echo /sys/kernel/iio/devices/iio:device4/ 0x418 0x2 > direct_reg_access Do you agree this works immediately, without any special permissions? Because your current directory is highly likely to be your home directory, and you have permission to create/write to files there. So, you don't need any special permissions, do you? Now, if it turns out that what you really mean is that you want to write to that file elsewhere, then you have to say so. I don't want to have to guess. Perhaps what you really mean is echo /sys/kernel/iio/devices/iio:device4/ 0x418 0x2 > /sys/kernel/iio/devices/iio:device4/direct_reg_access While we are here. Your question #2 , copied & pasted, says what you intend to do is: cat /sys/kernel/iio/devices/iio:device4/ direct_reg_access This will always error, because you cannot cat a directory. Try it yourself from a shell. I asked you before to look at your spacing and correct or tell us what you actually want to do. Finally, the whole process you have written is pointless. At the end of it, if you cat the direct_reg_access file you have created you will always get back precisely the string /sys/kernel/iio/devices/iio:device4/ 0x418 0x2 so what is the whole point of the exercise? I will answer your question about permissions if you take the time to make clear what it is you actually want to do, where that file direct_reg_access is supposed to be, but not before....
  • Multiple axis ranges in qml ChartView

    Unsolved
    1
    0 Votes
    1 Posts
    136 Views
    No one has replied
  • Getting width and height of QLabel object in realtime

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    KiraK
    @Christian-Ehrlicher :ok thanks
  • VS 2015 QT5.6.0 QFileDialog::GetSaveFileName API issue

    Unsolved
    1
    0 Votes
    1 Posts
    134 Views
    No one has replied
  • Do not succeed in reading and writting frames with peak system

    Unsolved
    16
    1 Votes
    16 Posts
    2k Views
    J
    Hi, I will incorporate your fixes today. I've just checked on peak-system website and it seems that the access to the CAN channels of a PCAN-Gateway is enabled via the new PCAN-LAN hardware type from PCAN-Basic library: https://www.peak-system.com/PCAN-Basic.239.0.html?&L=1 Does anyone has tested to use P-CAN-Gateway with PCAN-Basic library yet ? Thank you
  • QEventLoop Confusion

    Solved
    2
    0 Votes
    2 Posts
    740 Views
    JKSHJ
    @wumpus7 said in QEventLoop Confusion: Is there a way to get a pointer to a QThread's event loop? Not in the Qt API. Assumptions: Every QThread has its own QEventLoop.... A thread's event loop is kicked off by calling exec() in the thread Correct. To be more precise, the QEventLoop is created inside QThread::exec() and it is destroyed when QThread::exec() returns: https://code.woboq.org/qt5/qtbase/src/corelib/thread/qthread.cpp.html#_ZN7QThread4execEv which is done automatically when the thread's run() method is called, which happens automatically when start() is called on the thread. (Or is this not true? I've found documentation saying both that you must call run() and exec() yourself, and also that they are nested as I described.) It depends. If you use a QThread without subclassing it, then QThread::start() calls QThread::run() which calls QThread::exec() as you described. However, if you subclass QThread and reimplement QThread::run(), then you must call exec() in your implementation of run(). I've seen the functions to check if an event loop isRunning(), but I don't see any way to call this function without a pointer to the event loop in question See QThread::isRunning() and QThread::isFinished() QThread seems to have no accessor function for its default event loop. Correct. The QEventLoop only exists inside QThread::exec() and it is not accessible from outside. Trying to compare the comms thread's event loop to the Objective C run loop I'm trying to hook seems like it should be a thing I can do, but I'm completely defeated at this point. I have no experience with accessing event loops from Objective-C, but it is possible to subclass QThread and create your own custom QEventLoop instead of calling QThread::exec(). This is very hacky though and not something I'd normally recommend -- it breaks the QThread API like QThread::isRunning().
  • 0 Votes
    3 Posts
    3k Views
    W
    @Chris-Kawa Thank you, this solves the problem. As to alternative way to exit, I already have exit action on tray's menu. Have a nice day.