MyMainWindow::MyMainWindow() : KMainWindow(0) { text = new QLabel(i18n("<h1>Hello, World!</h1>"), this); setCentralWidget(text); QPopupMenu *filePopup = new QPopupMenu(this); KAction *quitAction = KStdAction::quit(this, SLOT(fileQuit()), actionCollection()); clearAction = new KAction(i18n("&Clear"), "stop", Qt::CTRL + Qt::Key_X, this, SLOT(fileClear()), actionCollection(), "file_clear"); KToggleAction *toolbarAction = new KToggleAction(i18n("Show &Toolbar"), 0, actionCollection(), "settings_show_toolbar"); toolbarAction->setChecked(true); connect(toolbarAction, SIGNAL(toggled(bool)), this, SLOT(toggleToolBar(bool))); QPopupMenu *settingsMenu = new QPopupMenu(); toolbarAction->plug(settingsMenu); clearAction->plug(filePopup); clearAction->plug(toolBar()); quitAction->plug(filePopup); quitAction->plug(toolBar()); menuBar()->insertItem(i18n("&File"), filePopup); menuBar()->insertSeparator(); menuBar()->insertItem("&Settings", settingsMenu); menuBar()->insertSeparator(); menuBar()->insertItem(i18n("&Help"), helpMenu()); }
void PMShell::slotShowToolbar( ) { if( toolBar( )->isVisible ( ) ) toolBar( )->hide( ); else toolBar( )->show( ); }
MyMainWindow::MyMainWindow() : KMainWindow(0) { text = new QLabel(i18n("<h1>Hello, World!</h1>"), this); setCentralWidget(text); QPopupMenu *filePopup = new QPopupMenu(this); KAction *quitAction = KStdAction::quit(this, SLOT(fileQuit()), actionCollection()); clearAction = new KAction(i18n("&Clear"), "stop", Qt::CTRL + Qt::Key_X, this, SLOT(fileClear()), actionCollection(), "file_clear"); clearAction->plug(filePopup); clearAction->plug(toolBar()); quitAction->plug(filePopup); quitAction->plug(toolBar()); menuBar()->insertItem(i18n("&File"), filePopup); menuBar()->insertSeparator(); menuBar()->insertItem(i18n("&Help"), helpMenu()); statusBar()->insertItem("Line xxx", 1); statusBar()->insertItem("Column xxx", 2); statusBar()->insertItem("Zoom: 100%", 3); //statusBar()->message("Ready..."); falls Statuszeile nur aus einem Feld besteht //statusBar()->message("Ready...", 2000); zeige Nachricht fuer 2000 Millisekunden }
void k2send::optionsShowToolbar() { if (m_toolbarAction->isChecked()) toolBar()->show(); else toolBar()->hide(); }
void MyMainWindow::toggleToolBar(bool doShow) { if (doShow) toolBar()->show(); else toolBar()->hide(); }
/** Constructor. */ KMahjongg::KMahjongg( QWidget* parent, const char *name) : KMainWindow(parent, name) { boardEditor = 0; // init board widget bw = new BoardWidget( this ); setCentralWidget( bw ); previewLoad = new Preview(this); setupStatusBar(); setupKAction(); gameTimer = new GameTimer(toolBar()); toolBar()->insertWidget(ID_GAME_TIMER, gameTimer->width() , gameTimer); toolBar()->alignItemRight( ID_GAME_TIMER, true ); theHighScores = new HighScore(this); bDemoModeActive = false; connect( bw, SIGNAL( statusTextChanged(const QString&, long) ), SLOT( showStatusText(const QString&, long) ) ); connect( bw, SIGNAL( tileNumberChanged(int,int,int) ), SLOT( showTileNumber(int,int,int) ) ); connect( bw, SIGNAL( demoModeChanged(bool) ), SLOT( demoModeChanged(bool) ) ); connect( bw, SIGNAL( gameOver(unsigned short , unsigned short)), this, SLOT( gameOver(unsigned short , unsigned short))); connect(bw, SIGNAL(gameCalculated()), this, SLOT(timerReset())); // Make connections for the preview load dialog connect( previewLoad, SIGNAL( boardRedraw(bool) ), bw, SLOT( drawBoard(bool) ) ); connect( previewLoad, SIGNAL( layoutChange() ), this, SLOT( newGame() ) ); connect( previewLoad, SIGNAL( loadBackground(const QString&, bool) ), bw, SLOT(loadBackground(const QString&, bool) ) ); connect( previewLoad, SIGNAL( loadTileset(const QString &) ), bw, SLOT(loadTileset(const QString&) ) ); connect( previewLoad, SIGNAL( loadBoard(const QString&) ), SLOT(loadBoardLayout(const QString&) ) ); startNewGame( ); }
void kerp::optionsShowToolbar() { // this is all very cut and paste code for showing/hiding the // toolbar if (m_toolbarAction->isChecked()) toolBar()->show(); else toolBar()->hide(); }
void KstApp::slotViewToolBar() { slotUpdateStatusMsg(i18n("Toggling toolbar...")); // turn Toolbar on or off if(ToolBarAction->isChecked()) { toolBar("mainToolBar")->show(); } else { toolBar("mainToolBar")->hide(); } slotUpdateStatusMsg(i18n("Ready.")); }
void KMouthApp::slotViewPhrasebookBar() { slotStatusMsg(i18n("Toggling phrasebook bar...")); /////////////////////////////////////////////////////////////////// // turn Toolbar on or off if (!viewPhrasebookBar->isChecked()) { toolBar(QLatin1String("phrasebookBar"))->hide(); } else { toolBar(QLatin1String("phrasebookBar"))->show(); } slotStatusMsg(i18nc("The job is done", "Ready.")); }
void FmDriverView::initToolBar() { mToolBarLeftAction = new HbAction( this ); mToolBarLeftAction->setObjectName( "leftAction" ); mToolBarLeftAction->setText( hbTrId( "txt_fmgr_opt_backup" ) ); toolBar()->addAction( mToolBarLeftAction ); mToolBarRightAction = new HbAction( this ); mToolBarRightAction->setObjectName( "rightAction" ); mToolBarRightAction->setText( hbTrId( "txt_fmgr_opt_restore" ) ); toolBar()->addAction( mToolBarRightAction ); toolBar()->setOrientation( Qt::Horizontal ); }
void UIServer::slotSelection() { QListViewItemIterator it(listProgress); for(; it.current(); ++it) { if(it.current()->isSelected()) { toolBar()->setItemEnabled(TOOL_CANCEL, TRUE); return; } } toolBar()->setItemEnabled(TOOL_CANCEL, FALSE); }
TimeTrackingWindow::TimeTrackingWindow( QWidget* parent ) : CharmWindow( tr( "Time Tracker" ), parent ) , m_weeklyTimesheetDialog( 0 ) , m_monthlyTimesheetDialog( 0 ) , m_activityReportDialog( 0 ) , m_summaryWidget( new TimeTrackingView( toolBar(), this ) ) , m_billDialog( new BillDialog( this ) ) { setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); setWindowNumber( 3 ); setWindowIdentifier( QLatin1String( "window_tracking" ) ); setCentralWidget( m_summaryWidget ); connect( m_summaryWidget, SIGNAL( startEvent( TaskId ) ), SLOT( slotStartEvent( TaskId ) ) ); connect( m_summaryWidget, SIGNAL( stopEvents() ), SLOT( slotStopEvent() ) ); connect( &m_checkUploadedSheetsTimer, SIGNAL( timeout() ), SLOT( slotCheckUploadedTimesheets() ) ); connect( m_billDialog, SIGNAL( finished(int) ), SLOT( slotBillGone(int) ) ); //Check every 60 minutes if there are timesheets due m_checkUploadedSheetsTimer.setInterval(60 * 60 * 1000); if (CONFIGURATION.warnUnuploadedTimesheets) m_checkUploadedSheetsTimer.start(); }
QSize kgeography::getPreferredSize() { int ySize = 0; ySize = menuBar() -> size().height() + toolBar() -> size().height() + ((mapAsker*) p_askWidget)->mapSize().height(); return QSize(p_underLeftWidget -> size().width() + ((mapAsker*) p_askWidget)->mapSize().width() + 1, ySize + 1); }
void KMJobViewer::loadPluginActions() { int mpopindex(7), toolbarindex(!m_standalone?7:8), menuindex(7); QMenuData *menu(0); if (m_standalone) { // standalone window, insert actions into main menubar KAction *act = actionCollection()->action("job_restart"); for (int i=0; i<act->containerCount(); i++) { if (menuBar()->findItem(act->itemId(i), &menu)) { menuindex = mpopindex = menu->indexOf(act->itemId(i))+1; break; } } } QValueList<KAction*> acts = m_manager->createPluginActions(actionCollection()); for (QValueListIterator<KAction*> it=acts.begin(); it!=acts.end(); ++it) { // connect the action to this connect((*it), SIGNAL(activated(int)), SLOT(pluginActionActivated(int))); // should add it to the toolbar and menubar (*it)->plug(toolBar(), toolbarindex++); if (m_pop) (*it)->plug(m_pop, mpopindex++); if (menu) (*it)->plug(static_cast<QPopupMenu*>(menu), menuindex++); } }
void KInfoCenter::createToolBar() { KStandardAction::quit(this, SLOT(close()), actionCollection()); KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection()); toolBar()->setMovable(false); m_aboutKcm = actionCollection()->addAction("help_about_module"); m_aboutKcm->setText(i18nc("Information about current module located in about menu","About Current Information Module")); m_aboutKcm->setIcon(KIcon("help")); m_aboutKcm->setEnabled(false); m_exportAction = new KAction(this); m_exportAction->setText(i18nc("Export button label", "Export")); m_exportAction->setIcon(KIcon("document-export")); m_moduleHelpAction = new KAction(this); m_moduleHelpAction->setText(i18nc("Module help button label", "Module Help")); m_moduleHelpAction->setIcon(KIcon("help-contextual")); m_helpAction = new KActionMenu( KIcon("help-contents"), i18nc("Help button label","Help"), this ); m_helpAction->setDelayed( false ); actionCollection()->addAction("export", m_exportAction); actionCollection()->addAction("helpModule", m_moduleHelpAction); actionCollection()->addAction("helpMenu", m_helpAction); }
AddressWidget::AddressWidget(Window *window, QWidget *parent) : ComboBoxWidget(parent), m_window(nullptr), m_lineEdit(new LineEditWidget(this)), m_completionModel(new AddressCompletionModel(this)), m_completionView(nullptr), m_visibleView(nullptr), m_bookmarkLabel(nullptr), m_feedsLabel(nullptr), m_loadPluginsLabel(nullptr), m_urlIconLabel(nullptr), m_completionModes(NoCompletionMode), m_hints(WindowsManager::DefaultOpen), m_removeModelTimer(0), m_isHistoryDropdownEnabled(SettingsManager::getValue(SettingsManager::AddressField_EnableHistoryDropdownOption).toBool()), m_isNavigatingCompletion(false), m_isUsingSimpleMode(false), m_wasPopupVisible(false) { ToolBarWidget *toolBar(qobject_cast<ToolBarWidget*>(parent)); if (!toolBar) { m_isUsingSimpleMode = true; } setEditable(true); setLineEdit(m_lineEdit); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setMinimumWidth(100); setItemDelegate(new AddressDelegate(AddressDelegate::HistoryMode, this)); setInsertPolicy(QComboBox::NoInsert); setMouseTracking(true); setWindow(window); optionChanged(SettingsManager::AddressField_CompletionModeOption, SettingsManager::getValue(SettingsManager::AddressField_CompletionModeOption)); optionChanged(SettingsManager::AddressField_DropActionOption, SettingsManager::getValue(SettingsManager::AddressField_DropActionOption)); optionChanged(SettingsManager::AddressField_SelectAllOnFocusOption, SettingsManager::getValue(SettingsManager::AddressField_SelectAllOnFocusOption)); m_lineEdit->setStyleSheet(QLatin1String("QLineEdit {background:transparent;}")); m_lineEdit->installEventFilter(this); view()->installEventFilter(this); view()->viewport()->setAttribute(Qt::WA_Hover); view()->viewport()->setMouseTracking(true); view()->viewport()->installEventFilter(this); if (toolBar) { optionChanged(SettingsManager::AddressField_ShowBookmarkIconOption, SettingsManager::getValue(SettingsManager::AddressField_ShowBookmarkIconOption)); optionChanged(SettingsManager::AddressField_ShowFeedsIconOption, SettingsManager::getValue(SettingsManager::AddressField_ShowFeedsIconOption)); optionChanged(SettingsManager::AddressField_ShowUrlIconOption, SettingsManager::getValue(SettingsManager::AddressField_ShowUrlIconOption)); m_lineEdit->setPlaceholderText(tr("Enter address or search…")); connect(SettingsManager::getInstance(), SIGNAL(valueChanged(int,QVariant)), this, SLOT(optionChanged(int,QVariant))); if (toolBar->getIdentifier() != ToolBarsManager::NavigationBar) { connect(toolBar, SIGNAL(windowChanged(Window*)), this, SLOT(setWindow(Window*))); } }
void BookmarkToolBar::startDrag() { KBookmarkActionInterface *action = dynamic_cast<KBookmarkActionInterface *>(m_dragAction); if (action) { QMimeData *mimeData = new QMimeData; KBookmark bookmark = action->bookmark(); QByteArray address = bookmark.address().toLatin1(); mimeData->setData(BookmarkManager::bookmark_mime_type(), address); bookmark.populateMimeData(mimeData); QDrag *drag = new QDrag(toolBar()); drag->setMimeData(mimeData); if (bookmark.isGroup()) { drag->setPixmap(KIcon(bookmark.icon()).pixmap(24, 24)); } else { drag->setPixmap(rApp->iconManager()->iconForUrl(action->bookmark().url()).pixmap(24, 24)); } drag->start(Qt::MoveAction); connect(drag, SIGNAL(destroyed()), this, SLOT(dragDestroyed())); } }
UIServer::UIServer() : KMainWindow(0, ""), DCOPObject("UIServer"), m_shuttingDown(false), m_configDialog(0), m_contextMenu(0), m_systemTray(0) { readSettings(); // setup toolbar toolBar()->insertButton("editdelete", TOOL_CANCEL, SIGNAL(clicked()), this, SLOT(slotCancelCurrent()), FALSE, i18n("Cancel")); toolBar()->insertButton("configure", TOOL_CONFIGURE, SIGNAL(clicked()), this, SLOT(slotConfigure()), true, i18n("Settings...")); toolBar()->setBarPos(KToolBar::Left); // setup statusbar statusBar()->insertItem(i18n(" Files: %1 ").arg(0), ID_TOTAL_FILES); statusBar()->insertItem(i18n("Remaining Size", " Rem. Size: %1 kB ").arg("0"), ID_TOTAL_SIZE); statusBar()->insertItem(i18n("Remaining Time", " Rem. Time: 00:00:00 "), ID_TOTAL_TIME); statusBar()->insertItem(i18n(" %1 kB/s ").arg("0"), ID_TOTAL_SPEED); // setup listview listProgress = new ListProgress(this, "progresslist"); setCentralWidget(listProgress); connect(listProgress, SIGNAL(selectionChanged()), SLOT(slotSelection())); connect(listProgress, SIGNAL(executed(QListViewItem *)), SLOT(slotToggleDefaultProgress(QListViewItem *))); connect(listProgress, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)), SLOT(slotShowContextMenu(KListView *, QListViewItem *, const QPoint &))); // setup animation timer updateTimer = new QTimer(this); connect(updateTimer, SIGNAL(timeout()), SLOT(slotUpdate())); m_bUpdateNewJob = false; setCaption(i18n("Progress Dialog")); setMinimumSize(150, 50); resize(m_initWidth, m_initHeight); applySettings(); /* if ((m_bShowList) && (m_keepListOpen)) { cerr<<"show() !"<<endl; show(); } else*/ hide(); }
dspOrderActivityByProject::dspOrderActivityByProject(QWidget* parent, const char*, Qt::WindowFlags fl) : display(parent, "dspOrderActivityByProject", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Order Activity by Project")); setListLabel(tr("Orders")); setReportName("OrderActivityByProject"); setMetaSQLOptions("orderActivityByProject", "detail"); setUseAltId(true); _run = false; list()->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "name" ); list()->addColumn(tr("Status"), _orderColumn, Qt::AlignLeft, true, "status" ); list()->addColumn(tr("Item #"), _itemColumn, Qt::AlignLeft, true, "item" ); list()->addColumn(tr("Description"), -1 , Qt::AlignLeft, true, "descrip" ); list()->addColumn(tr("Account/Customer"), -1 , Qt::AlignLeft, true, "customer" ); list()->addColumn(tr("Contact"), -1 , Qt::AlignLeft, false, "contact" ); list()->addColumn(tr("City"), -1 , Qt::AlignLeft, false, "city" ); list()->addColumn(tr("State"), -1 , Qt::AlignLeft, false, "state" ); list()->addColumn(tr("Qty"), _qtyColumn, Qt::AlignRight, true, "qty" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom" ); list()->addColumn(tr("Value"), _qtyColumn, Qt::AlignRight, true, "value" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignRight, true, "due" ); list()->addColumn(tr("Assigned"), _dateColumn, Qt::AlignRight, true, "assigned" ); list()->addColumn(tr("Started"), _dateColumn, Qt::AlignRight, true, "started" ); list()->addColumn(tr("Completed"), _dateColumn, Qt::AlignRight, true, "completed" ); list()->addColumn(tr("Hrs. Budget"), _qtyColumn, Qt::AlignRight, true, "hrs_budget" ); list()->addColumn(tr("Hrs. Actual"), _qtyColumn, Qt::AlignRight, true, "hrs_actual" ); list()->addColumn(tr("Hrs. Balance"), _qtyColumn, Qt::AlignRight, true, "hrs_balance" ); list()->addColumn(tr("Exp. Budget"), _priceColumn, Qt::AlignRight, true, "exp_budget" ); list()->addColumn(tr("Exp. Actual"), _priceColumn, Qt::AlignRight, true, "exp_actual" ); list()->addColumn(tr("Exp. Balance"), _priceColumn, Qt::AlignRight, true, "exp_balance" ); list()->setPopulateLinear(true); disconnect(newAction(), SIGNAL(triggered()), this, SLOT(sNew())); connect(newAction(), SIGNAL(triggered()), this, SLOT(sNewProjectTask())); connect(_showSo, SIGNAL(checked()), this, SLOT(sFillList())); connect(_showPo, SIGNAL(checked()), this, SLOT(sFillList())); connect(_showWo, SIGNAL(checked()), this, SLOT(sFillList())); QToolButton * newBtn = (QToolButton*)toolBar()->widgetForAction(newAction()); newBtn->setPopupMode(QToolButton::MenuButtonPopup); QAction *menuItem; QMenu * newMenu = new QMenu; menuItem = newMenu->addAction(tr("Task"), this, SLOT(sNewProjectTask())); menuItem->setEnabled(_privileges->check("MaintainAllProjects")); newMenu->addSeparator(); menuItem = newMenu->addAction(tr("Sales Order"), this, SLOT(sNewSalesOrder())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); menuItem = newMenu->addAction(tr("Purchase Order"), this, SLOT(sNewPurchaseOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menuItem = newMenu->addAction(tr("Work Order"), this, SLOT(sNewWorkOrder())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); newBtn->setMenu(newMenu); }
void BookmarkToolBar::contextMenu(const QPoint &point) { KBookmarkActionInterface *action = dynamic_cast<KBookmarkActionInterface*>(toolBar()->actionAt(point)); KBookmark bookmark = rApp->bookmarkManager()->manager()->toolbar(); bool nullAction = true; if (action) { bookmark = action->bookmark(); nullAction = false; } BookmarksContextMenu menu(bookmark, rApp->bookmarkManager()->manager(), rApp->bookmarkManager()->owner(), nullAction); menu.exec(toolBar()->mapToGlobal(point)); }
HelpBrowserDocklet::HelpBrowserDocklet( QWidget *parent ): Docklet(tr("Help browser"), parent) { mHelpBrowser = new HelpBrowser; setAllowedAreas(Qt::AllDockWidgetAreas); setWidget(mHelpBrowser); mFindBox = new HelpBrowserFindBox(); toolBar()->addWidget( mHelpBrowser->loadProgressIndicator(), 1 ); toolBar()->addAction( mHelpBrowser->mActions[HelpBrowser::GoHome] ); toolBar()->addAction( mHelpBrowser->mWebView->pageAction(QWebPage::Back) ); toolBar()->addAction( mHelpBrowser->mWebView->pageAction(QWebPage::Forward) ); toolBar()->addAction( mHelpBrowser->mWebView->pageAction(QWebPage::Reload) ); toolBar()->addWidget( mFindBox ); connect( mFindBox, SIGNAL(query(QString, bool)), mHelpBrowser, SLOT(findText(QString, bool)) ); connect(Main::scProcess(), SIGNAL(started()), this, SLOT(onInterpreterStart())); OverridingAction * action; action = new OverridingAction(this); action->setShortcut(QKeySequence::Find); action->addToWidget(mHelpBrowser); action->addToWidget(toolBar()); connect( action, SIGNAL(triggered(bool)), mFindBox, SLOT(setFocus()) ); connect( action, SIGNAL(triggered(bool)), mFindBox, SLOT(selectAll()) ); }
todoList::todoList(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "todoList", fl) { setupUi(optionsWidget()); setWindowTitle(tr("To-Do Items")); setReportName("TodoList"); setMetaSQLOptions("todolist", "detail"); setUseAltId(true); setParameterWidgetVisible(true); setNewVisible(true); setQueryOnStartEnabled(true); parameterWidget()->append(tr("Assigned"), "assigned_username", ParameterWidget::User, omfgThis->username()); parameterWidget()->append(tr("Assigned Pattern"), "assigned_usr_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User); parameterWidget()->append(tr("Owner Pattern"), "owner_usr_pattern", ParameterWidget::Text); parameterWidget()->append(tr("CRM Account"), "crmacct_id", ParameterWidget::Crmacct); parameterWidget()->append(tr("Start Date Before"), "startStartDate", ParameterWidget::Date); parameterWidget()->append(tr("Start Date After"), "startEndDate", ParameterWidget::Date); parameterWidget()->append(tr("Due Date Before"), "dueStartDate", ParameterWidget::Date); parameterWidget()->append(tr("Due Date After"), "dueEndDate", ParameterWidget::Date); parameterWidget()->applyDefaultFilterSet(); connect(_completed, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_todolist, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_incidents, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_projects, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); list()->addColumn(tr("Type"), _userColumn, Qt::AlignCenter, true, "type"); list()->addColumn(tr("Seq"), _seqColumn, Qt::AlignRight, false, "seq"); list()->addColumn(tr("Priority"), _userColumn, Qt::AlignLeft, true, "priority"); list()->addColumn(tr("Assigned To"),_userColumn, Qt::AlignLeft, true, "usr"); list()->addColumn(tr("Name"), 100, Qt::AlignLeft, true, "name"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignLeft, true, "status"); list()->addColumn(tr("Start Date"),_dateColumn, Qt::AlignLeft, false, "start"); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignLeft, true, "due"); list()->addColumn(tr("Parent#"), _orderColumn, Qt::AlignLeft, true, "number"); list()->addColumn(tr("Customer#"),_orderColumn, Qt::AlignLeft, false, "cust"); list()->addColumn(tr("Account#"), _orderColumn, Qt::AlignLeft, false, "crmacct_number"); list()->addColumn(tr("Account Name"), 100, Qt::AlignLeft, true, "crmacct_name"); list()->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false,"owner"); QToolButton * newBtn = (QToolButton*)toolBar()->widgetForAction(newAction()); newBtn->setPopupMode(QToolButton::MenuButtonPopup); QAction *menuItem; QMenu * todoMenu = new QMenu; menuItem = todoMenu->addAction(tr("Incident"), this, SLOT(sNewIncdt())); menuItem->setEnabled(_privileges->check("MaintainIncidents")); menuItem = todoMenu->addAction(tr("To-Do Item"), this, SLOT(sNew())); menuItem->setShortcut(QKeySequence::New); menuItem->setEnabled(_privileges->check("MaintainPersonalTodoList") || _privileges->check("MaintainOtherTodoLists")); newBtn->setMenu(todoMenu); }
void AbstractDataView::setToolBarVisible(bool visible) { if (!visible && !m_toolBar) { return; } toolBar()->setVisible(visible); }
void MainWindow::setWidgetsVisible(bool makeVisible) { // state flags static bool bookmarksToolBarFlag; static bool historyPanelFlag; static bool bookmarksPanelFlag; KToolBar *mainBar = toolBar("mainToolBar"); KToolBar *bookBar = toolBar("bookmarksToolBar"); if (!makeVisible) { // save current state, if in windowed mode if (!isFullScreen()) { bookmarksToolBarFlag = bookBar->isHidden(); historyPanelFlag = m_historyPanel->isHidden(); bookmarksPanelFlag = m_bookmarksPanel->isHidden(); } bookBar->hide(); m_view->setTabBarHidden(true); m_historyPanel->hide(); m_bookmarksPanel->hide(); // hide main toolbar mainBar->hide(); } else { // show main toolbar mainBar->show(); m_view->setTabBarHidden(false); // restore state of windowed mode if (!bookmarksToolBarFlag) bookBar->show(); if (!historyPanelFlag) m_historyPanel->show(); if (!bookmarksPanelFlag) m_bookmarksPanel->show(); } }
void KMahjongg::setDisplayedWidth() { bw->setDisplayedWidth(); /* setFixedSize( bw->size() + QSize( 2, (!statusBar()->isHidden() ? statusBar()->height() : 0) + 2 + menuBar()->height() ) ); toolBar()->setFixedWidth(bw->width());*/ toolBar()->alignItemRight( ID_GAME_TIMER, true ); bw->drawBoard(); }
PrefixControlWidget::PrefixControlWidget(QWidget *parent) : QWidget(parent) { // Loading libq4wine-core.so #ifdef RELEASE libq4wine.setFileName(_CORELIB_PATH_); #else libq4wine.setFileName("../q4wine-lib/libq4wine-core"); #endif if (!libq4wine.load()){ libq4wine.load(); } // Getting corelib calss pointer CoreLibClassPointer = (CoreLibPrototype *) libq4wine.resolve("createCoreLib"); CoreLib.reset((corelib *)CoreLibClassPointer(true)); this->createActions(); std::auto_ptr<QToolBar> toolBar (new QToolBar(this)); toolBar->setIconSize(QSize(24, 24)); toolBar->addAction(prefixAdd.get()); toolBar->addSeparator (); toolBar->addAction(prefixImport.get()); toolBar->addAction(prefixExport.get()); toolBar->addSeparator (); toolBar->addAction(prefixDelete.get()); toolBar->addSeparator (); toolBar->addAction(prefixSettings.get()); toolBar->addSeparator (); toolBar->addAction(prefixSetup.get()); prefixTable.reset(new QTableView(this)); connect(prefixTable.get(), SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequested(const QPoint &))); connect(prefixTable.get(), SIGNAL(clicked(const QModelIndex &)), this, SLOT(itemClicked(const QModelIndex &))); prefixTable->setContextMenuPolicy(Qt::CustomContextMenu); std::auto_ptr<QVBoxLayout> layout (new QVBoxLayout(this)); layout->setSpacing(0); layout->setContentsMargins(0,0,0,0); layout->addWidget(toolBar.release()); layout->addWidget(prefixTable.get()); model.reset(new QSqlQueryModel()); prefixTable->setSelectionBehavior(QAbstractItemView::SelectRows); prefixTable->setSelectionMode(QAbstractItemView::SingleSelection); this->setLayout(layout.release()); this->updateTableModel(); return; }
void FmFileView::initToolBar() { toolBar()->clearActions(); mFindAction = new HbAction( this ); mFindAction->setObjectName( "leftAction" ); mFindAction->setText( hbTrId("txt_fmgr_opt_find") ); mFindAction->setDisabled( mIsFindDisabled ); toolBar()->addAction( mFindAction ); toolBar()->setOrientation( Qt::Horizontal ); mSortNameAction = new HbAction( this ); mSortNameAction->setText( hbTrId( "txt_fmgr_setlabel_sort_by_name" ) ); mSortTimeAction = new HbAction( this ); mSortTimeAction->setText( hbTrId( "txt_fmgr_setlabel_sort_by_time" ) ); mSortSizeAction = new HbAction( this ); mSortSizeAction->setText( hbTrId( "txt_fmgr_setlabel_sort_by_size" ) ); mSortTypeAction = new HbAction( this ); mSortTypeAction->setText( hbTrId( "txt_fmgr_setlabel_sort_by_type" ) ); mSortExtension = new HbToolBarExtension(); mSortExtension->addAction( mSortNameAction ); mSortExtension->addAction( mSortTimeAction ); mSortExtension->addAction( mSortSizeAction ); mSortExtension->addAction( mSortTypeAction ); HbAction* extensionAction = toolBar()->addExtension( mSortExtension ); extensionAction->setText( hbTrId("txt_fmgr_opt_sort")); connect( mFindAction, SIGNAL( triggered() ), this, SLOT( on_leftAction_triggered() ) ); connect( mSortNameAction, SIGNAL( triggered() ), this, SLOT( on_sortNameAction_triggered() ), Qt::QueuedConnection ); connect( mSortTimeAction, SIGNAL( triggered() ), this, SLOT( on_sortTimeAction_triggered() ), Qt::QueuedConnection ); connect( mSortSizeAction, SIGNAL( triggered() ), this, SLOT( on_sortSizeAction_triggered() ), Qt::QueuedConnection ); connect( mSortTypeAction, SIGNAL( triggered() ), this, SLOT( on_sortTypeAction_triggered() ), Qt::QueuedConnection ); }
void KMouthApp::readOptions() { KConfigGroup cg(config, "General Options"); // bar status settings bool bViewMenubar = cg.readEntry("Show Menubar", true); viewMenuBar->setChecked(bViewMenubar); slotViewMenuBar(); // FIXME: Toolbar disabled so it will compile. // bool bViewToolbar = cg.readEntry("Show Toolbar", QVariant(true)).toBool(); // viewToolBar->setChecked(bViewToolbar); // slotViewToolBar(); bool bViewPhrasebookbar = cg.readEntry("Show Phrasebook Bar", true); viewPhrasebookBar->setChecked(bViewPhrasebookbar); bool bViewStatusbar = cg.readEntry("Show Statusbar", true); viewStatusBar->setChecked(bViewStatusbar); slotViewStatusBar(); // bar position settings // FIXME: // KToolBar::BarPosition toolBarPos; // toolBarPos=(KToolBar::BarPosition) cg.readEntry("ToolBarPos", int(KToolBar::Top)); // toolBar("mainToolBar")->setBarPos(toolBarPos); QSize size = cg.readEntry("Geometry", QSize()); if (!size.isEmpty()) { resize(size); } optionsDialog->readOptions(config.data()); toolBar(QLatin1String("mainToolBar"))->applySettings(config->group("mainToolBar")); toolBar(QLatin1String("phrasebookBar"))->applySettings(config->group("phrasebookBar")); slotPhrasebookConfirmed(); if (phraseList != 0) phraseList->readCompletionOptions(config.data()); }
PostDocklet::PostDocklet(QWidget* parent): Docklet(tr("Post window"), parent) { setAllowedAreas(Qt::BottomDockWidgetArea | Qt::RightDockWidgetArea | Qt::LeftDockWidgetArea); mPostWindow = new PostWindow; setWidget(mPostWindow); toolBar()->addAction( mPostWindow->mActions[PostWindow::AutoScroll] ); //connect(this, SIGNAL(topLevelChanged(bool)), this, SLOT(onFloatingChanged(bool))); }
void QtSyncStatusLogView::createMenu() { HbMenu* myMenu = menu(); connect( myMenu->addAction( tr("Update")), SIGNAL( triggered() ), SLOT( updateView() ) ); connect( myMenu->addAction( tr("Delete log")), SIGNAL( triggered() ), SLOT( deleteLog() ) ); connect( myMenu->addAction( tr("Back")), SIGNAL( triggered() ), SLOT( goToMainView() ) ); HbToolBar* myToolBar = toolBar(); connect( myToolBar->addAction( tr("Update")), SIGNAL( triggered() ), SLOT( updateView() ) ); connect( myToolBar->addAction( tr("Delete log")), SIGNAL( triggered() ), SLOT( deleteLog() ) ); connect( myToolBar->addAction( tr("Back")), SIGNAL( triggered() ), SLOT( goToMainView() ) ); }