Adding a button to the title bar - c++

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

Related

How do I use the "new" Common Item Dialog with wxwidgets?

I want to create a file open dialog with wxwidgets that uses the "new" style of the Common Item Dialog under Win-Vista and newer. Is there any way to achive this? With the wxFileDlg() I get a dialog as shown on the right side but I'd like to get th left dialog...
both dialogs
The dialogs sample included in wxWidgets shows the example of "new style" file dialog if you use e.g. "Dialogs|File operations|Save dialog" menu item (or just press Ctrl+S) and there is nothing special to do. If this doesn't work for you, check that you're
Not using some ancient version of wxWidgets.
Have correct manifest in your application.
Not using any custom controls in your dialog, as those are only supported in old style version.
I struggled with this today so thought I would post here for the next person who has the same issue. If I were to guess, your code was calling either dialog.Center() or dialog.CenterOnParent(). I've posted a lengthy explanation of why this happens here.
From all my time spent on this today, you have to choose whether you want have the old common control dialog and be able to center it, or use the new common item dialog and have it appear in your windows top-left corner.
The good news is that Visual Studio, Word, Excel, Firefox, Chrome, and many others all use the new dialog and they all open at the top-left of the application window.

How can I add a button on the bar at the bottom of the screen for Qt Nokia?

I am developing an application for my Nokia N8 running Nokia Belle and would like to add buttons in between the left arrow button and the menu button on the bar at the bottom of the screen.
An example of what I mean can be seen when playing a station in the Nokia Internet Radio application, which, I understand, is a Mobile Qt Widget Application (not Qt Quick).
After searching around (http://www.developer.nokia.com/Community/Discussion/showthread.php?233396-QMenu-in-Symbian-Belle-in-Qt-C), I tried this code, but the button does not appear:
QAction *pDeleteButton = new QAction(style()->standardIcon(QStyle::SP_TrashIcon),QString(tr("Delete")), this);
pDeleteButton->setSoftKeyRole(QAction::NoSoftKey);
addAction(pDeleteButton);
I put this code in the constructor of the mainwindow.cpp.
Thank you for your help!
I am no expert in programming for mobile phones, but the QAction you are creating has no parent widget. If you look at the example you are linking, you will find that the original poster assigned a menu for the action via setMenu(). Did you try something like this already? If so, I would suggest you add some more context to your code and maybe a minimal example.

QT4 C++ GUI Design - Tabbed interface alternative

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

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

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.