Qt Swipe-animation to other .ui file - c++

I'm working on an application with a login page and a registration page. All the widgets on the login form have been placed using the design tab in Qt creator.
How would I go about animating all widgets on the login at the same time to swipe off to the side and introduce the register page - stored in another ui file? I tried adding all widgets to a QStackedWidget and animate that - but every widget I add to it vanishes from the form.
I just can't seem to figure this out - any help is very appreciated!

Instead of using QStackedWidget just create the new widget on top of the previous and offscreen, and use the animation to slide it into place. You don't need to animate all widgets, just the container widget, the rest will move with it.
Or better off, if you are going to make animated GUI, go for a QML UI instead. It is much easier to work with.

Related

Using QT creator, how do I create a new screen?

How can I create a new screen or page without creating a whole new window?
I would like to be able to use a push button that brings the user to a new area of the application.
A good example is in QT Creator itself how it has the "Edit" and "Design" buttons that bring the user to a new area of the program.
Use QStackedWidget.
From the docs:
The QStackedWidget class provides a stack of widgets where only one
widget is visible at a time.
QStackedWidget can be used to create a user interface similar to the
one provided by QTabWidget. It is a convenience layout widget built on
top of the QStackedLayout class.
Use the QTabWidget. You can set different widget to show on every tab

Allow user to resize widgets at runtime in QT5

I have an application written in C++/QT5 with a QListView widget within a QHBoxLayout within a QGroupBox. There is also a QTabWidget in the main window. I would like the user to be able to resize the QListView widget by clicking and dragging and for the other items to automatically resize themselves accordingly.
I feel like this should be something that is easily done within the framework of QT5, but I can't for the life of me find a way. Even having a border on the list view that I can resize within the code of my application would be a start.
Thanks to jhnnslschnr I was able to solve this via the QSplitter widget. If you're using QtCreator as I was, you can use QSplitter simply by Ctrl-clicking the widgets you want in the splitter and then selecting "Lay out horizontally (vertically) in splitter". The user can now select the partitioning at run-time.

QT window within window?

I'm setting up a small code editor using QT and following this example. However, i'm curious on how to create windows within windows or widgets within widgets. I'm trying to achieve something similar to these:
http://i.stack.imgur.com/Vn8Ut.png
http://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Download-Visual-Studio-2013-while-your-f_1431E/image_4eb5427c-1ae7-4464-9c26-2282fe8d06c3.png
Is there an example of overlaying widgets like this?
Any alternative soloution for QMessagebox for IOS development (QWidget application only)?
I gave an example of getting another QWidget to be embedded and painted on top of another one. Let me know if you have any questions about how it was done.
The PopUp flag and Qt::Tool options are also relevant.
Be sure to check out: the ToolTip property of a QWidget and the WhatsThis property of QWidget.
http://qt-project.org/doc/qt-5/qwidget.html#toolTip-prop
http://qt-project.org/doc/qt-5/qwidget.html#whatsThis-prop
There are also other ways to make borderless, focusless windows that hover and disappear quickly on command. The Window Flags and Widget Attributes in Qt are very powerful when you are looking to modify Qt Widgets.
When you parent a Widget to another widget, it will draw itself on top of the other. Then you just need to resize and position it properly.
Also subclassing existing widgets can give you more options.
Draw text on scrollbar
Also common Qt::Tools that you will find are QDockWidgets. They are awesome!
Hope that helps.
Take a look at Qt Namespace especially Qt::WA_LayoutOnEntireRect and Qt::WA_StyleSheet. Pass it as a widget attrybutes. The second option looks promising but you have to create style sheet for QWidget.

How to write a scrollable MFC custom control?

I want to write my own chart control which requires scrolling.
I found that there is a CScrollView but nothing like this for a control.
Other toolkits like Cocoa, QT or GTK offer me a base class where i can set a content view which is displayed in a viewport and saves me from writting all of the scrolling code.
The code for custom scrolling isn't that much. Create the scrollbars, write the message handlers and remember one rectangle for the current visible part.
I would just try it. If you have problems, we are here to help :-)

How do I make tab control take over entire window in Qt Creator?

I want a tab control to "dock" to the entire window panel, in Qt Creator. Now in Winforms and WPF this is super easy but in Qt its not working.
I've tried all the layouts, grid layouts, etc etc. it's just shrinking the tabs not making them grow to fill. So please test a solution before telling me what the SHOULD BE OBVIOUS answer is cause its not working.
omg QQ this is driving me NUTS
I'm unsure what you are trying to achieve here - do you want the control to fill the client area? Are you creating a QMainWindow-derived class or a QDialog-derived one? If using QMainWindow then you'd make the tab control the central widget by calling setCentralWidget. The tab control will then fill the main window's client area. I have done this many times.
Or do you want the tab 'ears' to stretch?