本文整理汇总了C++中QFileDialog::hide方法的典型用法代码示例。如果您正苦于以下问题:C++ QFileDialog::hide方法的具体用法?C++ QFileDialog::hide怎么用?C++ QFileDialog::hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QFileDialog
的用法示例。
在下文中一共展示了QFileDialog::hide方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveFileToDevice
void CFileBrowser::saveFileToDevice(void){
//Copy file to the device
QFileDialog fileDialog;
connect(&fileDialog,
SIGNAL(filesSelected(QStringList)),
this,
SLOT(saveFileToDeviceSelected(QStringList)), Qt::QueuedConnection);
fileDialog.setFileMode(QFileDialog::ExistingFiles);
fileDialog.exec();
fileDialog.hide();
}
示例2: OpenFileShader
void MainWindow::OpenFileShader(void){
QFileDialog *fd;
QString filter;
fd = new QFileDialog();
fd->setDirectory(sampleDir);
FileName = fd->getOpenFileName(this,tr("Open Shader Files"),sampleDir,"Shader Files ( *.vert | *.frag)", &filter);
fd->hide();
if (!FileName.isEmpty()){
glwidget->setShaderFile(FileName);
glwidget->loadShader();
}
}
示例3: QLabel
// CWFSecondPage
CWSecondPage::CWSecondPage(QWidget *parent) : DWizardPage(tr("Configure KToon"), parent)
{
setPixmap( QPixmap(wizard2_xpm) );
DVHBox *container = new DVHBox(0, Qt::Vertical);
container->boxLayout()->setAlignment(Qt::AlignTop);
new QLabel(tr("<h3>Step 1<h3>"), container);
new QLabel(tr("Choose your KToon installation directory"), container);
DVHBox *hbox1 = new DVHBox(container, Qt::Horizontal);
m_kthome = new QLineEdit(QString::fromLocal8Bit(::getenv("KTOON_HOME")), hbox1);
connect(m_kthome, SIGNAL(textChanged(const QString &)), this, SLOT(verify(const QString &)));
m_kthome->setToolTip(tr("Choose the directory where KToon is installed"));
QPushButton *button = new QPushButton(tr("Browse..."), hbox1);
QFileDialog *fd = new QFileDialog(hbox1);
connect(fd, SIGNAL(currentChanged ( const QString & )), m_kthome, SLOT(setText(const QString &)));
fd->setFileMode(QFileDialog::Directory);
fd->setModal(true);
fd->hide();
connect(button, SIGNAL(clicked()), fd, SLOT(show()));
new QLabel(tr("Choose a temporal directory"), container);
DVHBox *hbox2 = new DVHBox(container, Qt::Horizontal);
m_ktrepos = new QLineEdit(QDir::tempPath(),hbox2);
connect(m_ktrepos, SIGNAL(textChanged(const QString &)), this, SLOT(verify(const QString &)));
m_ktrepos->setToolTip(tr("Choose the directory for temporal files"));
QFileDialog *fd2 = new QFileDialog(hbox2);
connect(fd2, SIGNAL(currentChanged ( const QString & )), m_ktrepos, SLOT(setText(const QString &)));
fd2->hide();
fd2->setFileMode(QFileDialog::Directory);
fd2->setModal(true);
QPushButton *button2 = new QPushButton(tr("Browse..."), hbox2);
connect(button2, SIGNAL(clicked()), fd2, SLOT(show()));
setWidget(container);
}
示例4: on_LoadAnimBTN_clicked
/**
* @brief Loads a LED-Matrix animation from a .txt File and show it on the LED-Matrix
*
*/
void MainWindow::on_LoadAnimBTN_clicked()
{
if(m_ui->AnimSequence->text().isEmpty() == true)
{
QMessageBox::critical(this, "Error", "Please enter the sequence of the animation!", QMessageBox::Ok);
return;
}
else
{
QFileDialog dia; // = QFileDialog::getOpenFileName(this, tr("Open file"), "/home/pi/LEDMatrix/", tr("Text Files (*.txt)"));
QString fileName = dia.getOpenFileName(this, tr("Open file"), "/home/pi/LEDMatrix/", tr("Text Files (*.txt)"));
dia.hide();
ifstream file;
file.open(fileName.toStdString(), ios_base::in);
char c;
string line;
unsigned char* cArray = new unsigned char[64];
while(getline(file, line))
{
int count = 0;
for (int i = 0; i < line.length(); i++)
{
c = line[i];
if(c != ' ')
{
cArray[count] = static_cast<unsigned char>(c);
count++;
}
}
Update(cArray);
sleep_for(seconds(m_ui->AnimSequence->text().toInt()));
}
file.close();
}
}