Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • zmq into QT

    Unsolved
    2
    0 Votes
    2 Posts
    499 Views
    SGaistS
    Hi, Do you mean link to these libraries in your project ?
  • QtConcurrent and recursion

    Solved
    2
    0 Votes
    2 Posts
    474 Views
    S
    Ok. I I made it work after making QThread object a member and moving each QFutureWatcher object to it. I guess something wrong was in creating watcher in thread of QtConcurrent::run and when one call of recurse with QtConcurrent::run is finished, all watchers created in it, even dynamically and without a parent, were lost, or their connections were lost. I don't understand why it is so but it works. If someone can explain me this situation and why it works this way, i would be very thankful for explainations, so i would use CONNECT mechanism right in future.
  • how copy the file which in my project directory to the .exe file directory in windows

    Unsolved
    12
    0 Votes
    12 Posts
    3k Views
    mranger90M
    @Princein said in how copy the file which in my project directory to the .exe file directory in windows: replace slashes in destination path for Windows win32:dir ~= s,/,,g Could it be because you need two backslashes before the 'g' ? Edit: and dont forget to re-run qmake whenever changing the file.
  • RemoteObjects get replicas without waitForSource() doesn't work.

    Unsolved
    4
    0 Votes
    4 Posts
    926 Views
    T
    I got it. The solution was to force a Qt::QueuedConnection in the connect call for the ::stateChanged signal. Since the replica and Client-model objects live in the same thread, with Qt::AutoConnection a direct connection is established. However, that skips returning to the main event loop in between the calls. When I instead called waitForSource(), an internal event loop in that function is created. Even though the state of the replica object is designated as being valid when the slot is called, it is necessary to call an event loop at some point for the replica state to really become working. I consider this a bug in Qt Remote Objects or at least a missing important point in the docs for the replica object.
  • OPC UA QML Types not found

    Solved
    28
    0 Votes
    28 Posts
    5k Views
    ODБOïO
    Qtopcua Build process has changed, now Open62541 is included - see Building Qt OPC UA with open62541
  • Build QtOpcUa 5.12 [windows]

    Solved
    10
    0 Votes
    10 Posts
    2k Views
    ODБOïO
    Hi, @Mogli123 Thank you very much for the info
  • how to pack a completely a widget in a cell of a QTableWidget

    Unsolved
    2
    0 Votes
    2 Posts
    308 Views
    jsulmJ
    @Qt-Enthusiast said in how to pack a completely a widget in a cell of a QTableWidget: Is it possible to remove the space and pack the text + completely in the cell What do you mean? What should happen with the extra space if the cell is wider than the content of your widget?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • No QPrinter::PostScriptFormat in qt5

    11
    1 Votes
    11 Posts
    9k Views
    mrjjM
    Hi As far as i know, PS output is no longer directly available in Qt5.
  • How to use Qt3DRender::QObjectPicker with touch events on smartphones?

    Solved
    2
    0 Votes
    2 Posts
    422 Views
    M
    It can be done with QScreenRayCaster: /* * You have to add the ray caster to the root entity as a component * Perform ray casting tests by specifying "touch" coordinates in screen space */ m_screenRayCaster = new Qt3DRender::QScreenRayCaster(m_rootEntity); m_screenRayCaster->setRunMode(Qt3DRender::QAbstractRayCaster::SingleShot); m_rootEntity->addComponent(m_screenRayCaster); /* * Handle ray casting results, e.g. by touch events */ QObject::connect(m_screenRayCaster, &Qt3DRender::QScreenRayCaster::hitsChanged, this, &MyClass::handleScreenRayCasterHits); Triggering QScreenRayCaster by touch events: void MyClass::HandleTouchEvent(QTouchEvent *event) { switch (event->type()) { case QEvent::TouchBegin: break; case QEvent::TouchEnd: if (event->touchPoints().count() == 1) { QPointF point = event->touchPoints().at(0).pos(); m_screenRayCaster->trigger(QPoint(static_cast<int>(point.x()), static_cast<int>(point.y()))); } break; default: break; } } Handling ray casting results in a slot: void MyClass::handleScreenRayCasterHits(const Qt3DRender::QAbstractRayCaster::Hits hits) { for (int i = 0; i < hits.length(); ++i) { qDebug() << __func__ << "Hit Type: " << hits.at(i).type(); } }
  • [Solved] Images in qt application not loading.

    24
    0 Votes
    24 Posts
    30k Views
    R
    @Gmoney just add image to ur .qrc file in qt . and then right click on the image copy full path . then u get the correct path paste that to ur code .it works
  • Which button was released in eventFilter?

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    J.HilkJ
    @Andaharoo try it with mouseEvent->button() instead of buttons(), button() willö give you the button that caused the event, whereas buttons Returns the button state when the event was generated. The button state is a combination of Qt::LeftButton, Qt::RightButton, Qt::MidButton using the OR operator. For mouse move events, this is all buttons that are pressed down. For mouse press and double click events this includes the button that caused the event. For mouse release events this excludes the button that caused the event. Pay attention to the last part For mouse release events this excludes the button that caused the event. You're filtering only for Release event -> you'll have to use button() function
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • QProcess and Slots

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    aha_1980A
    @xXiXx if I see it correctly, your MyButton class is missing the Q_OBJECT macro. That is needed for signals&slots.
  • Moving QTreeWidgetItems between two QTreeWidgets

    Unsolved
    26
    0 Votes
    26 Posts
    6k Views
    jsulmJ
    @Ovidiu_GCO As alternative you could use several list widgets: On the left is a list of drivers To the right side of the first list you have a second one: when you select a driver you put the cars of that driver into this list More lists if needed...
  • How do you tab into the fields of a tab box if the tab box is dynamically generated?

    Unsolved
    4
    0 Votes
    4 Posts
    565 Views
    mrjjM
    @psigil Hi Using an UI file is 100% the same as using plain code. The UI files is converted to C++ code which is run in setupUI() function so after that function you can just change it with setTabOrder all you wish.
  • Using QGraphicsView and QGraphicsScene to display an image with buttons on top.

    Solved
    11
    0 Votes
    11 Posts
    4k Views
    mrjjM
    @ConfusedProgrammer Hi That is good to hear. Overall, it should work much better for a map annotation or what your app does, than using PushButtons.
  • how to insert a QCheckbox in header of QTableWidget

    Unsolved
    4
    0 Votes
    4 Posts
    555 Views
    SGaistS
    Hi, Do you have something like shown here in mind ?
  • QTimer - Problem when passing with passing the values

    Solved
    11
    0 Votes
    11 Posts
    2k Views
    D
    Thank You very much for Your advise. I'll remeber it. This is very helpful.
  • Update scene with a thread

    Unsolved
    4
    0 Votes
    4 Posts
    734 Views
    SGaistS
    In that case start by reading the Signals & Slots chapter in Qt's documentation. And the QThread documentation.