Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • VS 2015 QT5.6.0 QFileDialog::GetSaveFileName API issue

    Unsolved
    1
    0 Votes
    1 Posts
    136 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
    743 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.
  • Help understanding pinch/push code

    Unsolved
    7
    0 Votes
    7 Posts
    777 Views
    C
    @mrjj Unfortunately that didn't work. I was able to invert the zoom for the scroll wheel. The only diffrence between the zoom for the scroll wheel and the one for pinch/push is: Used by pinch/push void SetZoomLevel(qreal zoom) { pThis->events.enqueue({MapItem::Z, {-zoom, NAN}}); Update(); } and Used by scroll wheel void Zoom(bool in) { pThis->events.enqueue({MapItem::Z, { (in?1:-1) * std::numeric_limits<qreal>::max(), NAN}}); Update(); } I find it odd that both are using the same enqueue function but are passing seemingly different arguments, here is that function: inline void enqueue(const T &t) { QList<T>::append(t); } All I did to invert the scroll wheel functionality was to change: (in?-1:1) too (in?1:-1) so I guess I will try sending the enqueue -zoom instead of zoom. I am really just grasping at straws here, perhaps this will work.
  • Handling Exception: third party library

    Unsolved
    6
    0 Votes
    6 Posts
    931 Views
    SGaistS
    Are you talking about the Qt installation or the VS2019 one ?
  • Advice needed on custom buttons with different states and other special behavior.

    Unsolved
    12
    0 Votes
    12 Posts
    882 Views
    SGaistS
    There's a whole Qt module dedicated to networking :-) Can you describe how the network related part is currently working ?
  • x86 and x64 in parallel

    Unsolved
    2
    0 Votes
    2 Posts
    155 Views
    SGaistS
    Hi and welcome to devnet, Yes you can do both. Usually it requiers to setup the command line to use the correct compiler. You may have shortcuts in your start menu for that.
  • QStandardItemModel+QTableView get pool performance after 5.9.3

    Solved
    10
    0 Votes
    10 Posts
    2k Views
    Christian EhrlicherC
    See also https://bugreports.qt.io/browse/QTBUG-18539 for more information about this problem.
  • Qt5 cmake imported target include path on MacOS

    Solved
    2
    0 Votes
    2 Posts
    296 Views
    C
    Additionally, this seems to happen when we generate for XCode. If we use -G Ninja, it seems to work. So my guess is this is a CMake XCode generator problem.
  • Transfer data between classes.

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    X
    @Pablo-J-Rogina Unfortunately I didn't thought about that.:( Thank you, program works now!
  • Serial Port In windows

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    aha_1980A
    @saeidparand but did the example work correctly?
  • Can we see Qt6?

    Solved
    10
    0 Votes
    10 Posts
    676 Views
    Pablo J. RoginaP
    @mpahlevanzadeh said in Can we see Qt6?: but I fear to Qt5 will be deprecated. There is people still using Qt 4.x if you mind...
  • Arranging dock widgets - controlling behavior after re-docking widgets

    Unsolved
    3
    1 Votes
    3 Posts
    613 Views
    M
    @Dariusz I have exactly the same issue, how did you solved it in the end?
  • Qt3D: set line width for Qt3DRender::QGeometryRenderer::Lines

    Unsolved
    1
    0 Votes
    1 Posts
    426 Views
    No one has replied
  • Problem while applying filter on QTableView with a button column

    Solved
    18
    0 Votes
    18 Posts
    5k Views
    L
    @VRonin It is implemented, working good. However, I have an issue. When setItemDelegateForColumn is used, all created buttons at the column have the same properties (the last row button's properties). How will I know the row number of the button I clicked? I create the buttons as following: ButtonDelegateTableView * addIntervalButton = new ButtonDelegateTableView(ui->tableView, project, wellName, rowNumber); And, when I clicked on the button at the first row, I get the properties (well name, row number etc.) of the last row buttons. [image: d6b79573-7bc0-47b9-b566-d9d9dd74e9fa.PNG]
  • This topic is deleted!

    Unsolved
    2
    -1 Votes
    2 Posts
    9 Views
  • How to get the scene loader to generate tangent space for a loadable model?

    Unsolved
    1
    0 Votes
    1 Posts
    153 Views
    No one has replied
  • How to convert const QVector<quint32> to vector<int>.

    Unsolved
    14
    0 Votes
    14 Posts
    2k Views
    JonBJ
    @JKSH , @J-Hilk Pointer size is increased to 64 but integer size remains 32 on today's common 64-bit desktop architectures. Yes, now I vaguely remember reading this, I am glad @J-Hilk shared my mis-assumption! This is what comes of my being forced to use Python for Qt or JavaScript over so many years now. Ignorance of underlying type sizes! It has been a long time since sizeof(int) != sizeof(long) and sizeof(int) != sizeof(void*), probably not since the initial move from 16-bit to 32-bit architecture! :)
  • how to link the object file to a Qt

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    mrjjM
    @Asha Hi You can just include the wanted .cpp in the .pro file or make file or what you use to compile. You can also link it into the porject as an .o file. However, if you have a main in the new .cpp that wont work as there already is a main for the qt app. Im not sure what you mean by "while executing this object file getting the result in command prompt ,not in vnc platform.."