增加打开目录功能
This commit is contained in:
parent
e6585f378e
commit
ae2d00bf59
|
@ -9,7 +9,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setFixedSize(400, 500);
|
setFixedSize(400, 500);
|
||||||
ui->lineEdit_port->setValidator(new QIntValidator(1024, 65535, this));
|
ui->lineEdit_port->setValidator(new QIntValidator(1024, 65535, this));
|
||||||
ui->lineEdit_root_dir->setText(settings.value("Directory", QApplication::applicationDirPath()).toString());
|
ui->lineEdit_root_dir->setText(settings.value("Directory", QApplication::applicationDirPath()).toString());
|
||||||
QAction *action_browse = new QAction;
|
QAction *action_browse = new QAction;
|
||||||
action_browse->setIcon(QIcon::fromTheme("folder"));
|
action_browse->setIcon(QIcon::fromTheme("folder"));
|
||||||
ui->lineEdit_root_dir->addAction(action_browse, QLineEdit::TrailingPosition);
|
ui->lineEdit_root_dir->addAction(action_browse, QLineEdit::TrailingPosition);
|
||||||
|
@ -176,6 +176,11 @@ QString MainWindow::BS(long b)
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_pushButton_openDir_pressed()
|
||||||
|
{
|
||||||
|
QDesktopServices::openUrl(QUrl(ui->lineEdit_root_dir->text()));
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::on_pushButton_send_pressed()
|
void MainWindow::on_pushButton_send_pressed()
|
||||||
{
|
{
|
||||||
QString s = ui->lineEdit_message->text();
|
QString s = ui->lineEdit_message->text();
|
||||||
|
|
|
@ -56,6 +56,7 @@ private:
|
||||||
private slots:
|
private slots:
|
||||||
void newConnect();
|
void newConnect();
|
||||||
void readyRead();
|
void readyRead();
|
||||||
|
void on_pushButton_openDir_pressed();
|
||||||
void on_pushButton_send_pressed();
|
void on_pushButton_send_pressed();
|
||||||
void on_pushButton_open_pressed();
|
void on_pushButton_open_pressed();
|
||||||
void on_pushButton_capture_pressed();
|
void on_pushButton_capture_pressed();
|
||||||
|
|
|
@ -50,16 +50,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>根目录</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -99,7 +89,8 @@
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme="media-playback-start"/>
|
<iconset theme="media-playback-start">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -134,6 +125,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QPushButton" name="pushButton_openDir">
|
||||||
|
<property name="text">
|
||||||
|
<string>根目录</string>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
Loading…
Reference in New Issue