Logo Search packages:      
Sourcecode: valknut version File versions  Download package

void DCGuiApp::tileVertically (  )  [private, slot]

Definition at line 1161 of file dcgui.cpp.

References pWorkspace.

Referenced by initActions().

{
      int i,count =0;
      int y = 0;
      int heightForEach;

      // primitive horizontal tiling
      QWidgetList windows = pWorkspace->windowList();
      if ( !windows.count() )
            return;

      for ( i = 0; i < int(windows.count()); ++i )
      {
            if ( windows.at(i)->isEnabled() )
                  count++;
      }

      if ( count > 0 )
      {
            heightForEach = pWorkspace->height() / count;

            for ( i = 0; i < int(windows.count()); ++i )
            {
                  if ( !windows.at(i)->isEnabled() )
                        continue;
                  QWidget *window = windows.at(i);
                  if ( (window->testWState( WState_Maximized )) || (window->isMinimized()))
                  {
                        // prevent flicker
                        window->hide();
                        window->showNormal();
                  }

                  int preferredHeight = window->minimumHeight()+window->parentWidget()->baseSize().height();
                  int actHeight = QMAX(heightForEach, preferredHeight);

                  window->parentWidget()->setGeometry( 0, y, pWorkspace->width(), actHeight );
                  y += actHeight;
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index