Exemplo n.º 1
0
	void Core::ConnectSignals (BrowserWidget *widget)
	{
		SetupConnections (widget);
		connect (widget,
				SIGNAL (titleChanged (const QString&)),
				this,
				SLOT (handleTitleChanged (const QString&)));
		connect (widget,
				SIGNAL (iconChanged (const QIcon&)),
				this,
				SLOT (handleIconChanged (const QIcon&)));
		connect (widget,
				SIGNAL (needToClose ()),
				this,
				SLOT (handleNeedToClose ()));
		connect (widget,
				SIGNAL (statusBarChanged (const QString&)),
				this,
				SLOT (handleStatusBarChanged (const QString&)));
		connect (widget,
				SIGNAL (tooltipChanged (QWidget*)),
				this,
				SLOT (handleTooltipChanged (QWidget*)));
		connect (widget,
				SIGNAL (invalidateSettings ()),
				this,
				SLOT (saveSingleSession ()));
		connect (widget,
				SIGNAL (raiseTab (QWidget*)),
				this,
				SIGNAL (raiseTab (QWidget*)));
	}
Exemplo n.º 2
0
ListTaskWindow::ListTaskWindow(std::auto_ptr<ListPage> listPage)
  : TaskWindow()      
{
  setWindowIcon(listPage->windowIcon());
  setWindowTitle(listPage->windowTitle());

  QWidget* contents = this->contents();
  QVBoxLayout* contentsLayout = new QVBoxLayout(contents);
  contentsLayout->setContentsMargins(0, 0, 0, 0);
  contentsLayout->setSpacing(0);

  CommandBar* commandBar = this->commandBar();
  commandBar->addCommands(listPage->primaryActions());
  commandBar->addCommand(listPage->helpAction().get(), CommandBar::tray, false);      
  if (QAction* customizeAction = listPage->customizeAction())
  {
    commandBar->addCommand(customizeAction, CommandBar::tray, false);
  }

  listPage->setParent(contents);      
  contentsLayout->addWidget(listPage.get());
  listPage_ = listPage.release();            
      
  QWidget* footer = new QWidget(contents);
  footer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
  contentsLayout->addWidget(footer);
  QVBoxLayout* footerLayout = new QVBoxLayout(footer);
  QDialogButtonBox* buttonBox = new QDialogButtonBox(footer);
  footerLayout->addWidget(buttonBox);
  buttonBox->setStandardButtons(QDialogButtonBox::Close);
  //buttonBox->button(QDialogButtonBox::Close)->setDefault(false);

  QObject::connect(listPage_, 
      SIGNAL(doubleClicked(const QModelIndex&)), 
      SLOT(on_listPage_doubleClicked(const QModelIndex&)));
  QObject::connect(listPage_, 
      SIGNAL(windowTitleUpdated()), 
      SLOT(on_listPage_windowTitleUpdated()));
  QObject::connect(listPage_, SIGNAL(needToClose()), SLOT(close()));
  QObject::connect(buttonBox, SIGNAL(rejected()), SLOT(close()));
}