Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 150487 Details for
Bug 233103
QPrinter: can not print if numCopies is larger than 1
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
print code
printtest.txt (text/plain), 3.04 KB, created by
The Source
on 2007-03-20 14:44:12 UTC
(
hide
)
Description:
print code
Filename:
MIME Type:
Creator:
The Source
Created:
2007-03-20 14:44:12 UTC
Size:
3.04 KB
patch
obsolete
>void CReaderWindow::Slot_Action_Print() >{ > const int strnum=32; > uint num=m_pTable_Result->numRows()/strnum; > if(m_pTable_Result->numRows()%strnum) > num++; > m_pPrinter->setMinMax(1, num); > m_pPrinter->setPageSize(QPrinter::A4); > m_pPrinter->setOrientation(QPrinter::Landscape); > if(m_pPrinter->setup(this)) > { > bool succ=true; > uint total=0; > int numcop=m_pPrinter->numCopies(); > m_pPrinter->setPageSize(QPrinter::A4); > m_pPrinter->setOrientation(QPrinter::Landscape); > QPainter p(m_pPrinter); > QPen lpen(QColor(0, 0, 0), 1); > QFont tfont("Sans", 12); > p.setPen(lpen); > p.setFont(tfont); > QPaintDeviceMetrics metrics(p.device()); > QPrinter::PrintRange prrang=m_pPrinter->printRange(); > QPrinter::PageOrder pord=m_pPrinter->pageOrder(); > int from=m_pPrinter->fromPage()-1; > int to=m_pPrinter->toPage()-1; > if(prrang==QPrinter::AllPages) > { > from=0; > to=num-1; > } > int w=metrics.width(); > int h=metrics.height(); > int dp=((pord==QPrinter::FirstPageFirst)?(1):(-1)); > int i; > int endp=((pord==QPrinter::FirstPageFirst)?(to):(from))+dp; > total=(abs(to-from)+1)*numcop; > int strh=h/(strnum+2); > for(int cop=0; cop<numcop; cop++) > { > i=((pord==QPrinter::FirstPageFirst)?(from):(to)); > do > { > int rnum=min(strnum, m_pTable_Result->numRows()-strnum*i)+1; > for(int j=0; j<=rnum; j++) > p.drawLine(0, strh*(j+1), w-1, strh*(j+1)-1); > p.drawLine(1, strh, 1, rnum*strh+strh-1); > p.drawLine(w/5, strh, w/5, rnum*strh+strh-1); > p.drawLine(3*w/10, strh, 3*w/10, rnum*strh+strh-1); > p.drawLine(2*w/5, strh, 2*w/5, rnum*strh+strh-1); > p.drawLine(4*w/5, strh, 4*w/5, rnum*strh+strh-1); > p.drawLine(w-2, strh, w-2, rnum*strh+strh-1); > > p.drawText(0, 0, w-1, strh-1, AlignLeft, tr("Results ")+QString().setNum(i*strnum+1)+"-"+QString().setNum(i*strnum+rnum-1)+ > tr(" of ")+QString().setNum(m_pTable_Result->numRows())); > p.drawText(0, strh, w/5-1, strh-1, AlignCenter, tr("Date and time")); > p.drawText(w/5, strh, w/10-1, strh-1, AlignCenter, tr("Dos. num.")); > p.drawText(3*w/10, strh, w/10-1, strh-1, AlignCenter, tr("Tab. num.")); > p.drawText(2*w/5, strh, 2*w/5-1, strh-1, AlignCenter, tr("Employee")); > p.drawText(4*w/5, strh, w/5-1, strh-1, AlignCenter, tr("Read dose, mZv")); > > for(int j=0; j<rnum-1; j++) > { > p.drawText(0, (j+2)*strh, w/5-1, strh-1, AlignRight, m_pTable_Result->text(i*strnum+j, 0)); > p.drawText(w/5, (j+2)*strh, w/10-1, strh-1, AlignRight, m_pTable_Result->text(i*strnum+j, 1)); > p.drawText(3*w/10, (j+2)*strh, w/10-1, strh-1, AlignRight, m_pTable_Result->text(i*strnum+j, 2)); > p.drawText(2*w/5, (j+2)*strh, 2*w/5-1, strh-1, AlignLeft, m_pTable_Result->text(i*strnum+j, 3)); > p.drawText(4*w/5, (j+2)*strh, w/5-1, strh-1, AlignRight, m_pTable_Result->text(i*strnum+j, 4)); > } > if(((cop!=numcop-1)||(i!=endp-dp))&&(!m_pPrinter->newPage())) > { > succ=false; > m_pStatusBar_Main->message(tr("Failed to print results!")); > } > i+=dp; > } > while(i!=endp); > } > if(succ) > m_pStatusBar_Main->message(QString().setNum(total)+tr(" pages were successfully printed")); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 233103
: 150487 |
150489