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


C++ QComboBox::hide方法代码示例

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


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

示例1: openFontEditor

void FontWidget::openFontEditor(bool show)
{
    if (show && m_fontDialog.isNull()) {
        m_fontDialog = new QFontDialog();
        m_fontDialog->setAttribute(Qt::WA_DeleteOnClose);
        m_fontDialog->setCurrentFont(m_font);
        QComboBox *comboBox = m_fontDialog->findChild<QComboBox*>();
        QList<QLabel*> labels = m_fontDialog->findChildren<QLabel*>();
        foreach (QLabel *label, labels)
            if (label->buddy() == comboBox)
                label->hide();
        comboBox->hide();
        m_fontDialog->show();
        connect(m_fontDialog.data(), SIGNAL(accepted()), SLOT(updateFont()));
        connect(m_fontDialog.data(), SIGNAL(destroyed(QObject*)), SLOT(resetFontButton()));
    } else {
开发者ID:CNOT,项目名称:julia-studio,代码行数:16,代码来源:fontwidget.cpp

示例2: QComboBox

void
Tomahawk::EchonestControl::updateWidgets()
{
    if( !m_input.isNull() )
        delete m_input.data();
    if( !m_match.isNull() )
        delete m_match.data();
    m_overrideType = -1;

    // make sure the widgets are the proper kind for the selected type, and hook up to their slots
    if( selectedType() == "Artist" )
    {
        m_currentType = Echonest::DynamicPlaylist::Artist;

        QComboBox* match = new QComboBox();
        QLineEdit* input =  new QLineEdit();

        match->addItem( tr( "Similar To" ), Echonest::DynamicPlaylist::ArtistRadioType );
        match->addItem( tr( "Limit To" ), Echonest::DynamicPlaylist::ArtistType );
        m_matchString = match->currentText();
        m_matchData = match->itemData( match->currentIndex() ).toString();

        input->setPlaceholderText( tr( "Artist name" ) );
        input->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Fixed );
        input->setCompleter( new QCompleter( QStringList(), input ) );
        input->completer()->setCaseSensitivity( Qt::CaseInsensitive );

        connect( match, SIGNAL( currentIndexChanged(int) ), this, SLOT( updateData() ) );
        connect( match, SIGNAL( currentIndexChanged(int) ), this, SIGNAL( changed() ) );
        connect( input, SIGNAL( textChanged(QString) ), this, SLOT( updateData() ) );
        connect( input, SIGNAL( editingFinished() ), this, SLOT( editingFinished() ) );
        connect( input, SIGNAL( textEdited( QString ) ), &m_editingTimer, SLOT( stop() ) );
        connect( input, SIGNAL( textEdited( QString ) ), &m_delayedEditTimer, SLOT( start() ) );
        connect( input, SIGNAL( textEdited( QString ) ), this, SLOT( artistTextEdited( QString ) ) );

        match->hide();
        input->hide();
        m_match = QPointer< QWidget >( match );
        m_input = QPointer< QWidget >( input );
        m_data.first = m_currentType;
    }
开发者ID:AshotN,项目名称:tomahawk,代码行数:41,代码来源:EchonestControl.cpp

示例3: initialize

void FileDescriptorWidget::initialize()
{
   mpTreeWidget->clear();
   mpGcpTree->clear();
   mpGcpGroup->hide();

   if (mpFileDescriptor == NULL)
   {
      return;
   }

   // Filename
   QTreeWidgetItem* pFilenameItem = new QTreeWidgetItem(mpTreeWidget);
   if (pFilenameItem != NULL)
   {
      string filename = mpFileDescriptor->getFilename();

      pFilenameItem->setText(0, "Filename");
      pFilenameItem->setText(1, QString::fromStdString(filename));
   }

   // Data set location
   QTreeWidgetItem* pDatasetLocationItem = new QTreeWidgetItem(mpTreeWidget);
   if (pDatasetLocationItem != NULL)
   {
      string datasetLocation = mpFileDescriptor->getDatasetLocation();

      pDatasetLocationItem->setText(0, "Data Set Location");
      pDatasetLocationItem->setText(1, QString::fromStdString(datasetLocation));
   }

   // Endian
   QTreeWidgetItem* pEndianItem = new QTreeWidgetItem(mpTreeWidget);
   if (pEndianItem != NULL)
   {
      EndianType endian = mpFileDescriptor->getEndian();
      string endianText = StringUtilities::toDisplayString(endian);

      pEndianItem->setText(0, "Endian");
      pEndianItem->setText(1, QString::fromStdString(endianText));

      if (mReadOnly == false)
      {
         QComboBox* pEndianCombo = new QComboBox(mpTreeWidget);
         pEndianCombo->setEditable(false);
         pEndianCombo->addItem(QString::fromStdString(StringUtilities::toDisplayString(LITTLE_ENDIAN_ORDER)));
         pEndianCombo->addItem(QString::fromStdString(StringUtilities::toDisplayString(BIG_ENDIAN_ORDER)));
         pEndianCombo->hide();

         mpTreeWidget->setCellWidgetType(pEndianItem, 1, CustomTreeWidget::COMBO_BOX);
         mpTreeWidget->setComboBox(pEndianItem, 1, pEndianCombo);
      }
   }

   // Raster element file descriptor items
   RasterFileDescriptor* pRasterDescriptor = dynamic_cast<RasterFileDescriptor*>(mpFileDescriptor);
   if (pRasterDescriptor == NULL)
   {
      return;
   }

   mpGcpGroup->show();

   // Rows
   QTreeWidgetItem* pRowsItem = new QTreeWidgetItem();
   if (pRowsItem != NULL)
   {
      unsigned int rows = pRasterDescriptor->getRowCount();

      pRowsItem->setText(0, "Rows");
      pRowsItem->setText(1, QString::number(rows));

      mpTreeWidget->insertTopLevelItem(2, pRowsItem);
      if (mReadOnly == false)
      {
         mpTreeWidget->setCellWidgetType(pRowsItem, 1, CustomTreeWidget::LINE_EDIT);
      }
   }

   // Columns
   QTreeWidgetItem* pColumnsItem = new QTreeWidgetItem();
   if (pColumnsItem != NULL)
   {
      unsigned int columns = pRasterDescriptor->getColumnCount();

      pColumnsItem->setText(0, "Columns");
      pColumnsItem->setText(1, QString::number(columns));

      mpTreeWidget->insertTopLevelItem(3, pColumnsItem);
      if (mReadOnly == false)
      {
         mpTreeWidget->setCellWidgetType(pColumnsItem, 1, CustomTreeWidget::LINE_EDIT);
      }
   }

   // Bits per element
   QTreeWidgetItem* pBitsPerElementItem = new QTreeWidgetItem();
   if (pBitsPerElementItem != NULL)
   {
      unsigned int bitsPerElement = pRasterDescriptor->getBitsPerElement();
//.........这里部分代码省略.........
开发者ID:wzssyqa,项目名称:opticks-cmake,代码行数:101,代码来源:FileDescriptorWidget.cpp

示例4: createLayout

void BuildingComponentDialogCentralWidget::createLayout()
{
  bool isConnected = false;

  QLabel * label = new QLabel("Sort by:");
  label->hide(); // TODO remove this hack when we have sorts to do

  QComboBox * comboBox = new QComboBox(this);
  comboBox->hide(); // TODO remove this hack when we have sorts to do

  isConnected = connect(comboBox, SIGNAL(currentIndexChanged(const QString &)),
                        this, SLOT(comboBoxIndexChanged(const QString &)));
  OS_ASSERT(isConnected);

  QPushButton * upperPushButton = new QPushButton("Check All");
  isConnected = connect(upperPushButton, SIGNAL(clicked()),
                        this, SLOT(upperPushButtonClicked()));
  OS_ASSERT(isConnected);

  QHBoxLayout * upperLayout = new QHBoxLayout();
  upperLayout->addWidget(label);
  upperLayout->addWidget(comboBox);
  upperLayout->addStretch();
  upperLayout->addWidget(upperPushButton);

  m_collapsibleComponentList = new CollapsibleComponentList();

  isConnected = connect(m_collapsibleComponentList, SIGNAL(headerClicked(bool)),
                        this, SIGNAL(headerClicked(bool)));
  OS_ASSERT(isConnected);

  isConnected = connect(m_collapsibleComponentList, SIGNAL(headerClicked(bool)),
                        this, SLOT(on_headerClicked(bool)));
  OS_ASSERT(isConnected);

  isConnected = connect(m_collapsibleComponentList, SIGNAL(componentClicked(bool)),
                        this, SIGNAL(componentClicked(bool)));
  OS_ASSERT(isConnected);

  isConnected = connect(m_collapsibleComponentList, SIGNAL(componentClicked(bool)),
                        this, SLOT(on_componentClicked(bool)));
  OS_ASSERT(isConnected);

  isConnected = connect(m_collapsibleComponentList, SIGNAL(collapsibleComponentClicked(bool)),
                        this, SIGNAL(collapsibleComponentClicked(bool)));
  OS_ASSERT(isConnected);

  isConnected = connect(m_collapsibleComponentList, SIGNAL(collapsibleComponentClicked(bool)),
                        this, SLOT(on_collapsibleComponentClicked(bool)));
  OS_ASSERT(isConnected);

  isConnected = connect(m_collapsibleComponentList, SIGNAL(getComponentsByPage(int)),
                        this, SIGNAL(getComponentsByPage(int)));
  OS_ASSERT(isConnected);

  isConnected = connect(m_collapsibleComponentList, SIGNAL(getComponentsByPage(int)),
                        this, SLOT(on_getComponentsByPage(int)));
  OS_ASSERT(isConnected);

  //*******************************************************************
  // Hack code to be removed (TODO)
  m_componentList = new ComponentList();  // TODO refactor and remove

  CollapsibleComponentHeader * collapsibleComponentHeader = NULL;
  collapsibleComponentHeader = new CollapsibleComponentHeader("Constructions",100,5);

  CollapsibleComponent * collapsibleComponent = NULL;
  collapsibleComponent = new CollapsibleComponent(collapsibleComponentHeader,m_componentList);

  m_collapsibleComponentList->addCollapsibleComponent(collapsibleComponent);
  //*******************************************************************
  
  m_progressBar = new QProgressBar(this);
  m_progressBar->setVisible(false);

  QPushButton * lowerPushButton = new QPushButton("Download");
  isConnected = connect(lowerPushButton, SIGNAL(clicked()),
                        this, SLOT(lowerPushButtonClicked()));
  OS_ASSERT(isConnected);

  QHBoxLayout * lowerLayout = new QHBoxLayout();
  lowerLayout->addStretch();
  lowerLayout->addWidget(m_progressBar);
  lowerLayout->addWidget(lowerPushButton);

  QVBoxLayout * mainLayout = new QVBoxLayout();
  mainLayout->addLayout(upperLayout);

  mainLayout->addWidget(m_collapsibleComponentList,0,Qt::AlignTop);
  mainLayout->addLayout(lowerLayout);
  setLayout(mainLayout);
}
开发者ID:airguider,项目名称:OpenStudio,代码行数:92,代码来源:BuildingComponentDialogCentralWidget.cpp


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