Changeset View
Changeset View
Standalone View
Standalone View
src/wrtembed/KReportDesigner.cpp
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | |||||
108 | public: | 108 | public: | ||
109 | Private(){} | 109 | Private(){} | ||
110 | 110 | | |||
111 | ~Private() | 111 | ~Private() | ||
112 | { | 112 | { | ||
113 | delete zoom; | 113 | delete zoom; | ||
114 | delete sectionData; | 114 | delete sectionData; | ||
115 | delete set; | 115 | delete set; | ||
116 | delete kordata; | 116 | delete dataSource; | ||
117 | } | 117 | } | ||
118 | 118 | | |||
119 | QGridLayout *grid; | 119 | QGridLayout *grid; | ||
120 | KReportRuler *hruler; | 120 | KReportRuler *hruler; | ||
121 | KReportZoomHandler *zoom; | 121 | KReportZoomHandler *zoom; | ||
122 | QVBoxLayout *vboxlayout; | 122 | QVBoxLayout *vboxlayout; | ||
123 | KReportPropertiesButton *pageButton; | 123 | KReportPropertiesButton *pageButton; | ||
124 | 124 | | |||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 163 | #endif | |||
177 | qreal releaseX = -1; | 177 | qreal releaseX = -1; | ||
178 | qreal releaseY = -1; | 178 | qreal releaseY = -1; | ||
179 | 179 | | |||
180 | bool modified = false; // true if this document has been modified, false otherwise | 180 | bool modified = false; // true if this document has been modified, false otherwise | ||
181 | 181 | | |||
182 | QString originalInterpreter; //Value of the script interpreter at load time | 182 | QString originalInterpreter; //Value of the script interpreter at load time | ||
183 | QString originalScript; //Value of the script at load time | 183 | QString originalScript; //Value of the script at load time | ||
184 | 184 | | |||
185 | KReportData *kordata = nullptr; | 185 | KReportDataSource *dataSource = nullptr; | ||
staniek: kordata -> dataSource | |||||
186 | }; | 186 | }; | ||
187 | 187 | | |||
188 | KReportDesigner::KReportDesigner(QWidget * parent) | 188 | KReportDesigner::KReportDesigner(QWidget * parent) | ||
189 | : QWidget(parent), d(new Private()) | 189 | : QWidget(parent), d(new Private()) | ||
190 | { | 190 | { | ||
191 | init(); | 191 | init(); | ||
192 | } | 192 | } | ||
193 | 193 | | |||
▲ Show 20 Lines • Show All 242 Lines • ▼ Show 20 Line(s) | |||||
436 | } | 436 | } | ||
437 | 437 | | |||
438 | void KReportDesigner::slotSectionEditor() | 438 | void KReportDesigner::slotSectionEditor() | ||
439 | { | 439 | { | ||
440 | KReportSectionEditor se(this); | 440 | KReportSectionEditor se(this); | ||
441 | (void)se.exec(); | 441 | (void)se.exec(); | ||
442 | } | 442 | } | ||
443 | 443 | | |||
444 | void KReportDesigner::setReportData(KReportData* kodata) | 444 | void KReportDesigner::setDataSource(KReportDataSource* source) | ||
staniek: [ ] kodata -> source | |||||
445 | { | 445 | { | ||
446 | if (d->kordata == kodata) { | 446 | if (d->dataSource == source) { | ||
447 | return; | 447 | return; | ||
448 | } | 448 | } | ||
449 | delete d->kordata; | 449 | delete d->dataSource; | ||
450 | 450 | | |||
451 | d->kordata = kodata; | 451 | d->dataSource = source; | ||
452 | slotPageButton_Pressed(); | 452 | slotPageButton_Pressed(); | ||
453 | setModified(true); | 453 | setModified(true); | ||
454 | emit reportDataChanged(); | 454 | emit reportDataChanged(); | ||
455 | } | 455 | } | ||
456 | 456 | | |||
457 | KReportDesignerSection * KReportDesigner::section(KReportSectionData::Section s) const | 457 | KReportDesignerSection * KReportDesigner::section(KReportSectionData::Section s) const | ||
458 | { | 458 | { | ||
459 | KReportDesignerSection *sec; | 459 | KReportDesignerSection *sec; | ||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Line(s) | 642 | { | |||
643 | return d->set; | 643 | return d->set; | ||
644 | } | 644 | } | ||
645 | 645 | | |||
646 | KPropertySet* KReportDesigner::itemPropertySet() const | 646 | KPropertySet* KReportDesigner::itemPropertySet() const | ||
647 | { | 647 | { | ||
648 | return d->itmset; | 648 | return d->itmset; | ||
649 | } | 649 | } | ||
650 | 650 | | |||
651 | KReportData *KReportDesigner::reportData() const | 651 | KReportDataSource *KReportDesigner::reportDataSource() const | ||
652 | { | 652 | { | ||
653 | return d->kordata; | 653 | return d->dataSource; | ||
654 | } | 654 | } | ||
655 | 655 | | |||
656 | KReportDesignerSectionDetail * KReportDesigner::detailSection() const | 656 | KReportDesignerSectionDetail * KReportDesigner::detailSection() const | ||
657 | { | 657 | { | ||
658 | return d->detail; | 658 | return d->detail; | ||
659 | } | 659 | } | ||
660 | 660 | | |||
661 | QString KReportDesigner::reportTitle() const | 661 | QString KReportDesigner::reportTitle() const | ||
Show All 14 Lines | 675 | if (d->modified) { | |||
676 | emit dirty(); | 676 | emit dirty(); | ||
677 | } | 677 | } | ||
678 | } | 678 | } | ||
679 | 679 | | |||
680 | QStringList KReportDesigner::fieldNames() const | 680 | QStringList KReportDesigner::fieldNames() const | ||
681 | { | 681 | { | ||
682 | QStringList qs; | 682 | QStringList qs; | ||
683 | qs << QString(); | 683 | qs << QString(); | ||
684 | if (d->kordata) | 684 | if (d->dataSource) | ||
685 | qs << d->kordata->fieldNames(); | 685 | qs << d->dataSource->fieldNames(); | ||
686 | 686 | | |||
687 | return qs; | 687 | return qs; | ||
688 | } | 688 | } | ||
689 | 689 | | |||
690 | QStringList KReportDesigner::fieldKeys() const | 690 | QStringList KReportDesigner::fieldKeys() const | ||
691 | { | 691 | { | ||
692 | QStringList qs; | 692 | QStringList qs; | ||
693 | qs << QString(); | 693 | qs << QString(); | ||
694 | if (d->kordata) | 694 | if (d->dataSource) | ||
695 | qs << d->kordata->fieldKeys(); | 695 | qs << d->dataSource->fieldKeys(); | ||
696 | 696 | | |||
697 | return qs; | 697 | return qs; | ||
698 | } | 698 | } | ||
699 | 699 | | |||
700 | void KReportDesigner::createProperties() | 700 | void KReportDesigner::createProperties() | ||
701 | { | 701 | { | ||
702 | QStringList keys, strings; | 702 | QStringList keys, strings; | ||
703 | d->set = new KPropertySet; | 703 | d->set = new KPropertySet; | ||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 781 | if (p.name() == "page-unit") { | |||
787 | d->set->property("margin-top").setOption("unit", newstr); | 787 | d->set->property("margin-top").setOption("unit", newstr); | ||
788 | d->set->property("margin-bottom").setOption("unit", newstr); | 788 | d->set->property("margin-bottom").setOption("unit", newstr); | ||
789 | } | 789 | } | ||
790 | } | 790 | } | ||
791 | 791 | | |||
792 | void KReportDesigner::slotPageButton_Pressed() | 792 | void KReportDesigner::slotPageButton_Pressed() | ||
793 | { | 793 | { | ||
794 | #ifdef KREPORT_SCRIPTING | 794 | #ifdef KREPORT_SCRIPTING | ||
795 | if (d->kordata) { | 795 | if (d->dataSource) { | ||
796 | QStringList sl = d->kordata->scriptList(); | 796 | QStringList sl = d->dataSource->scriptList(); | ||
797 | sl.prepend(QLatin1String("")); | 797 | sl.prepend(QLatin1String("")); | ||
798 | d->script->setListData(sl, sl); | 798 | d->script->setListData(sl, sl); | ||
799 | } | 799 | } | ||
800 | changeSet(d->set); | 800 | changeSet(d->set); | ||
801 | #endif | 801 | #endif | ||
802 | } | 802 | } | ||
803 | 803 | | |||
804 | QSize KReportDesigner::sizeHint() const | 804 | QSize KReportDesigner::sizeHint() const | ||
▲ Show 20 Lines • Show All 729 Lines • Show Last 20 Lines |
kordata -> dataSource