当前位置: 首页>>代码示例>>C++>>正文


C++ QToolBar::setObjectName方法代码示例

本文整理汇总了C++中QToolBar::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolBar::setObjectName方法的具体用法?C++ QToolBar::setObjectName怎么用?C++ QToolBar::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QToolBar的用法示例。


在下文中一共展示了QToolBar::setObjectName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QLabel

void BitcoinGUI::createToolBars2()
{
    QLabel *mylabel = new QLabel (this);
   mylabel->setPixmap(QPixmap(":images/head"));
   mylabel->show();

    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setIconSize(QSize(50,25));
    toolbar->addWidget(mylabel);
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->addAction(blockAction);
    toolbar->addAction(statisticsAction);
    toolbar->addAction(optionsAction);

    QWidget* spacer = new QWidget();
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    toolbar->addWidget(spacer);
    spacer->setObjectName("spacer");
    toolbar->setStyleSheet(
    "#toolbar { font-weight:600;border:none;height:100%;padding-top:20px; background: rgb(37,40,46); text-align: left; color: white;min-width:180px;max-width:180px;}"
    "QToolBar QToolButton:hover {background:rgb(28,29,33);}"
    "QToolBar QToolButton:checked {background:rgba(28,29,33,100);}"
    "QToolBar QToolButton { font-weight:600;font-size:10px;font-family:'Century Gothic';padding-left:20px;padding-right:181px;padding-top:5px;padding-bottom:5px; width:100%; color: white; text-align: left; background:transparent;text-transform:uppercase; }");

    wId = new QWidget(this);
    wId3 = new QWidget(this);
    QToolBar *toolbars = addToolBar(tr("Settings2"));
    addToolBar(Qt::RightToolBarArea,toolbars);
    toolbars->setOrientation(Qt::Horizontal);
    toolbars->setMovable( false );
    toolbars->setStyleSheet("QToolBar QToolButton {border:0px;margin-right:3px} QToolBar{ border:0px; }");
    toolbars->setIconSize(QSize(102,25));
    QHBoxLayout *vbox5 = new QHBoxLayout();
    vbox5->addWidget(toolbars);
    vbox5->setContentsMargins(0,0,0,0);
    wId3->setFixedSize(250,30);
    wId3->move(260,10);
    wId3->setLayout(vbox5);
    wId3->setFocus();
    wId3->raise();
    QMenu *menu = new QMenu(tr("Mini"));
    menu->setStyleSheet("border:none;background:none;");
    menu->addAction(toggleHideAction);
    menu->menuAction()->setIcon(QIcon(":/icons/mini"));
    QHBoxLayout *vbox3 = new QHBoxLayout();
    vbox3->setContentsMargins(0,0,0,0);
    wId->setFixedSize(120,40);
    wId->move(915,1);
    wId->setLayout(vbox3);
    wId->setFocus();
}
开发者ID:roscoin1,项目名称:roscoin,代码行数:60,代码来源:bitcoingui.cpp

示例2: createToolBars

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::createToolBars()
{
    caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance();
    CVF_ASSERT(cmdFeatureMgr);

    QStringList toolbarNames;
    toolbarNames << "Standard"
                 << "Window Management"
                 << "View Snapshots"
                 << "View";

    for (QString toolbarName : toolbarNames)
    {
        QToolBar* toolbar = addToolBar(toolbarName);
        toolbar->setObjectName(toolbar->windowTitle());

        QStringList toolbarCommands = toolbarCommandIds(toolbarName);
        for (QString s : toolbarCommands)
        {
            toolbar->addAction(cmdFeatureMgr->action(s));
        }
    }

    m_wellLogPlotToolBarEditor = new caf::PdmUiToolBarEditor("Well Log Plot", this);
    m_wellLogPlotToolBarEditor->hide();

    m_summaryPlotToolBarEditor = new caf::PdmUiToolBarEditor("Summary Plot", this);
    m_summaryPlotToolBarEditor->hide();
}
开发者ID:OPM,项目名称:ResInsight,代码行数:32,代码来源:RiuPlotMainWindow.cpp

