Forum
Sign Up

Ribbon + Docking + MDI(tabview style) work together well example.

5 years 7 months ago #1 by jia
QuantumStudio::QuantumStudio(QWidget *parent)
	: QxRibbonWindow(parent)
{
	m_holder = new QWidget(this);

	m_manager = new DockBarManager(m_holder);
	m_panelManager = new DockPanelManager(m_holder);
	m_panelManager->setDockPanelTransparentWhileDragging(true);
	m_panelManager->setArrowMarkersShown(true);
	m_panelManager->setDockPanelFullContentsWhileDraggingShown(true);


	m_mdiArea = new QMdiArea(m_holder);
	m_mdiArea->setLineWidth(3);
	m_mdiArea->setFrameShape(QFrame::Panel);
	m_mdiArea->setFrameShadow(QFrame::Sunken);

	m_mdiArea->setViewMode(QMdiArea::TabbedView);
	qApp->installEventFilter(this);
	setCentralWidget(m_holder);
	m_mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
	m_mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
	m_panelManager->setCentralWidget(m_mdiArea);
	m_panelManager->centralWidget()->setFocus();

	createQuickAccessBar();
	createDockWindows();
	createBackstage();
	statusBar();

	ribbonBar()->setTitleBackground(QPixmap(":/res/background.png"));

	move(QPoint(200, 200));
	QRect geom = QApplication::desktop()->availableGeometry();
	resize(2 * geom.width() / 3, 2 * geom.height() / 3);

	QSettings settings;
	QStringList files = settings.value("recentFileList").toStringList();
	settings.setValue("recentFileList", files);
	emit updateRecentFileActions(files);
	ribbonBar()->systemButton()->setToolButtonStyle(Qt::ToolButtonTextOnly);
	QListWidget* customerList = new QListWidget();
	customerList->show();
	for (int i = 0; 10 > i; i++)
		customerList->addItems(QStringList(QObject::tr("Item %1").arg(i + 1)));

	m_mdiArea->addSubWindow(customerList);
	customerList = new QListWidget();
	for (int i = 0; 10 > i; i++)
		customerList->addItems(QStringList(QObject::tr("Item %1").arg(i + 1)));

	m_mdiArea->addSubWindow(customerList);
	customerList = new QListWidget();
	for (int i = 0; 10 > i; i++)
		customerList->addItems(QStringList(QObject::tr("Item %1").arg(i + 1)));

	m_mdiArea->addSubWindow(customerList);
	customerList = new QListWidget();
	for (int i = 0; 10 > i; i++)
		customerList->addItems(QStringList(QObject::tr("Item %1").arg(i + 1)));

	m_mdiArea->addSubWindow(customerList);
}

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.114 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 )