Forum
Sign Up

QTitanRibbon 4.7.1 crash with QTitanDocking 2.0.0

1 year 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.

More
1 year 5 months ago - 1 year 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();
}


Attachments:
Last edit: 1 year 5 months ago by Developer Machines.

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 MachinesEduard
Time to create page: 0.126 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 )