Forum
/
Qt.C++ Components
/
QtitanRibbon
/
QTitanRibbon 4.7.1 crash with QTitanDocking 2.0.0
QTitanRibbon 4.7.1 crash with QTitanDocking 2.0.0
6 years 5 months ago #1
by Jörn
Hello,
i have added QTitanDocking to the RibbonMDIDemo example:
#include <QtitanDocking.h>
#include <qtextbrowser.h>
/* ManagerRibbon */
MainWindow::MainWindow()
: RibbonWindow(Q_NULL)
{
m_typeDocCurrent = ChildInterface::td_None;
m_childCurrent = Q_NULL;
m_mdiArea = new MdiArea(this);
m_mdiArea->setLineWidth(3);
m_mdiArea->setFrameShape(QFrame::Panel);
m_mdiArea->setFrameShadow(QFrame::Sunken);
m_mdiArea->setViewMode(QMdiArea::TabbedView);
qApp->installEventFilter(this);
m_mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
m_mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
//setCentralWidget(m_mdiArea);
connect(m_mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(updateMenus()));
connect(m_mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(subWindowActivated(QMdiSubWindow*)));
m_windowMapper = new QSignalMapper(this);
connect(m_windowMapper, SIGNAL(mapped(QWidget*)), this, SLOT(setActiveSubWindow(QWidget*)));
DockMainWindow* pMainWindow = new DockMainWindow(0, Qt::Widget);
//DockToolBar* tooBar = pMainWindow->addToolBar("My Toolbar", ...
pMainWindow->dockPanelManager()->setDockPanelTransparentWhileDragging(true);
pMainWindow->dockPanelManager()->setArrowMarkersShown(true);
pMainWindow->dockPanelManager()->setDockPanelFullContentsWhileDraggingShown(true);
setCentralWidget(pMainWindow);
pMainWindow->dockPanelManager()->setCentralWidget(m_mdiArea);
setCentralWidget(pMainWindow);
// DockWidgetPanel *panel_1 = pMainWindow->dockPanelManager()->addDockPanel(tr("Panel 1"), Qtitan::LeftDockPanelArea); // 2.0.0
DockWidgetPanel *panel_1 = pMainWindow->dockPanelManager()->addDockPanel(tr("Panel 1"), Qt::LeftDockWidgetArea); // 1.2.0
panel_1->setWidget(new QTextBrowser());
RibbonMDIDemo.exe works fine with QTitanDocking 1.2.0 but with QTitanDock 2.0.0 it crashes immediately after start.
Please Log in or Create an account to join the conversation.
6 years 5 months ago - 6 years 5 months ago #2
by Developer Machines
Thank you for the report. It is a conflict in the implementation of styles. Now the bug has been fixed in the component of QtitanDocking 2.0.1.
See the code is how it can be used together:
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
RibbonStyle* ribbonStyle = new RibbonStyle;
ribbonStyle->setTheme(OfficeStyle::Office2016Colorful);
app.setStyle(ribbonStyle);
// 1 - Creating a mainwindow
RibbonMainWindow ribbonMainWindow;
ribbonMainWindow.setWindowTitle("QtitanRibbon + QtitanDocking");
QWidget* widget = new QWidget;
ribbonMainWindow.setCentralWidget(widget);
// 2 - Creating a ribbon
ribbonMainWindow.ribbonBar()->setFrameThemeEnabled();
ribbonMainWindow.ribbonBar()->addPage("&Buttons");
// 3 - Creating a dockBarManager
DockBarManager* managerBar = new DockBarManager(widget);
DockToolBar* tooBar = managerBar->addToolBar("My Toolbar", Qtitan::DockBarTop);
tooBar->addAction("Button");
// 4 - Creating a panelManager
DockPanelManager* managerPanels = new DockPanelManager(widget);
DockWidgetPanel* dockPanel1 = managerPanels->addDockPanel("My Panel_1", Qtitan::LeftDockPanelArea);
managerPanels->addDockPanel("My Panel_2", Qtitan::BottomDockPanelArea, dockPanel1);
ribbonMainWindow.show();
return app.exec();
}
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
/
QTitanRibbon 4.7.1 crash with QTitanDocking 2.0.0
Time to create page: 0.132 seconds