Giter Club home page Giter Club logo

aqt-cassowary's People

Contributors

ala-ableton avatar arximboldi avatar hannahwhy avatar kant avatar mak-ableton avatar miv-ableton avatar nre-ableton avatar rco-ableton avatar ske-ableton avatar toh-ableton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aqt-cassowary's Issues

Add named entities for debug

Debugging constraints and the output of debug: true can be messy. It would be nice to be able to name constraints and variables such that they show like that in the debugging output. This might need changes to Rhea.

Splitters.qml does not work on Windows and Linux

An error rises that seems to caused by a wrong order when initializing objects. We should investigate further and improve the queuing of changes to the solver such that it enforces a correct order.

Make 1.0 release

The library API has been quite stable for the last few months and has been used in production without major issues. It makes sense to make a 1.0 release.

Remaining tasks:

  • Add an installation target -- i.e. make install
  • Add a distribution target -- make dist to build tarballs.
  • Tag and upload

Ninja not working with CMake

Reproduce

$ mkdir build
$ cd build
$ cmake -GNinja ..
$ nina
ninja: error: 'src/rhea-prefix/lib/librhea-s.a', needed by 'output/libAqtCassowaryPlugin.so', missing and no known rule to make it

Default GNU make generator works fine though.

Updates are often 1-frame late

One can see this when resizing the window in the different examples. Resolutions should happen in the same frame, but we still should do the queuing that we do now. A good way to achieve this is by using the polish() and updatePolisth() API of QQuickItem

Explore alternative syntaxes

The current syntax works and is very declarative, but it is kinda verbose. There are several strategies one can find to fix this problem.

One strategy is to simply add more helpers such that some common cases can be come more terse and require less construction of Qt objects. I like the idea of requiring less QObjects a lot, so for example, we could try rewriting this:

Solver {
    Variable { id: var1 }
    Variable { id: var2 }
    Constraint { expr: geq(var2, var1) }
    Constraint { expr: eq(plus(var2, var1), 100) }
    Constraint { espr: leq(var2, 200) }
}

As:

property Variable var1: Variable {}
property Variable var2: Variable {}
property Variable var3: Variable {}
Solver {
    constraints: [
      geq(var2, var1),
      eq(plus(var2, var1), 100),
      leq(var2, 200)
    ]
}

Note that declaring variables like that is already possible (they don't need to be in the solver). I am not sure whether it's a good idea or not. It depends on whether you want/need to expose them to the outside world.

A nother intersting approach, but less QML-ish, would be to use strings instead and parse the expressions, like this:

Solver {
    variables: [ "var1", "var2" ]
    constraints: [
        "var1 >= var2",
        "var2 + var1 == 100",
        "var2 <= 200"
    ]
}

In this later case, the API would need a major revamp, such that one could access the values of these string-identified variables. It lso becomes more tricky to inject values that come with QML, since one need then to manipulate the string somehow, and it might perform worse if constraints change often (which they should not anyways, but...).

Crash when resizing splitter window too small

While running the example Splitters.qml app, if you quickly resize the window smaller such that minimum sizes are not possible to maintain, you get a crash:

libc++abi.dylib: terminating with uncaught exception of type rhea::internal_error: dual_optimize: no pivot found

Process:               qmlscene [38401]
Path:                  /Volumes/VOLUME/*/qmlscene
Identifier:            qmlscene
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        Python [38398]
Responsible:           Terminal [315]
User ID:               502

Date/Time:             2015-01-28 13:49:26.833 +0100
OS Version:            Mac OS X 10.10.1 (14B25)
Report Version:        11
Anonymous UUID:        EFB97EAA-C3CD-BD5F-AD8C-26F1610BA6F4

Sleep/Wake UUID:       0FC0CBDB-F97D-4047-A59B-E860D7279480

Time Awake Since Boot: 760000 seconds
Time Since Wake:       20000 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000

Application Specific Information:
terminating with uncaught exception of type rhea::internal_error: dual_optimize: no pivot found
abort() called

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff953e6282 __pthread_kill + 10
1   libsystem_c.dylib               0x00007fff96a75b73 abort + 129
2   libc++abi.dylib                 0x00007fff8be3ea21 abort_message + 257
3   libc++abi.dylib                 0x00007fff8be669b9 default_terminate_handler() + 243
4   libobjc.A.dylib                 0x00007fff90ffc6db _objc_terminate() + 124
5   libc++abi.dylib                 0x00007fff8be640a1 std::__terminate(void (*)()) + 8
6   libc++abi.dylib                 0x00007fff8be63d48 __cxa_rethrow + 99
7   libobjc.A.dylib                 0x00007fff90ffc4e4 objc_exception_rethrow + 40
8   com.apple.AppKit                0x00007fff924bc7f0 -[NSWindow(NSWindowResizing) _resizeWithEvent:] + 1778
9   com.apple.AppKit                0x00007fff91e73eb9 -[NSTitledFrame mouseDown:] + 200
10  com.apple.AppKit                0x00007fff91e73caa -[NSThemeFrame mouseDown:] + 68
11  com.apple.AppKit                0x00007fff9230cf4f -[NSWindow _reallySendEvent:] + 12827
12  com.apple.AppKit                0x00007fff91d9750c -[NSWindow sendEvent:] + 368
13  libqcocoa.dylib                 0x000000010d214717 -[QNSWindow superSendEvent:] + 39
14  libqcocoa.dylib                 0x000000010d2140bb -[QNSWindowHelper handleWindowEvent:] + 411
15  com.apple.AppKit                0x00007fff91d49096 -[NSApplication sendEvent:] + 2238
16  libqcocoa.dylib                 0x000000010d22b00e -[QNSApplication sendEvent:] + 78
17  com.apple.AppKit                0x00007fff91bd5e98 -[NSApplication run] + 711
18  libqcocoa.dylib                 0x000000010d22792d QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 2189
19  org.qt-project.QtCore           0x000000010a0c33fd QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 381
20  org.qt-project.QtCore           0x000000010a0c63da QCoreApplication::exec() + 346
21  qmlscene                        0x000000010947e2ec main + 11516
22  qmlscene                        0x000000010947b444 start + 52

Add utilities for layout with Cassowary

The most common usecase of this library, layout, is still kinda cumbersome with this library since one still needs to map all the values to and from the Cassowary variables. It would be nice to have sensible defaults and utilities to be able to write code like this:

import Aqt.Cassowary.Layout 1.0

Layout {
    id: root

    Constraint { expr: eq(button2.left, plus(button1.right, 20)) }
    Constraint { expr: eq(root.horizontalCenter, divide(plus(button1.left, button2.right), 2)) }

    Anchors {
        id: button1
        Button {}
    }

    Anchors {
        id: button2
        Button {}
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.