QT4 C++ GUI Design - Tabbed interface alternative - c++

Designing an interface with QT4 I have been advised that using multiple "Tabs" at the top of an interface to navigate different pages is not the most elegant design. Instead I would like to do something similar to the Options dialog in QT Creator 4.8.
Does anyone know the name of a widget that resembles that in the Options Dialog of QT Creator.
ex. Click Tools->Options... In QT Creator.
Notice the layout on the left hand side of the screen, which to me seems nicer than only tabs across the top of the screen.
Thanks for your help!

It's QLiveView/QListWidget with delegate that draw icon and string.
Here is link to documentation for QListView, If you are not happy with default list view delegate then you can create your own QItemDelegate to handle custom drawing. Here is sample code to create custom QItemDelegate

I just stumbled upon this implementation of a ribbon interface this morning. Maybe this is helpful to you?
http://qt-project.org/forums/viewthread/4214

Related

Qt mac switch between panels without changing window

I extensively researched this topic, mainly hindered by that I'm not sure I'm using the right words to describe my issue.
So the point is I'm developing a GUI application in C++ with Qt. The app is being developped on Mac and ftm it's intended only for mac deployment.
I want my app to behave much like System Preferences on Mac, thus accessing different views/panes by clicking buttons on the toolbar.
What I want to avoid is to have one separate window for each pane.
The closest thing I found seems to be QStackedWidget however I'm not sure what's the best way for implementing it.
Should I use it as the main class of my application? Or can I treat it as an object of MainWindow? I'm not a Qt Expert so any further insight or suggestion will be much appreciated. Thanks
QStackedWidget is definitely the way to go. Use it as your main 'container' for your widgets and implement a default main panel widget which contains your entry items, then when you click on one you can push it to be the currently displayed widget in the stack. You could try more complicated solutions to achieve it, but it's significantly easier to do with a QStackedWidget and then focus on how the interaction is handled.

Creating a tree-view with buttons? in QT

I am trying to make a dialog box like below in QT, the only problem is I have no idea what the widget is called. The bar on the left is like a tree-view widget, but when you click on it, it updates the text on the right. Does anybody happen to know what the widget is called or what widget(s) are required to perform this? I am using QT C++ on Windows.
There is an example with Qt showing you how to do this.
https://doc-snapshots.qt.io/4.8/dialogs-configdialog.html
If you're using Qt Creator as IDE, you can find it under the "Demos and Examples" tab in the Welcome Screen too.
It uses a QListWidget for the selector, and QStackedWidget to control the different pages. Connect the currentItemChanged signal of the list widget to change what page should be shown. Everything you'll need is in configdialog.cpp.
If you realy need to add QPushButton into QListWidget, use setItemWidget, or into ListView use QAbstractItemView::setIndexWidget

Adding a button to the title bar

I am writing a C++ application using Qt4 and looking to implement a GUI similar to Firefox 4. That is, I need to remove the default context menu in the top left corner of the window and replace it with three buttons. If you notice the button in Firefox 4 is right at the top in the title bar and I am uncertain as to how this can be implemented.
It won't be easy and will not be cross-platform. Read this thread in the qt forums.
You can obtain the behaviour described by implementing a tool bar. More information can be found at QT documentation on QToolBar

how to navigate one page to another page in nokia qt C++;

hi i want to make an application for nokia in nokia qt sdk.
so please help me how to navigate one page to another page in qt C++ when user press the button in one page.
There's no page concept in Qt, but you can simulate it with other widgets or components. A couple of examples:
Using Qt Desktop Widgets: http://wiki.forum.nokia.com/index.php/Create_a_page_based_UI_with_QStackedWidget_and_QToolbar
Using Qt Quick: http://doc.qt.nokia.com/4.7/declarative-modelviews-visualitemmodel.html
In Qt Quick you can also do it by changing properties like visibility or position of elements like rectangles.
And there are other ways to do this, search for examples in Forum Nokia Wiki or in Qt DevNet.
Just write in click event of button:
manwindow *mainwindow2 = new mainwindow();
mainwindow2->showExpanded();
There is also the concept of a wizard in QT:
http://doc.qt.io/archives/qt-4.7/qwizard.html
I'm not sure if that is what you are looking for as far as look n feel, but it is pretty convenient. You simply add pages to the widget itself and it will create the "Next" and "Finish" buttons for you as well as the page navigation.
Beyond that, do as Mkfnx suggested and use a stack widget or just have a dynamic dialog where you subscribe to your button events (using the connect() ) function and hide/show your widgets as you wish.

Custom system tray icon "balloon tooltips" for Qt?

I know that in the .NET framework there are a handful of alternative third-party controls for normal system tray icon "balloon tips", that allow you to change the colors and add some styling to the balloon.
I was wondering if there is something similar for Qt, which allows for better customization of the look, style, and feel of the balloon tooltips from a system tray icon.
You should have a quick glance at the "Qt Style Sheets" examples in QtAssistant. It provides strong and many ways to alter widgets looks and feel... Maybe you'll find something interesting there !
Otherwise, you could have a look at QSystemTrayIcon & QBalloonTip. Maybe by reimplementing those classes...
Hope this help a bit !