Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. qevent
    Log in to post

    • SOLVED Custom QT Events
      General and Desktop • qevent custom event qcustomevent • • rtavakko  

      4
      0
      Votes
      4
      Posts
      104
      Views

      Option 2 suggested above works best I think and is the cleanest solution. To sum it up: Header file for event definition: #ifndef EVENTDEFINITIONS_H #define EVENTDEFINITIONS_H #include <QEvent> extern const QEvent::Type TYPE_AUDIO; #endif // EVENTDEFINITIONS_H Cpp file for the event definitions where it is initialized: #include <eventdefinitions.h> const QEvent::Type TYPE_AUDIO = static_cast<QEvent::Type>(QEvent::registerEventType()); Event subclass: #ifndef AUDIOEVENT_H #define AUDIOEVENT_H #include <eventdefinitions.h> #include <QDebug> class AudioEvent : public QEvent { public: explicit AudioEvent(); }; #endif // AUDIOEVENT_H #include "audioevent.h" AudioEvent::AudioEvent() : QEvent(TYPE_AUDIO) { qDebug()<<QString("Creating custom event(%1)").arg(static_cast<int>(type())); }
    • UNSOLVED Getting event filter to configure flags on qApp as global helper
      General and Desktop • qevent • • Dariusz  

      1
      0
      Votes
      1
      Posts
      61
      Views

      No one has replied

    • UNSOLVED QEventLoop - unique event?
      General and Desktop • qeventloop qevent • • Dariusz  

      11
      0
      Votes
      11
      Posts
      173
      Views

      @Dariusz said in QEventLoop - unique event?: well I have no idea how to solve it now... You said this is some kind of cumulative transformation you're doing, right? What about keeping only the info about the transform instead of actually doing it. Then on the update event you can calculate the accumulated result. Say you're moving a thing in space, you can keep the offset from the original position, you don't need to actually do to the move yet, just sum up the vectors. Finally construct the transformation matrix and apply. The same thing could be done for rotations, skews etc. The only thing that you need to be careful about, however, is that affine transforms aren't commutative. If you have move and then rotate, you can't invert the order to rotate and then move. Either way you can process the similar transformations in batches based on similarity. PS. I went on a limb here, as I have no clue what you're doing exactly. If you provide more info, we may end up suggesting something better.
    • SOLVED Start QTimer from another thread in event() function? Or other delay ?
      General and Desktop • qthread qtimer qevent qtimer arm linu • • Dariusz  

      6
      0
      Votes
      6
      Posts
      364
      Views

      You're welcome ! Since you have it working now, please mark the thread as solved using the "Topic Tools" button so other forum users may know a solution has been found :-) Seems the cache hid the fact that you did everything already !
    • UNSOLVED QEvent, QEventLoop, batch process events?
      General and Desktop • qeventloop qevent • • Dariusz  

      8
      0
      Votes
      8
      Posts
      144
      Views

      Even two if you take the QtScxml module. Well, I am not behind the design of the system so I can just offer some thoughts. I would say that if you need that level of control of the event loop, you might not be using the right tool for your use case.
    • SOLVED How to make mouseMoveEvent and keyPressEvent to be called interchangeably?
      General and Desktop • mouseevent qevent qglwidget keypressevent • • BoboFuego  

      8
      0
      Votes
      8
      Posts
      636
      Views

      @BoboFuego said in How to make mouseMoveEvent and keyPressEvent to be called interchangeably?: I don't know how to mark this thread as solved "Topic Tools" at the bottom right side and then "Mark as Solved".
    • UNSOLVED Nested QEventLoop
      General and Desktop • qapplication qeventloop qevent • • Phoenox  

      2
      0
      Votes
      2
      Posts
      426
      Views

      Events are not posted to a particular instance of an event loop object. They are posted to a thread. An event loop object does not "own" any events. It's basically a while loop that calls processEvents of a per thread event dispatcher. That being said if you nest event loops they all process the same pile of events. It's just that only the top one gets to do it while the calling ones wait for it to return.
    • SOLVED Override default copy/paste from QTextEdit
      General and Desktop • qtextedit qevent copy shortcut shortcutoverrid • • zespy  

      4
      0
      Votes
      4
      Posts
      1353
      Views

      Unfortunately, it doesn't seems to work... actions() returns me an empty list. I think I'll go for QTextEdit::createMimeDataFromSelection() because otherwise I won't be able to deal with drag & drop (I didn't think about it :/ ) Thanks anyway!
    • UNSOLVED Touchscreen input rotation using QEvent (evenfilter) - raspberry
      Mobile and Embedded • raspberry touchscreen qevent eventfilter linuxfb • • etiennedm  

      2
      0
      Votes
      2
      Posts
      1084
      Views

      @etiennedm Why don't you just use layouts?
    • UNSOLVED QWidget::setAttribute does not work with attribute Qt::WA_InputMethodEnabled as expected on Windows
      General and Desktop • qwidget qtextedit qevent qinputmethodeve • • AnkurSharma  

      4
      0
      Votes
      4
      Posts
      2932
      Views

      @AnkurSharma But, I also expect that when I am resetting the attribute of WA_InputMethodEvent my widget should no more get the input method events anymore, and thats how it works on Qt on OSX. I don't know how it works on OSX, I can say for sure though that QObject::eventFilter is executed before the QObject::event method (this is documented) and since you're not giving Qt leeway to process the event as it ordinarily would in the overriden QWidget::event method (you stop the event propagation when you return true from the event filter) you shouldn't expect it to respect the widget attribute. That's what I'm claiming. You should move your code from the eventFilter method to a QWidget::inputMethodEvent override.
    • UNSOLVED How do I: Track User Actions (determine how an action is triggered)?
      General and Desktop • qwidget qaction qevent qshortcut • • Mark A. Green  

      1
      0
      Votes
      1
      Posts
      640
      Views

      No one has replied

    • SOLVED Change Behavior of Double Click for QFileDialog
      General and Desktop • c++ qt4 qfiledialog qevent doubleclick • • DougyDrumz  

      2
      0
      Votes
      2
      Posts
      1035
      Views

      I figured it out. You can't call the connect statement for the doubleClick signal until the QListView is in scope.
    • UNSOLVED Favour invokeMethod or posting a custom event?
      General and Desktop • signal & slot threading qevent • • Jakob  

      1
      0
      Votes
      1
      Posts
      539
      Views

      No one has replied

    • How to use postEvent for QTextBrowser::setText?
      General and Desktop • qthread qevent postevent settext • • asmirn  

      2
      0
      Votes
      2
      Posts
      994
      Views

      Hi, You can modify GUI elements from other threads. You should rather use signals and slots to communicate between both. It will handle the communication properly for you.
    • Overriden event function and strange Alt+= key behaviour
      General and Desktop • qevent • • mkolenda  

      4
      0
      Votes
      4
      Posts
      1058
      Views

      IIRC Qt 5.5.0 has a bug handling certain key combination which should be fixed for 5.5.1 If you can, try with this one (you may have to built it by hand though)
    • [Solved] QEvent::LanguageChange
      General and Desktop • qapplication qevent qcoreapplicatio qguiapplication localization languagechange • • KiwiJeff  

      11
      0
      Votes
      11
      Posts
      5744
      Views

      @SGaist Fixed it ;)
    • Live observation of state machines in a Qt application
      General and Desktop • qevent statemachine dsm • • Christopher  

      4
      0
      Votes
      4
      Posts
      1414
      Views

      Then you should either check the code where they do that and integrated it to your project or add the image saving feature to GammaRay