- enhancement: Print current selection can be used in the print dialog.
This commit is contained in:
parent
89ee9d8914
commit
17160b7c3d
1
NEWS.md
1
NEWS.md
|
@ -14,6 +14,7 @@ Red Panda C++ Version 2.8
|
|||
- fix: Restore main window and cpu info window will set wrong font in the cpu info.
|
||||
- enhancement: Let encoding options in the statusbar more explicit.
|
||||
- fix: Crash when find occurrences in a project that has missing files.
|
||||
- enhancement: Print current selection can be used in the print dialog.
|
||||
|
||||
Red Panda C++ Version 2.7
|
||||
|
||||
|
|
|
@ -2954,16 +2954,19 @@ void Editor::print()
|
|||
|
||||
QPrintDialog dialog(&printer, this);
|
||||
dialog.setWindowTitle(tr("Print Document"));
|
||||
// if (editor->selAvail())
|
||||
// dialog.addEnabledOption(QAbstractPrintDialog::PrintSelection);
|
||||
dialog.setOption(QAbstractPrintDialog::PrintCurrentPage,false);
|
||||
dialog.setOption(QAbstractPrintDialog::PrintPageRange,false);
|
||||
if (selAvail())
|
||||
dialog.setOption(QAbstractPrintDialog::PrintSelection);
|
||||
if (dialog.exec() != QDialog::Accepted) {
|
||||
return;
|
||||
}
|
||||
QTextDocument doc;
|
||||
// if (editor->selAvail()) {
|
||||
// doc.setPlainText(editor->selText());
|
||||
// } else {
|
||||
QStringList lst = contents();
|
||||
QStringList lst;
|
||||
if (dialog.testOption(QAbstractPrintDialog::PrintSelection))
|
||||
lst = textToLines(selText());
|
||||
else
|
||||
lst = contents();
|
||||
for (int i=0;i<lst.length();i++) {
|
||||
int columns = 0;
|
||||
QString line = lst[i];
|
||||
|
|
|
@ -104,7 +104,6 @@ void ProjectGeneralWidget::doSave()
|
|||
|
||||
project->options().isCpp = ui->cbDefaultCpp->isChecked();
|
||||
project->options().supportXPThemes = ui->cbSupportXPTheme->isChecked();
|
||||
qDebug()<<mIconPath;
|
||||
if (mIconPath.isEmpty()
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
|
||||
|| ui->lbIcon->pixmap(Qt::ReturnByValue).isNull()) {
|
||||
|
|
Loading…
Reference in New Issue