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


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

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


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

示例1: QWidget

KoResourceItemChooser::KoResourceItemChooser( KoAbstractResourceServerAdapter * resourceAdapter, QWidget *parent )
    : QWidget( parent ), d( new Private() )
{
    Q_ASSERT(resourceAdapter);
    d->model = new KoResourceModel(resourceAdapter, this);
    d->view = new KoResourceItemView(this);
    d->view->setModel(d->model);
    d->view->setItemDelegate( new KoResourceItemDelegate( this ) );
    d->view->setSelectionMode( QAbstractItemView::SingleSelection );
    connect( d->view, SIGNAL(clicked( const QModelIndex & ) ),
             this, SLOT(activated ( const QModelIndex & ) ) );

    d->buttonGroup = new QButtonGroup( this );
    d->buttonGroup->setExclusive( false );

    QGridLayout* layout = new QGridLayout( this );
    layout->addWidget( d->view, 0, 0, 1, 5 );

    QPushButton *button = new QPushButton( this );
    button->setIcon( SmallIcon( "list-add" ) );
    button->setToolTip( i18n("Import") );
    button->setEnabled( true );
    d->buttonGroup->addButton( button, Button_Import );
    layout->addWidget( button, 1, 0 );

    button = new QPushButton( this );
    button->setIcon( SmallIcon( "list-remove" ) );
    button->setToolTip( i18n("Delete") );
    button->setEnabled( false );
    d->buttonGroup->addButton( button, Button_Remove );
    layout->addWidget( button, 1, 1 );

    button = new QPushButton( this );
    button->setIcon( SmallIcon( "bookmarks" ) );
    button->setToolTip( i18n("Download") );
    button->setEnabled( true );
    button->hide();
    d->buttonGroup->addButton( button, Button_GhnsDownload );
    layout->addWidget( button, 1, 3 );

    button = new QPushButton( this );
    button->setIcon( SmallIcon( "download" ) );
    button->setToolTip( i18n("Share") );
    button->setEnabled( false );
    button->hide();
    d->buttonGroup->addButton( button, Button_GhnsUpload);
    layout->addWidget( button, 1, 4 );


    connect( d->buttonGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( slotButtonClicked( int ) ));

    layout->setColumnStretch( 0, 1 );
    layout->setColumnStretch( 1, 1 );
    layout->setColumnStretch( 2, 2 );
    layout->setSpacing( 0 );
    layout->setMargin( 3 );

    updateRemoveButtonState();
}
开发者ID:KDE,项目名称:koffice,代码行数:59,代码来源:KoResourceItemChooser.cpp

示例2: QDialog

