🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #310311

Re: Sztuka Kodowania w C++ - Nowa Wersja!

#310311
From: Adam M
Date: Wed, 09 Dec 2020 17:29
56 lines
3670 bytes
On Wednesday, December 9, 2020 at 11:01:25 AM UTC-5, heby wrote:
> On 09/12/2020 16:35, Jacek Jaworski wrote: 
> > Czyli mamy klasy: 
> > class MojaKontrolka {...}; 
> > class Etykieta : public QLabel, public MojaKontrolka {...};
> A czemu to nie może być MojaKontrolka< QLabel >, gdzie MojaKontrolka 
> wyglada tak: 
> 
> template < _T > 
> class MojaKontrolka : public _T

To zadziala ale twoj template musi akumulowac kod aby obsluzyc wszystkie sytuacje gdzie zachodzi interakcja pomiedzy twoim kodem a klasami QTw przypadku dziedziczenia wielobazowego MojaKontrolka ma tylko podstawowy kod a caly "glue code" idzie do implementacji poszczegolnych klas - nie musisz pisac kody na wszystkie mozliwe klasy QT ale tylko na te ktor ci sa potrzebebne i tylko wtedy kiedy ci sa potrzebne. Zreszta uzywanie dzieciczenia wielobazowego przy pracy z QT to standard - ponizszy przyklad z kodu na produkcji:

#ifndef __DSPINVENTORYAVAILABILITYBYSOSHIPPINGDATE__
#define __DSPINVENTORYAVAILABILITYBYSOSHIPPINGDATE__

#include "guiclient.h"
#include "display.h"
#include <parameter.h>

#include "ui_dspInventoryAvailabilityBySoShippingDate.h"

class dspInventoryAvailabilityBySoShippingDate : public display, public Ui::dspInventoryAvailabilityBySoShippingDate
{
	Q_OBJECT
public:
	dspInventoryAvailabilityBySoShippingDate(QWidget* parent = 0, const char* name = 0 , Qt::WindowFlags fl = Qt::Window);

    virtual bool setParams(ParameterList & params);
    

public slots:
    virtual SetResponse set(const ParameterList & pParams );
    virtual void sFillList();
    virtual void sFilterSetSaved(int filterId);
    virtual void sFilterUpdated(int filterId);
    virtual void sClearFilter();
    virtual void closeEvent( QCloseEvent * pEvent );

protected slots:
    virtual void languageChange();

private:
	int _lastFilterId;
	int _runSequence;
	int _lastSearchGroup;
	int _lastLookAheadDays;
	QString getCheckBoxFilters();
	void removeTempResults(int runSeq);
	int prepareNewTempResults(const ParameterList & params);
    
};



#endif // __DSPINVENTORYAVAILABILITYBYSOSHIPPINGDATE__
Technical Details
Message-ID: <82264c0b-0b5f-4a44-9a8d-75d8022264ban@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
References: <478ab743-cd00-4961-88e1-983025db304bn@googlegroups.com> <d9830106-c21a-4564-b45f-0766ef86181fn@googlegroups.com> <cdd14123-89b7-4f80-9f2b-865f1038810an@googlegroups.com> <e38a42c4-36d3-49b6-8644-468f65828f4cn@googlegroups.com> <edd1ce6a-46e1-4883-8943-db4a0da8da33n@googlegroups.com> <8d469f13-e697-4488-8adf-29117a3eeb8cn@googlegroups.com> <rqqscj$p0n$1@dont-email.me>

Show Full Headers
Complete Article Headers
X-Received: by 2002:a05:620a:22ab:: with SMTP id p11mr4206821qkh.237.1607534965426;        Wed, 09 Dec 2020 09:29:25 -0800 (PST)
X-Received: by 2002:a37:341:: with SMTP id 62mr4288762qkd.221.1607534965113; Wed, 09 Dec 2020 09:29:25 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.c
Date: Wed, 9 Dec 2020 09:29:24 -0800 (PST)
In-Reply-To: <rqqscj$p0n$1@dont-email.me>
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=50.248.133.1; posting-account=aFGPVQoAAADngh59qlchYygiuB87zBBU
NNTP-Posting-Host: 50.248.133.1
References: <478ab743-cd00-4961-88e1-983025db304bn@googlegroups.com> <d9830106-c21a-4564-b45f-0766ef86181fn@googlegroups.com> <cdd14123-89b7-4f80-9f2b-865f1038810an@googlegroups.com> <e38a42c4-36d3-49b6-8644-468f65828f4cn@googlegroups.com> <edd1ce6a-46e1-4883-8943-db4a0da8da33n@googlegroups.com> <8d469f13-e697-4488-8adf-29117a3eeb8cn@googlegroups.com> <rqqscj$p0n$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <82264c0b-0b5f-4a44-9a8d-75d8022264ban@googlegroups.com>
Subject: Re: Sztuka Kodowania w C++ - Nowa Wersja!
From: Adam M <amorawski@magna-power.com>
Injection-Date: Wed, 09 Dec 2020 17:29:25 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit