Forum
Sign Up

Cannot get a basic ribbon going...

13 years 1 month ago #1 by Raul Guerrero
Hi, I'm trying to setup a basic ribbon to see how it works, and haven't been able to. Also the lack of documentation is of no help either.

Can someone help me please? here's the code on a MainWindow I created, please help me see what's missing.


#include <QtitanRibbon.h>
#include <QtnOfficeStyle.h>
#include <QtnOfficeDefines.h>

#include <QApplication>
#include <QCheckBox>
#include <QRadioButton>

#include "MainWindow.h"

using namespace Qtitan;

MainWindow::MainWindow(QWidget *parent)
: RibbonMainWindow(parent)
{
setCentralWidget(new QWidget());

setWindowTitle("title");

setToolButtonStyle(Qt::ToolButtonTextOnly);
OfficeStyle* style = new OfficeStyle();
style->setOptionStyle(OfficeStyle::OS_OFFICE2010SILVER);
qApp->setStyle(style);

ribbonBar()->addMenu("Menu 1");
ribbonBar()->addMenu("Menu 2");
ribbonBar()->addMenu("Menu 3");

RibbonPage* file = ribbonBar()->addPage("File");
file->setTitle("Archivo");
RibbonGroup* fileGroup1 = file->addGroup("group 1");
fileGroup1->setOptionButtonVisible(true);

QCheckBox* check1 = new QCheckBox(tr("CheckBox 1"));
check1->setToolTip(tr("CheckBox 1"));
check1->setCheckState(Qt::Checked);
fileGroup1->addWidget(check1);

QCheckBox* check2 = new QCheckBox(tr("CheckBox 2"));
check2->setToolTip(tr("CheckBox 2"));
check2->setCheckState(Qt::Unchecked);
fileGroup1->addWidget(check2);

QCheckBox* check3 = new QCheckBox(tr("CheckBox 3"));
check3->setToolTip(tr("CheckBox 3"));
check3->setCheckState(Qt::Unchecked);
fileGroup1->addWidget(check3);

fileGroup1->addSeparator();

QRadioButton* radio1 = new QRadioButton(tr("Radio Button 1"));
radio1->setToolTip(tr("Radio Button 1"));
radio1->setChecked(true);
fileGroup1->addWidget(radio1);

QRadioButton* radio2 = new QRadioButton(tr("Radio Button 2"));
radio2->setToolTip(tr("Radio Button 2"));
fileGroup1->addWidget(radio2);

QRadioButton* radio3 = new QRadioButton(tr("Radio Button 3"));
radio3->setToolTip(tr("Radio Button 3"));
fileGroup1->addWidget(radio3);

ribbonBar()->setFrameThemeEnabled();
}

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #2 by Eduard
Replied by Eduard on topic Cannot get a basic ribbon going...
Why do not you set the style RibbonStyle instead OfficeStyle.

Please Log in or Create an account to join the conversation.

  • Eduard
  • Eduard's Avatar
13 years 1 month ago #3 by Raul Guerrero
Thanks Eduard!

I didn't know I had to use RibbonStyle instead of OfficeStyle, there's nothing like that on the documentation.

It works now thanks!

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.125 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )