sb0 changed the topic of #m-labs to: ARTIQ, Migen, MiSoC, Mixxeo & other M-Labs projects :: fka #milkymist :: Logs http://irclog.whitequark.org/m-labs
fengling has quit [Quit: WeeChat 1.2]
fengling has joined #m-labs
rjo has quit [Ping timeout: 245 seconds]
rjo has joined #m-labs
ylamarre has joined #m-labs
fengling has quit [Ping timeout: 256 seconds]
Mon_ has joined #m-labs
Mon_ is now known as Guest69200
sb0 has quit [Read error: Connection reset by peer]
Guest69200 has quit [Quit: Leaving]
<cr1901_modern>
rjo: So it turns out, a slider w/ two elements can be done in pure PyQt: https://github.com/mkilling/QxtSpanSlider.py. I'm guessing you would prefer a widget that was closer in style to a native widget compared to me drawing on a canvas/using QGraphics Framework.
<cr1901_modern>
QGraphics Framework certainly gives me more flexibility in what I can do; it has classes to separate how graphic elements are stored, and what data is stored with them, from how to actually draw and update them.
<sb0>
i've avoided those "recursive event loop" functions in qt because they smelled bad, and indeed...
ylamarre has quit [Quit: ylamarre]
<cr1901_modern>
Why would you EVER do a recursive event loop in a language that doesn't guarantee tail recursion (I didn't read the article; I assume it crashes due to stack overflow)?
<sb0>
for blocking on modal dialogs
<sb0>
a coroutine would be more appropriate, but c++ doesn't have them ...
<whitequark>
sb0: huh? the problem is not in the event loop, it's in memory management
<whitequark>
and I don't see how PyQt would be affected
<sb0>
I know, but using a single stack for this is ugly, and encourages the memory management bug
<whitequark>
I disagree about coroutines actually, the proper way to fix this is to bind a closure to the dialog's signal
<whitequark>
(which I assume is trivial in PyQt. Or at least hope)
<whitequark>
and you can finally do that in Qt 5 in C++, too.
<cr1901_modern>
You mean by giving the dialog signal the environment on the event loop?
<whitequark>
C++11 has closures
<sb0>
yes, you can use a closure, but it breaks the flow of the program
<whitequark>
it's definitely more annoying to write in Python due to the indentation
<cr1901_modern>
I'm having trouble visualizing how a closure lets you prevent a recursive event loop. I *guess* it's because you move the blocking code of the modal dialog box out of the event loop itself, while still giving it access to all the variables it might possibly need from the event loop.
<sb0>
hm, yes, c++ doesn't have the problem
<whitequark>
the blocking is artificial, the exec() method just loops until the dialog's close signal fires
<sb0>
and potentially your function can be called recursively, if the dialog's opening is triggered by anything else than the user touching the interface
sb0_ has joined #m-labs
sb0 has quit [Read error: Connection reset by peer]
ylamarre has joined #m-labs
sb0_ has quit [Quit: Leaving]
ylamarre has quit [Quit: ylamarre]
sb0 has joined #m-labs
stekern has quit [Ping timeout: 245 seconds]
sb0 has quit [Read error: Connection reset by peer]
sb0 has joined #m-labs
<GitHub133>
[artiq] sbourdeauducq pushed 1 new commit to master: http://git.io/vRMHq
<GitHub133>
artiq/master 0da8955 Sebastien Bourdeauducq: gui: basic support for opening files outside repository
rohitksingh has joined #m-labs
<GitHub151>
[artiq] sbourdeauducq pushed 1 new commit to master: http://git.io/vRDmt
sb0 has quit [Read error: Connection reset by peer]
sb0_ has joined #m-labs
ylamarre has joined #m-labs
sb0_ has quit [Ping timeout: 250 seconds]
<rjo>
cr1901_modern: sure. but don't be too much NIH here. implementing a widget from (low level) QGraphics up might be more work in the end (bugs, corner cases, implementation details, porting to other qt versions). but i am probably not the one to gitve authoritative advice here. just pointing out a few questions.
Gurty has quit [Quit: Kooll ~o~ datalove <3³\infty]
Gurty has joined #m-labs
Gurty has joined #m-labs
<cr1901_modern>
rjo: I'm not sure what to do right now. sb0 said he potentially wants to remove the pyqtgraph dependency from the main GUI. If I do that, I will have to reimplement the axis, which yes, is a lot of code.
<cr1901_modern>
Drawing tick marks, handling labeled ticks, and ealing with how to redraw the axis when it needs to be rescaled are just three things offhand that would need to be reimplemented.