c++ - Use custom tab bar with QMdiArea -


i see qmdiarea has tabbed view mode. want able split main window 2 qmdiarea widgets , able drag , drop tabs between each of them. have done simple qtabwidget can set custom tab bar. @ same time want switch qmdiarea view mode using qtabwidget not option me. don't see methods set custom tab bar within qmdiarea. still have hope done. can suggest something?

tested solution qt 4.8 (edit)

after time of research can suggest following solution. have make new class inheriting qmdiarea. set view mode tabbedview make standart qtabbar constructed within qmdiarea. children , find qtabbar widget qstring(qobject::metaobject()->classname()) == "qtabbar". hide it. blank area above document in tabbedview mode. construct custom tab bar , reparent custom mdi area. connect signals , slots fired , used when sub windows , tabs activated. can have custom tab bar class member of custom mdi area.

if have found post useful please vote on it. thanks.

some code example.

  1. looking standart qtabbar within custom mdi area in constructor:

    m_pmdiareatabbar = null; m_pmdiarea->setviewmode(qmdiarea::tabbedview); qobjectlist listchildren = m_pmdiarea->children(); (qobjectlist::iterator = listchildren.begin(); != listchildren.end(); ++i) { if (qstring((*i)->metaobject()->classname()) == "qtabbar") { m_pmdiareatabbar = dynamic_cast<qtabbar*>(*i); break; } } 
  2. reparent:

    m_ptabbar->setparent(m_pmdiarea); 
  3. hiding:

    if (m_pmdiareatabbar != 0) m_pmdiareatabbar->hide(); 
  4. signals & slots used: qmdiarea::subwindowactivated(qmdisubwindow*), qtabbar::currentchanged(int)


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -