Forum
/
Qt.C++ Components
/
QtitanRibbon
/
Cannot get a basic ribbon going...
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.
13 years 1 month ago #2
by Eduard
Why do not you set the style RibbonStyle instead OfficeStyle.
Please Log in or Create an account to join the conversation.
Eduard
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.
Forum Access
Not Allowed: to create new topic.
Not Allowed: to reply.
Not Allowed: to edit your message.
Forum
/
Qt.C++ Components
/
QtitanRibbon
/
Cannot get a basic ribbon going...
Time to create page: 0.125 seconds