Raphael Paper Order - raphael

I have to stick one Raphael paper over a few others, and I need to to make sure that the paper stays on top of the others. I know that for elements I could just do Element.toFront().
Is there any way to do this with Raphael papers?
(Also, there is only one small element in the top paper.)

I don't know if there is another solution but you can put one paper by div. And after that, you can just play with the z-index.
Look at this example : http://jsfiddle.net/gLeAZ/

Related

QList view from bottom to top

I'm writing a messenger, and there is a message feed there. As you all know message feeds usually look like lists and go from bottom to top, the keep the scrolling positions anchored to the bottom when a new element is added, they grow upwards when resized and all kinds of fancy behavior like that.
So, I wanted to use QListView to make the feed, I have a model written elsewhere, it's absolutely under my control. But it doesn't seem like QListView supports this mode. There is a trick of how to do it with QML, but I don't have QML used anywhere else in my project and I'm not sure of how to interact with it, like how to set there my model, how to listen for signals or if it's going to behave well in my QGridLayout where I want it to place.
I can't believe no one ever faced the same situation. I'm trying to find the most standard solution, involving as little of my rookie code as possible, keeping in mind that Qt guys are much more experienced in layouting elements in list view and handling all corner cases. If I'm correct my options are
Use QML for the feed
Try to rotate QListView with QGraphicScene tricks
Reimplement QListView
Which of those you think is a better solution? Or, may be, someone knows some better way to do it?

Qt / C++ - Scrolling & Wrapping Menu

I want to make a menu that will take an undetermined quantity of labels and spread them out horizontally so that 3 are visible on screen at once. When pressing left/right it will go to the next one, the one that is selected is always in the center of the screen horizontally with the other two on the left/right of the screen.
The problem is that I also want a smooth transition not just a replacement. They need to wrap endlessly.
Not sure where to begin, not finding examples on google.
The concept you are talking about was popularized by Apple under the name "Cover Flow".
There is a widget like that available under a permissive license here: https://code.google.com/p/pictureflow/
I take it you want something a bit simpler (only show three labels, less fancy 3D effect), but I assume this is a good starting point.
Another one is the PathView QML element:
http://qt-project.org/doc/qt-5/qml-qtquick-pathview.html#details
It is even closer to what you like to do, feature-wise. It is also available in Qt4 and there is a tutorial here: http://qt-project.org/doc/qt-4.8/declarative-modelviews-pathview.html

How to determine the content step value of scrollarea

I'm making my own UI from scratch using OpenGL that is why I'm asking this and please don't make any discouragement as this is just a hobby project.
Currently, I'm stuck implementing how this scrollbars really work. In my current implementation, the content scrolls at the wrong step value as well as the thumb, meaning, I set the value manually like 1px step for each of them.
The structure of my scrollbar implementation is describe as follows:
I draw scrollbars i.e the main rectangle where the 3 button lies.
Those 3 buttons are, thumb, buttonBack and buttonNext.
All of them do the basic logic of scrollbars i.e when I click each one of them, they moved. But the whole part(scrollbar) don't know how to scroll contents
So what I did is: I make another object and I call it scrollarea
It has two scrollbars, vertical and horizontal scrollbar.
I made a function called scrollToX and scrollToY which
does what I named to them.
But the step values I set to them are
manually set up.
I try to google some scrollbar, scrollarea, scrollview or whatever you call to that scrollable rectangle thing, but all I see are implementation and I cannot find any guides how to build your own. I have no choice but to look at their implementation. I try my best to comprehend what they did but their implementation of how their whole UI structure is very different to mine, and I cannot find anything useful there.
So I ask again here if anybody can explain me well how to make a properly functional scrollbar.
Most specific things I'm really concerned of are:
How do I determine the thumb step value?
How do I determine the content step value?
All of these depend on your content -
Is it just an image ? If so, you only need to change the offset depending on the size of the image.
Is it a list of values like in Windows explorer ? Then you need to create a data structure first that contains all of it, and shows the content that fits within the window as it scrolls.
OpenGL does not fit into this discussion.

How to make a raster in the background of a panel/tabPane/s.e

I try to create something, where you can drop different things on it, like the Qt Creator (no, i don't want to create a new one, but i need the function of that).
You drag some elements and drop them anywhere in a tabPane.
My problem now is how to make a grid/raster in the background.
It should look similar to this:
I mean those dots in the background.
If I make them with two for loops, it will take hours and it's not efficient or anything else.
There has to be a more efficient solution and a lot easier one.
I'm programming in c++ with Qt as a Framework. Please give me some links or anything else I can use.
You can:
limit the repainting to region that really needs to be updated as explained in QWidget::paintEvent documentation,
fill a container of QPoint in your loops instead of drawing the points, and draw them all with QPainter::drawPoints after the loop,
cache the result in a QPixmap with transparency and reuse it if the window size didn't change (example from Qt Quaterly).
Of course, you should do some testing to see if you gain anything at all by doing any of these optimizations.

QT Creator c++ writing Kakuro puzzle and unsure of what widget to use

I'm using QT creator and have all my methods etc designed and trying to design a UI and I'm not sure what widget I should be using to reference my puzzle layout.
I've been reading over the documentation for a while and I still am nowhere closer to finding a solution to what I should be using to display my values. I know what I should like but all I seem to find information on is various layouts of entry boxes that are in no way linked. I have no problem with coding it myself to communicate with my classes if I just knew what to use to start off with.
I need something that can help me create a layout that has up to two numbers with positions specific to the type of hint it is with a slash between the hints, black blocks that are neither hints nor stored values and squares that have values that can take up the whole square.
Layout is something similar to http://www.nikoli.co.jp/en/puzzles/kakuro/
I wish I knew what to pick >.<
Personally I'd use QGraphicsView and handle the drawing myself.
It can draw rectangles, triangles, circles and text without much effort, and that's pretty much everything you need as far as I can see. You just need to add the objects to a QGraphicsScene and you get them on the screen. You can also interact with the objects (you can find which object you're pointing at etc.)