示例3: createToolBars

void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setFixedWidth(205);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);

    QLabel* header = new QLabel();
    header->setMinimumSize(156,156);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/images/header"));
    header->setMaximumSize(156,156);
    header->setContentsMargins(26,26,0,0);
    header->setScaledContents(true);
    toolbar->addWidget(header);

	QLabel *l = new QLabel(this);
    l->setPixmap(QPixmap(":/images/spacer"));
    toolbar->addWidget(l);
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->setStyleSheet("#toolbar {background: transparent; text-align: center; color: black;padding-right: 30px;} QToolBar QToolButton:hover {background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton {font-family:Steps; font-size:15px; font-weight: bold; min-width:125px;max-width:125px; min-height:25px;max-height:25px; color: white; text-align: left; }");

}
开发者ID:CandyCoinDev,项目名称:c1,代码行数:30,代码来源:bitcoingui.cpp

示例4: createToolBars

void spincoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setIconSize(QSize(50,25));
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
	toolbar->addAction(statisticsAction);
	toolbar->addAction(blockAction);
	toolbar->addAction(unlockWalletAction);
	toolbar->addAction(lockWalletAction);
//	toolbar->addAction(exportAction);
    QWidget* spacer = new QWidget();
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    toolbar->addWidget(spacer);
    spacer->setObjectName("spacer");


}
开发者ID:magebane,项目名称:SpinCoin,代码行数:26,代码来源:spincoingui.cpp

示例5: createToolBars

void BitcoinGUI::createToolBars()
{

    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
	toolbar->setObjectName("toolbar");
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
	addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable(false);

    QWidget* header = new QWidget();
    header->setMinimumSize(140, 45);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setStyleSheet("QWidget { background-color: rgb(0,0,0); background-repeat: no-repeat; background-image: url(:/images/header); background-position: top center; }");
    toolbar->addWidget(header);

    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
	toolbar->addAction(bittrexPageAction);
	toolbar->addAction(shockBotAction);
    toolbar->addAction(blockAction);
    toolbar->addAction(socialPageAction);
	toolbar->addAction(chatAction);
    toolbar->addAction(exportAction);
}
开发者ID:M1xProject,项目名称:M1Project,代码行数:28,代码来源:bitcoingui.cpp

示例6: main

/*
 * Steps to reproduce issue:
 * - start application
 * - click "add horizontal"
 * - click "add horizontal"
 * - click "add vertical"
 * - click "add horizontal"
 * ... the layout will look like this:
 *     11 22 44
 *     33333 44
 * - click "save state"
 * - close application
 *
 * - start application
 * - click "add vertical" 5 times
 * ... the layout will look like this:
 *     11 
 *     22
 *     33
 *     44
 *     55
 * - click "restore state"
 * ... the layout will look like this:
 *     11 22 44 55
 *     33333 44 55
 *
 * BUT since 5 was not known before I would expect its orientation
 * (vertical) to not change by the restoreState invocation
 * ... the layout should look like this:
 *     11 22 44
 *     33333 44
 *     55555555
 */
int main(int argc, char** argv)
{
    QApplication* app = new QApplication(argc, argv);
    QSettings* settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "qt_restore_state_orientation", "qt_restore_state_orientation");
    QMainWindow* mw = new QMainWindow();
    mw->resize(800, 600);

    mw->setCentralWidget(new QLabel("foo"));

    QToolBar* tb = new QToolBar();
    tb->setObjectName("toolbar");
    mw->addToolBar(tb);

    QAction* aha = new AddHorizontalAction("add horizontal", tb);
    tb->addAction(aha);
    QAction* ava = new AddVerticalAction("add vertical", tb);
    tb->addAction(ava);

    QAction* ss = new SaveStateAction("save state", tb, settings);
    tb->addAction(ss);
    QAction* rs = new RestoreStateAction("restore state", tb, settings);
    tb->addAction(rs);

    mw->show();

    app->exec();
}
开发者ID:dirk-thomas,项目名称:issue_qt_restore_state_orientation,代码行数:60,代码来源:main.cpp

示例7: createToolBars

void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Screens toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setIconSize(QSize(50,25));
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->addAction(exportAction);
    toolbar->addAction(optionsAction);

    QWidget* spacer = new QWidget();
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    toolbar->addWidget(spacer);
    spacer->setObjectName("spacer");


    QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
    toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar2->addAction(openRPCConsoleAction);
    toolbar2->setVisible(false);
}
开发者ID:Aminulhaq,项目名称:LEOcoin,代码行数:28,代码来源:bitcoingui.cpp

示例8: createGUI

void QtTrader::createGUI ()
{
  QMenuBar *menuBar = new QMenuBar();
  setMenuBar(menuBar);
  QMenu *menu = new QMenu("&Help");

  QAction* a = new QAction(QIcon(":icons/info"), tr("&About"), this);
  a->setIconVisibleInMenu(true);
  connect(a, SIGNAL(activated()), this, SLOT(about()));
  menu->addAction(a);
  menuBar->addMenu(menu);

  statusBar()->showMessage(tr("Ready"), 2000);

  QSettings settings(g_settings);
  settings.beginGroup("plugins");
  QStringList value = settings.value("gui").toStringList();
  settings.endGroup();

  QToolBar* toolbar = new QToolBar();
  for(int i = 0; i<value.size(); i++){
      toolbar->addAction(value.at(i), this, SLOT(pluginLoader()));
  }
  toolbar->show();
  toolbar->setObjectName("MainToolbar");

  addToolBar(toolbar);
  setUnifiedTitleAndToolBarOnMac(true);
}
开发者ID:WeizhongDai,项目名称:qttrader,代码行数:29,代码来源:qttrader.cpp

示例9: createToolbars

void MainWindow::createToolbars()
{
	QToolBar* fileToolBar = addToolBar("File");
	fileToolBar->setObjectName("FileToolBar");
	fileToolBar->addAction(mNewFileAction);
	fileToolBar->addAction(mSaveFileAction);
	fileToolBar->addAction(mLoadFileAction);

	QToolBar* allToolBar = addToolBar("All");
	allToolBar->setObjectName("AllToolBar");

	allToolBar->addAction(mNewPersonAction);
	allToolBar->addAction(mNewPaymentAction);
	allToolBar->addAction(mNewDebtAction);
	allToolBar->addAction(mDeleteRowAction);
}
开发者ID:christiana,项目名称:blackbook,代码行数:16,代码来源:bbMainWindow.cpp

示例10: createToolBars

void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);
	QLabel *l = new QLabel(this);
    l->setPixmap(QPixmap(":/images/spacer"));
    toolbar->addWidget(l);
    toolbar->addAction(overviewAction);
    toolbar->addAction(statisticsAction);
    toolbar->addAction(blockAction);
    toolbar->addAction(chatAction);
#ifdef ENABLE_TRADE_REQUIRE_QT5
    toolbar->addAction(TradingAction);
#endif
//    toolbar->addAction(radioAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->setStyleSheet("#toolbar { border:1px;height:100%;padding-top:100px; background: transparent; text-align: center; color: #4DD0F0;min-width:200px;max-width:200px;} QToolBar QToolButton:hover {background-image: url(:images/1); background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-image: url(:images/2); background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton { margin: 2px; background-image:url(:images/3); font-family:'Bebas'; font-size:14px; min-width:160px;max-width:160px; min-height:40px;max-height:40px; color: white; text-align: center; }");
}
开发者ID:PentaLHC,项目名称:PentaLHC,代码行数:25,代码来源:bitcoingui.cpp

示例11: QToolBar

