工具栏增加插入<br>HTML标签
This commit is contained in:
parent
e464d9f23d
commit
e1fd7f3894
|
@ -735,10 +735,19 @@ void MainWindow::anchorClick(QUrl url)
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_action_br_triggered()
|
||||
{
|
||||
QMdiSubWindow *window = ui->mdiArea->currentSubWindow();
|
||||
if(window != nullptr){
|
||||
MdiChild *child = (MdiChild*)(window->widget());
|
||||
child->insertBR();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_action_tr_triggered()
|
||||
{
|
||||
QMdiSubWindow *window = ui->mdiArea->currentSubWindow();
|
||||
if(window != 0){
|
||||
if(window != nullptr){
|
||||
MdiChild *child = (MdiChild*)(window->widget());
|
||||
child->insertTR();
|
||||
}
|
||||
|
@ -747,7 +756,7 @@ void MainWindow::on_action_tr_triggered()
|
|||
void MainWindow::on_action_td_triggered()
|
||||
{
|
||||
QMdiSubWindow *window = ui->mdiArea->currentSubWindow();
|
||||
if(window != 0){
|
||||
if(window != nullptr){
|
||||
MdiChild *child = (MdiChild*)(window->widget());
|
||||
child->insertTD();
|
||||
}
|
||||
|
@ -756,7 +765,7 @@ void MainWindow::on_action_td_triggered()
|
|||
void MainWindow::on_action_p_triggered()
|
||||
{
|
||||
QMdiSubWindow *window = ui->mdiArea->currentSubWindow();
|
||||
if(window != 0){
|
||||
if(window != nullptr){
|
||||
MdiChild *child = (MdiChild*)(window->widget());
|
||||
child->insertP();
|
||||
}
|
||||
|
@ -765,7 +774,7 @@ void MainWindow::on_action_p_triggered()
|
|||
void MainWindow::on_action_div_triggered()
|
||||
{
|
||||
QMdiSubWindow *window = ui->mdiArea->currentSubWindow();
|
||||
if(window != 0){
|
||||
if(window != nullptr){
|
||||
MdiChild *child = (MdiChild*)(window->widget());
|
||||
child->insertDIV(lineEdit_command->text());
|
||||
}
|
||||
|
@ -774,7 +783,7 @@ void MainWindow::on_action_div_triggered()
|
|||
void MainWindow::on_action_a_triggered()
|
||||
{
|
||||
QMdiSubWindow *window = ui->mdiArea->currentSubWindow();
|
||||
if(window != 0){
|
||||
if(window != nullptr){
|
||||
MdiChild *child = (MdiChild*)(window->widget());
|
||||
child->insertA(lineEdit_command->text());
|
||||
}
|
||||
|
@ -783,7 +792,7 @@ void MainWindow::on_action_a_triggered()
|
|||
void MainWindow::on_action_img_triggered()
|
||||
{
|
||||
QMdiSubWindow *window = ui->mdiArea->currentSubWindow();
|
||||
if(window != 0){
|
||||
if(window != nullptr){
|
||||
MdiChild *child = (MdiChild*)(window->widget());
|
||||
child->insertImg(lineEdit_command->text());
|
||||
}
|
||||
|
@ -792,7 +801,7 @@ void MainWindow::on_action_img_triggered()
|
|||
void MainWindow::comboBoxHChanged(QString s)
|
||||
{
|
||||
QMdiSubWindow *window = ui->mdiArea->currentSubWindow();
|
||||
if(window != 0){
|
||||
if(window != nullptr){
|
||||
MdiChild *child = (MdiChild*)(window->widget());
|
||||
child->insertH(s);
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ private slots:
|
|||
void on_action_find_triggered();
|
||||
void on_action_indent_triggered();
|
||||
void on_action_font_triggered();
|
||||
void on_action_br_triggered();
|
||||
void on_action_tr_triggered();
|
||||
void on_action_td_triggered();
|
||||
void on_action_p_triggered();
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>26</height>
|
||||
<height>36</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu">
|
||||
|
@ -146,6 +146,7 @@
|
|||
</attribute>
|
||||
<addaction name="action_font"/>
|
||||
<addaction name="action_run"/>
|
||||
<addaction name="action_br"/>
|
||||
<addaction name="action_tr"/>
|
||||
<addaction name="action_td"/>
|
||||
<addaction name="action_p"/>
|
||||
|
@ -523,6 +524,11 @@
|
|||
<string>Ctrl+Shift+I</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_br">
|
||||
<property name="text">
|
||||
<string>br</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
|
|
@ -237,6 +237,11 @@ void MdiChild::setReadOnlyA(bool b)
|
|||
setReadOnly(b);
|
||||
}
|
||||
|
||||
void MdiChild::insertBR()
|
||||
{
|
||||
textCursor().insertText("<br>");
|
||||
}
|
||||
|
||||
void MdiChild::insertH(QString h)
|
||||
{
|
||||
QString s = textCursor().selection().toPlainText(); //可以显示换行符
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
void insertTR();
|
||||
void insertTD();
|
||||
void insertP();
|
||||
void insertBR();
|
||||
void insertDIV(QString se);
|
||||
void insertA(QString se);
|
||||
void insertImg(QString se);
|
||||
|
|
Loading…
Reference in New Issue