ShutdownImpl::ShutdownImpl( QWidget* parent, Qt::WFlags fl )
    : QDialog( parent, fl )
{
    setupUi(this);
    timer = new QTimer( this );
    connect( timer, SIGNAL(timeout()), this, SLOT(timeout()) );

    connect( reboot, SIGNAL(clicked()), this, SLOT(rebootClicked()));
    connect( restart, SIGNAL(clicked()), this, SLOT(restartClicked()));
    connect( quit, SIGNAL(clicked()), this, SLOT(quitClicked()));
    connect( shut, SIGNAL(clicked()), this, SLOT(shutdownClicked()));

//    connect( cancel, SIGNAL(clicked()), this, SLOT(cancelClicked()) );

    progressBar->hide();
    QtopiaApplication::hideInputMethod();
#ifdef QT_QWS_SL5XXX
    QPushButton *sb = Shutdown::shutdown;
    sb->hide();
#endif

    // Bootmenu on GTA04, described here: https://github.com/radekp/gta04-init
    bool hasBootmenu = QDir("/boot/gta04-init").exists();
    bootmenuCheck->setVisible(hasBootmenu);
    if(hasBootmenu) {
        disableBootmenu();  // normally we want the bootmenu disabled
    }
    connect(bootmenuCheck, SIGNAL(stateChanged(int)), this, SLOT(bootmenuStateChanged(int)));
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:29,代码来源:shutdownimpl.cpp

示例3: setButton

void Dialog::setButton(ButtonChoice choice, Dialog::Role role, const QString & t, bool def)
{
    QPushButton * button = ui->left;
    if (choice == Dialog::Right)
    {
        button = ui->right;
    }

    if (role == Dialog::Hide)
    {
        button->hide();
        return;
    }

    button->show();

    if (role == Dialog::Accept)
    {
        connect(button, SIGNAL(clicked()), this, SLOT(accept()));
    }

    if (role == Dialog::Reject)
    {
        connect(button, SIGNAL(clicked()), this, SLOT(reject()));
    }

    button->setText(t);

    this->setFocus();
    button->setDefault(def);
}
开发者ID:batitous,项目名称:DesktopApps,代码行数:31,代码来源:dialog.cpp

示例4: hideTab

void HorizontalTabWidget::hideTab(QWidget * widget, bool hide)
{
  int index = m_pageStack->indexOf(widget);
  OS_ASSERT(index >= 0);
  
  int currentIndex = m_pageStack->currentIndex();
  if(currentIndex == index){
    if(currentIndex + 1 < m_pageStack->count()){
      currentIndex++;
    } else if (currentIndex != 0) {
      currentIndex = 0;
    } else {
      // index and currentIndex are both 0
      // can't hide both the tab and the page
      return;
    }
  }

  QPushButton * button = nullptr;
  button = m_tabButtons.at(index);
  OS_ASSERT(button);
  if(hide){
    button->hide();
  } else {
    button->show();
  }

  setCurrentIndex(currentIndex);
}
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:29,代码来源:HorizontalTabWidget.cpp

示例5: main

int main(int argc, char *argv[])
{
    Q_INIT_RESOURCE(tetrix);

//! [1]
    QApplication app(argc, argv);
    QScriptEngine engine;

    QScriptValue Qt = engine.newQMetaObject(QtMetaObject::get());
    Qt.setProperty("App", engine.newQObject(&app));
    engine.globalObject().setProperty("Qt", Qt);
//! [1]

#ifndef QT_NO_SCRIPTTOOLS
    QScriptEngineDebugger debugger;
    debugger.attachTo(&engine);
    QMainWindow *debugWindow = debugger.standardWindow();
    debugWindow->resize(1024, 640);
#endif

//! [2]
    evaluateFile(engine, ":/tetrixpiece.js");
    evaluateFile(engine, ":/tetrixboard.js");
    evaluateFile(engine, ":/tetrixwindow.js");
//! [2]

//! [3]
    TetrixUiLoader loader;
    QFile uiFile(":/tetrixwindow.ui");
    uiFile.open(QIODevice::ReadOnly);
    QWidget *ui = loader.load(&uiFile);
    uiFile.close();

    QScriptValue ctor = engine.evaluate("TetrixWindow");
    QScriptValue scriptUi = engine.newQObject(ui, QScriptEngine::ScriptOwnership);
    QScriptValue tetrix = ctor.construct(QScriptValueList() << scriptUi);
//! [3]

    QPushButton *debugButton = qFindChild<QPushButton*>(ui, "debugButton");
#ifndef QT_NO_SCRIPTTOOLS
    QObject::connect(debugButton, SIGNAL(clicked()),
                     debugger.action(QScriptEngineDebugger::InterruptAction),
                     SIGNAL(triggered()));
    QObject::connect(debugButton, SIGNAL(clicked()),
                     debugWindow, SLOT(show()));
#else
    debugButton->hide();
#endif

//! [4]
    ui->resize(550, 370);
    ui->show();

    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
    return app.exec();
//! [4]
}
开发者ID:,项目名称:,代码行数:57,代码来源:

示例6: onDayClicked

// React to a click on a day button, by removing it from the list
void ByWeekdayColumnWidget::onDayClicked()
{
    QPushButton *dayButton = qobject_cast<QPushButton*>(this->sender());

    // Remove the last number button
    listLayout->removeWidget(dayButton);
    dayButton->hide();
    dayButton->deleteLater();

    // Remove the day from the internal list
    days.removeOne(reverse ? -dayButton->text().toInt() : dayButton->text().toInt());
}
开发者ID:Rusto,项目名称:qalendar,代码行数:13,代码来源:ByWeekdayColumnWidget.cpp

示例7: slot_LoadFile

	void ARehabMainWindow::slot_LoadFile(void)
	{
		if (!dirFiles.exists())
		{
			dirFiles.mkdir("./ARehabFiles");
		}
		this->arehabFileMetadata.clear();
		if (fileDialog)
		{
			fileDialog->setFileMode(QFileDialog::ExistingFile);
			fileDialog->setDefaultSuffix(".arehab");
			if (fileDialog->exec())
			{
				QString arehabFileURL = fileDialog->selectedFiles().first();
				if (arehabFileURL != "")
				{
					this->resetGuiState1();
					this->resetGuiState2();
					this->resetGuiState3();

					this->arehabFileMetadata.arehabFileURL = QUrl::fromLocalFile(arehabFileURL).toLocalFile();
					this->arehabFileMetadata.load(this->arehabFileMetadata.arehabFileURL);

					ui.txARehabFile->setText(this->arehabFileMetadata.metadataFileURL);
					ui.txNombreEjercicio->setText(this->arehabFileMetadata.exerciseName);
					ui.txDescription->setPlainText(this->arehabFileMetadata.description);
					this->jointSelectorWidget->setJointSelectorModel(this->arehabFileMetadata.jointsInvolved);
					if (arehabFileMetadata.numRepetitions > 0)
					{
						unsigned int buttonID = (arehabFileMetadata.numRepetitions / 5) - 1;
						//ui.btGroupRepeats->buttonToggled(buttonID, true);
						for (unsigned int i = 0; i < ui.btGroupRepeats->buttons().size(); ++i)
						{
							QPushButton * bt = reinterpret_cast<QPushButton*>(ui.btGroupRepeats->button(i));
							if (bt)
							{
								if (i == buttonID){
									bt->show();
									bt->setChecked(true);
								}
								else {
									bt->hide();
								}
							}
						}
					}
					this->fileReaderController->OpenImputFile(arehabFileMetadata.arehabFileURL.toStdString());
					this->showGUIState1();
				}
			}
		}
	}
开发者ID:JJ,项目名称:ARehab,代码行数:52,代码来源:ARehab_vPaciente.cpp

示例8: ReportPreviewWindow

WeeklyTimeSheetReport::WeeklyTimeSheetReport( QWidget* parent )
    : ReportPreviewWindow( parent )
    , m_weekNumber( 0 )
    , m_yearOfWeek( 0 )
    , m_rootTask( 0 )
    , m_activeTasksOnly( false )
    , m_report( 0 )
{

    QPushButton* upload = uploadButton();
    connect(upload, SIGNAL(clicked()), SLOT(slotUploadTimesheet()) );
    if (!HttpJob::credentialsAvailable())
        upload->hide();
}
开发者ID:ahartmetz,项目名称:Charm,代码行数:14,代码来源:WeeklyTimesheet.cpp

示例9: Reset

void Tile::Reset()
{
    isRunning = 0;
    Moves=0;
    updateMoves();
    for (int i = 1; i < 16; i++) {
        QPushButton *button = idtoButton(i);
        QString str;
        button->show();
        button->setText(str.setNum(i));
    }
    QPushButton *button = idtoButton(16);
    button->hide();
    button->setText("16");
}
开发者ID:kyak,项目名称:Tile,代码行数:15,代码来源:tile.cpp

示例10: DisableButtons

    void DetachedWidgetController::DisableButtons(bool val)
    {
        if(val)
        {
            for(int i=0; i<buttongroup->layout()->count();i++)
            {
                QPushButton * item =	dynamic_cast<QPushButton*>(buttongroup->layout()->itemAt(i)->widget());
                if(item)
                {

                    item->hide();
                }
            }
        }
    }
开发者ID:Chiru,项目名称:naali,代码行数:15,代码来源:DetachedWidgetController.cpp

示例11: QWizardPage

ProgressDialogPage::ProgressDialogPage(QWidget *parent)
	: QWizardPage(parent)
{
	progressDialog = new QProgressDialog(this);
	progressDialog->setWindowFlags(Qt::Widget); //cruel hack! downgrade the dialog :P
	progressDialog->setAutoClose(false);
	progressDialog->setAutoReset(false);

	//another hack! disable the cancel button :P
	QPushButton *nullButton = new QPushButton;
	progressDialog->setCancelButton(nullButton);
	nullButton->hide();
	
	QGridLayout *l = new QGridLayout;
	l->addWidget(progressDialog);
	setLayout(l);
}
开发者ID:gkiagia,项目名称:qtwine,代码行数:17,代码来源:commonpages.cpp

示例12: apply

void SysTrayIconPlugin::apply()
{
  bool systrayon = _config->readValue("systrayon").toBool();

  if (_systrayicon != NULL) {
    if (systrayon && QSystemTrayIcon::isSystemTrayAvailable()) {
      _systrayicon->show();
      _mainwin->setQuitOnClose(false);
    } else {
      _systrayicon->hide();
      _mainwin->setQuitOnClose(true);
    }
  }

  // replace main window's quit button by a close button or restore quit button if option was unchecked.

  QFrame *mainFrmMain = _mainwin->findChild<QFrame*>("frmMain");
  QPushButton *mainBtnQuit = _mainwin->findChild<QPushButton*>("btnQuit");

  if ( systrayon && _mainButtonBar == NULL ) {
    _mainButtonBar = new SysTrayMainIconifyButtons(mainFrmMain);
    mainFrmMain->layout()->addWidget(_mainButtonBar);
    connect(_mainButtonBar->btnIconify, SIGNAL(clicked()), this, SLOT(minimize()));
    connect(_mainButtonBar->btnQuit, SIGNAL(clicked()), _mainwin, SLOT(quit()));
  }

  bool wantreplacequitbutton;
#ifdef KLF_MAC_HIDE_INSTEAD
  // the user should disable "Dock into systray" altogether if he doesn't want this
  // as the only way he would have to hide the app is through the mac menu anyway
  wantreplacequitbutton = true;
#else
  wantreplacequitbutton = _config->readValue("replacequitbutton").toBool();
#endif
    
  if ( systrayon && wantreplacequitbutton ) {
    mainBtnQuit->hide();
    _mainButtonBar->show();
  } else if (_mainButtonBar != NULL) {
    _mainButtonBar->hide();
    mainBtnQuit->show();
  }

}
开发者ID:,项目名称:,代码行数:44,代码来源:

示例13: showSpecialChars

void voxUI::showSpecialChars()
{
    QRegExp rx("specialChar_(\\d+)");
    QList<QPushButton*> allPushButtons = ui->addP->findChildren<QPushButton*>();
    QListIterator<QPushButton*> pBIter(allPushButtons);

    while(pBIter.hasNext()){
        QPushButton* next = pBIter.next();
        if(next->objectName().contains(rx)){
            if(rx.cap(1).toInt() < curSpecialList->size()){
                next->setText(curSpecialList->at(rx.cap(1).toInt()));
            }
            else{
                next->hide();
            }
        }
    }

}
开发者ID:grmpflh27,项目名称:germanVox,代码行数:19,代码来源:voxUI.cpp

示例14: QDialog

ShutdownImpl::ShutdownImpl( QWidget* parent, Qt::WFlags fl )
    : QDialog( parent, fl )
{
    setupUi(this);
    timer = new QTimer( this );
    connect( timer, SIGNAL(timeout()), this, SLOT(timeout()) );

    connect( reboot, SIGNAL(clicked()), this, SLOT(rebootClicked()));
    connect( restart, SIGNAL(clicked()), this, SLOT(restartClicked()));
    connect( quit, SIGNAL(clicked()), this, SLOT(quitClicked()));
    connect( shut, SIGNAL(clicked()), this, SLOT(shutdownClicked()));

//    connect( cancel, SIGNAL(clicked()), this, SLOT(cancelClicked()) );

    progressBar->hide();
    QtopiaApplication::hideInputMethod();
#ifdef QT_QWS_SL5XXX
    QPushButton *sb = Shutdown::shutdown;
    sb->hide();
#endif
}
开发者ID:Fale,项目名称:qtmoko,代码行数:21,代码来源:shutdownimpl.cpp

示例15: createLayout

void DkFileAssociationsPreference::createLayout() {
	
	QStringList fileFilters = Settings::param().app().openFilters;

	mModel = new QStandardItemModel(this);
	mModel->setObjectName("fileModel");
	for (int rIdx = 1; rIdx < fileFilters.size(); rIdx++)
		mModel->appendRow(getItems(fileFilters.at(rIdx), checkFilter(fileFilters.at(rIdx), Settings::param().app().browseFilters), checkFilter(fileFilters.at(rIdx), Settings::param().app().registerFilters)));

	mModel->setHeaderData(0, Qt::Horizontal, tr("Filter"));
	mModel->setHeaderData(1, Qt::Horizontal, tr("Browse"));
	mModel->setHeaderData(2, Qt::Horizontal, tr("Register"));

	QTableView* filterTableView = new QTableView(this);
	filterTableView->setModel(mModel);
	filterTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
	filterTableView->verticalHeader()->hide();
	//filterTableView->horizontalHeader()->hide();
	filterTableView->setShowGrid(false);
	filterTableView->resizeColumnsToContents();
	filterTableView->resizeRowsToContents();
	filterTableView->setWordWrap(false);

	QPushButton* openDefault = new QPushButton(tr("Set as Default Viewer"), this);
	openDefault->setObjectName("openDefault");

	// now the final widgets
	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->addWidget(filterTableView);

#ifdef Q_OS_WIN
	layout->addWidget(openDefault);
#else
	openDefault->hide();
#endif

}
开发者ID:Messna,项目名称:nomacs,代码行数:37,代码来源:DkPreferenceWidgets.cpp


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