本文整理汇总了C++中QDialog::hide方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialog::hide方法的具体用法?C++ QDialog::hide怎么用?C++ QDialog::hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDialog
的用法示例。
在下文中一共展示了QDialog::hide方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wait_for_subtitle_renderer
int64_t video_output_qt::wait_for_subtitle_renderer()
{
if (_subtitle_renderer.is_initialized())
{
return 0;
}
int64_t wait_start = timer::get_microseconds(timer::monotonic);
exc init_exception;
QDialog *mbox = NULL;
// Show a dialog only in GUI mode
if (_container_is_external && !dispatch::parameters().fullscreen())
{
mbox = new QDialog(_container_widget);
mbox->setModal(true);
mbox->setWindowTitle(_("Please wait"));
QGridLayout *mbox_layout = new QGridLayout;
QLabel *mbox_label = new QLabel(_("Waiting for subtitle renderer initialization..."));
mbox_layout->addWidget(mbox_label, 0, 0);
mbox->setLayout(mbox_layout);
mbox->show();
}
else
{
msg::wrn(_("Waiting for subtitle renderer initialization..."));
}
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
try
{
while (!_subtitle_renderer.is_initialized())
{
process_events();
usleep(10000);
}
}
catch (std::exception &e)
{
init_exception = e;
}
QApplication::restoreOverrideCursor();
if (mbox)
{
mbox->hide();
delete mbox;
}
if (!init_exception.empty())
{
throw init_exception;
}
int64_t wait_stop = timer::get_microseconds(timer::monotonic);
return (wait_stop - wait_start);
}
示例2: executor
void
Replacer::advance()
{
SubtitleCompositeActionExecutor executor(*m_subtitle, i18n("Replace"));
KFind::Result res = KFind::NoMatch;
bool selection = m_replace->options() & KFind::SelectedText;
bool backwards = m_replace->options() & KFind::FindBackwards;
QDialog *replaceNextDialog = this->replaceNextDialog(); // creates the dialog if it didn't existed before
do {
if(m_replace->needData()) {
SubtitleLine *dataLine = m_iterator->current();
if(dataLine) {
if(!m_translationMode || m_targetRadioButtons[SubtitleLine::Primary]->isChecked()) {
m_feedingPrimary = true;
m_replace->setData(dataLine->primaryText().string());
} else if(m_targetRadioButtons[SubtitleLine::Secondary]->isChecked()) {
m_feedingPrimary = false;
m_replace->setData(dataLine->secondaryText().string());
} else { // m_translationMode && m_targetRadioButtons[SubtitleLine::Both]->isChecked()
m_feedingPrimary = !m_feedingPrimary; // we alternate the source of data
m_replace->setData((m_feedingPrimary ? dataLine->primaryText() : dataLine->secondaryText()).string());
}
}
}
res = m_replace->replace();
if(res == KFind::NoMatch && (!m_translationMode || !m_targetRadioButtons[SubtitleLine::Both]->isChecked() || !m_feedingPrimary)) {
if(backwards)
--(*m_iterator);
else
++(*m_iterator);
if(m_firstIndex == m_iterator->index() || (backwards ? (m_firstIndex == m_iterator->lastIndex() && m_iterator->index() == SubtitleIterator::BehindFirst) : (m_firstIndex == m_iterator->firstIndex() && m_iterator->index() == SubtitleIterator::AfterLast))) {
if(replaceNextDialog)
replaceNextDialog->hide();
if(m_instancesFound && m_replace->numReplacements())
KMessageBox::information(parentWidget(), i18np("1 replacement done.", "%1 replacements done.", m_replace->numReplacements()), i18n("Replace")
);
else // special case
KMessageBox::sorry(parentWidget(), i18n("No instances of '%1' found!", m_replace->pattern()), i18n("Replace")
);
m_replace->resetCounts();
break;
}
if(m_iterator->index() < 0) {
if(backwards)
m_iterator->toLast();
else
m_iterator->toFirst();
int numReplacements = m_replace->numReplacements();
m_replace->resetCounts();
if(KMessageBox::warningContinueCancel(parentWidget(), i18np("1 replacement done.", "%1 replacements done.", numReplacements) + "\n\n" + (backwards ? (selection ? i18n("Beginning of selection reached.\nContinue from the end?") : i18n("Beginning of subtitle reached.\nContinue from the end?")) : (selection ? i18n("End of selection reached.\nContinue from the beginning?") : i18n("End of subtitle reached.\nContinue from the beginning?"))), i18n("Replace")
) != KMessageBox::Continue)
{
if(replaceNextDialog)
replaceNextDialog->hide();
break;
}
}
}
} while(res != KFind::Match);
}
示例3: QMainWindow
SimpleClient::SimpleClient(QWidget * parent) :
QMainWindow(parent), m_actions(this),
m_script_editor(NULL), m_dlgSeqTool(NULL),
m_seqTool(NULL)
{
corbasim::gui::initialize();
QWidget * central = new QWidget;
QVBoxLayout * layout = new QVBoxLayout;
// Menu
m_menu = new QMenuBar;
setMenuBar(m_menu);
// Menu File
QMenu * menuFile = m_menu->addMenu("&File");
QMenu * editMenu = m_menu->addMenu("&Edit");
// Menu Operations
m_operations_menu = m_menu->addMenu("&Operations");
// Menu window
QMenu * menuWindow = m_menu->addMenu("&Window");
m_mainSplitter = new QSplitter(Qt::Vertical);
layout->addWidget(m_mainSplitter);
// IOR
QGroupBox * gb = new QGroupBox("Reference");
QAction * act = menuWindow->addAction("&Reference");
act->setCheckable(true);
act->setChecked(true);
connect(act, SIGNAL(toggled(bool)), gb,
SLOT(setVisible(bool)));
QHBoxLayout * gbLayout = new QHBoxLayout;
m_ref = new ObjrefWidget;
gbLayout->addWidget(m_ref);
gb->setLayout(gbLayout);
m_mainSplitter->addWidget(gb);
// Operations
gb = new QGroupBox("Operations");
act = menuWindow->addAction("&Operations");
act->setCheckable(true);
act->setChecked(true);
connect(act, SIGNAL(toggled(bool)), gb,
SLOT(setVisible(bool)));
QVBoxLayout * opsLayout = new QVBoxLayout;
m_tab = new QTabWidget;
opsLayout->addWidget(m_tab);
gb->setLayout(opsLayout);
m_mainSplitter->addWidget(gb);
// Events
gb = new QGroupBox("Events");
act = menuWindow->addAction("&Events");
act->setCheckable(true);
act->setChecked(true);
connect(act, SIGNAL(toggled(bool)), gb,
SLOT(setVisible(bool)));
gbLayout = new QHBoxLayout;
m_tree = new TreeView();
m_tree->setModel(&m_log_model);
gbLayout->addWidget(m_tree);
gb->setLayout(gbLayout);
m_mainSplitter->addWidget(gb);
// Filtered log
QDialog * filteredLogDlg = new QDialog(this);
QVBoxLayout * filteredLayout = new QVBoxLayout();
m_filteredLog = new FilteredLogView();
m_filteredLog->setLogModel(&m_log_model);
filteredLayout->setMargin(0);
filteredLayout->addWidget(m_filteredLog);
filteredLogDlg->setLayout(filteredLayout);
filteredLogDlg->hide();
// Load
QAction * loadAction = new QAction(
style()->standardIcon(QStyle::SP_DialogOpenButton),
"&Load configuration", this);
loadAction->setShortcut(QKeySequence::Open);
connect(loadAction, SIGNAL(triggered()),
this, SLOT(doLoad()));
// Save
QAction * saveAction = new QAction(
style()->standardIcon(QStyle::SP_DialogSaveButton),
"&Save configuration", this);
saveAction->setShortcut(QKeySequence::SaveAs);
connect(saveAction, SIGNAL(triggered()),
this, SLOT(doSave()));
menuFile->addAction(loadAction);
menuFile->addAction(saveAction);
menuFile->addSeparator();
menuFile->addAction("&Script editor", this, SLOT(showScriptEditor()));
menuFile->addAction("&Operation sequence", this,
//.........这里部分代码省略.........