QToolBar *String_Toolbar::create(QMainWindow *w) const
{
    QToolBar *toolbar = new QToolBar(title,w);
    toolbar->setObjectName(name);

    w->addToolBar(Qt::TopToolBarArea,toolbar);

    foreach(const QString&item, actions)
    {
        if ( item.isEmpty() )
            toolbar->addSeparator();
        else
        {
            QAction* act = w->findChild<QAction*>(item);

            if ( !act )
            {
                QMenu *menu = w->findChild<QMenu*>(item);
                if ( menu )
                    act = menu->menuAction();
            }

            if ( act )
                toolbar->addAction ( act );
            else
                qWarning() << QObject::tr("Warning:")
                          << QObject::tr("Unknown action %1").arg(item);
        }
    }

    return toolbar;
}
开发者ID:mbasaglia,项目名称:Knotter,代码行数:32,代码来源:string_toolbar.cpp

示例12: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
{
  QMenuBar *menuBar;
  QToolBar *mainToolBar;
  QWidget *centralWidget;
  QStatusBar *statusBar;
  if (this->objectName().isEmpty())
      this->setObjectName(QString::fromUtf8("MainWindow"));
  this->resize(400, 300);
  menuBar = new QMenuBar(this);
  menuBar->setObjectName(QString::fromUtf8("menuBar"));
  this->setMenuBar(menuBar);
  mainToolBar = new QToolBar(this);
  mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
  this->addToolBar(mainToolBar);
  centralWidget = new QWidget(this);
  centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
  this->setCentralWidget(centralWidget);
  statusBar = new QStatusBar(this);
  statusBar->setObjectName(QString::fromUtf8("statusBar"));
  this->setStatusBar(statusBar);

#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
  this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
#else
  this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
#endif

  QMetaObject::connectSlotsByName(this);
}
开发者ID:OpenModelica,项目名称:OMNotebook,代码行数:31,代码来源:mainwindow.cpp

示例13: createToolBars

void BitcoinGUI::createToolBars()
{

    QToolBar *toptoolbar = new QToolBar(tr("Tabs Top toolbar"));
    toptoolbar->addWidget(new Header);
    addToolBar(Qt::TopToolBarArea,toptoolbar);

    QToolBar *toolbar = new QToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("leftToolbar");
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
 //   toolbar->setContentsMargins(50,0,20,0);

    _addButtonInToolbar(overviewAction,toolbar);
    _addButtonInToolbar(sendCoinsAction,toolbar);
    _addButtonInToolbar(receiveCoinsAction,toolbar);
	_addButtonInToolbar(historyAction,toolbar);
	_addButtonInToolbar(blockAction,toolbar);
    _addButtonInToolbar(addressBookAction,toolbar);
    addToolBar(Qt::LeftToolBarArea,toolbar);
	
//    QToolBar *toolbar2 = new QToolBar(tr("Actions toolbar"));
//    toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
//    toolbar2->addAction(exportAction);

//    addToolBar(Qt::LeftToolBarArea, toolbar2);
}
开发者ID:AnarchistsPrime,项目名称:acp1.2,代码行数:26,代码来源:bitcoingui.cpp

示例14: addActionsToToolBar

static QToolBar *createToolBar(const QString &title, const QString &objectName, const ActionList &actions)
{
    QToolBar *rc =  new QToolBar;
    rc->setObjectName(objectName);
    rc->setWindowTitle(title);
    addActionsToToolBar(actions, rc);
    return rc;
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:8,代码来源:mainwindow.cpp

示例15: createToolBar

static QToolBar* createToolBar(const QString& name, QWidget* parent, bool visible) {
    QToolBar* bar = new QToolBar(parent);
    bar->setObjectName(name);
    bar->setFloatable(false);
    bar->setMovable(true);
    bar->setVisible(visible);
    return bar;
}
开发者ID:greg-hellings,项目名称:bibletime,代码行数:8,代码来源:bibletime_init.cpp


注:本文中的QToolBar::setObjectName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。