mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
Retrait du menu et des fonctions liees a l'antialiasing du DiagramView
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@57 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -8,7 +8,12 @@
|
|||||||
*/
|
*/
|
||||||
void DiagramView::initialise() {
|
void DiagramView::initialise() {
|
||||||
setInteractive(true);
|
setInteractive(true);
|
||||||
setAntialiasing(true);
|
|
||||||
|
// active l'antialiasing
|
||||||
|
setRenderHint(QPainter::Antialiasing, true);
|
||||||
|
setRenderHint(QPainter::TextAntialiasing, true);
|
||||||
|
setRenderHint(QPainter::SmoothPixmapTransform, true);
|
||||||
|
|
||||||
setScene(scene = new Diagram(this));
|
setScene(scene = new Diagram(this));
|
||||||
setDragMode(RubberBandDrag);
|
setDragMode(RubberBandDrag);
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
@@ -35,26 +40,6 @@ DiagramView::DiagramView(QWidget *parent) : QGraphicsView(parent) {
|
|||||||
initialise();
|
initialise();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Permet de savoir si le rendu graphique du DiagramView est antialiase ou non.
|
|
||||||
@return Un booleen indiquant si le DiagramView est antialiase
|
|
||||||
*/
|
|
||||||
bool DiagramView::antialiased() const {
|
|
||||||
return(antialiasing);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Active ou desactive l'antialiasing pour le rendu graphique du DiagramView.
|
|
||||||
@param aa un booleen indiquant si le DiagramView doit etre antialiase ou non
|
|
||||||
*/
|
|
||||||
void DiagramView::setAntialiasing(bool aa) {
|
|
||||||
antialiasing = aa;
|
|
||||||
setRenderHint(QPainter::Antialiasing, aa);
|
|
||||||
setRenderHint(QPainter::TextAntialiasing, aa);
|
|
||||||
setRenderHint(QPainter::SmoothPixmapTransform, aa);
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
appelle la methode select sur tous les elements de la liste d'elements
|
appelle la methode select sur tous les elements de la liste d'elements
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -19,8 +19,6 @@
|
|||||||
Diagram *scene;
|
Diagram *scene;
|
||||||
|
|
||||||
// methodes publiques
|
// methodes publiques
|
||||||
bool antialiased() const;
|
|
||||||
void setAntialiasing(bool);
|
|
||||||
bool ouvrir(QString, int * = NULL);
|
bool ouvrir(QString, int * = NULL);
|
||||||
void closeEvent(QCloseEvent *);
|
void closeEvent(QCloseEvent *);
|
||||||
QString nom_fichier;
|
QString nom_fichier;
|
||||||
@@ -39,7 +37,6 @@
|
|||||||
private:
|
private:
|
||||||
bool private_enregistrer(QString &);
|
bool private_enregistrer(QString &);
|
||||||
void initialise();
|
void initialise();
|
||||||
bool antialiasing; // booleen indiquant s'il faut effectuer un antialiasing sur le rendu graphique du DiagramView
|
|
||||||
QList<QGraphicsItem *> garbage;
|
QList<QGraphicsItem *> garbage;
|
||||||
|
|
||||||
void throwToGarbage(QGraphicsItem *);
|
void throwToGarbage(QGraphicsItem *);
|
||||||
|
|||||||
19
qetapp.cpp
19
qetapp.cpp
@@ -178,16 +178,6 @@ void QETApp::toggleFullScreen() {
|
|||||||
setWindowState(windowState() ^ Qt::WindowFullScreen);
|
setWindowState(windowState() ^ Qt::WindowFullScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Active ou desactive l'antialiasing sur le rendu graphique du Diagram
|
|
||||||
*/
|
|
||||||
void QETApp::toggleAntialiasing() {
|
|
||||||
DiagramView *sv = diagramEnCours();
|
|
||||||
if (!sv) return;
|
|
||||||
sv -> setAntialiasing(!sv -> antialiased());
|
|
||||||
toggle_aa -> setText(sv -> antialiased() ? tr("D\351sactiver l'&antialiasing") : tr("Activer l'&antialiasing"));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Dialogue « A propos de QElectroTech »
|
Dialogue « A propos de QElectroTech »
|
||||||
Le dialogue en question est cree lors du premier appel de cette fonction.
|
Le dialogue en question est cree lors du premier appel de cette fonction.
|
||||||
@@ -231,7 +221,6 @@ void QETApp::actions() {
|
|||||||
expand_diagram = new QAction( tr("Agrandir le sch\351ma"), this);
|
expand_diagram = new QAction( tr("Agrandir le sch\351ma"), this);
|
||||||
shrink_diagram = new QAction( tr("R\351tr\351cir le sch\351ma"), this);
|
shrink_diagram = new QAction( tr("R\351tr\351cir le sch\351ma"), this);
|
||||||
|
|
||||||
toggle_aa = new QAction( tr("D\351sactiver l'&antialiasing"), this);
|
|
||||||
zoom_avant = new QAction(QIcon(":/ico/viewmag+.png"), tr("Zoom avant"), this);
|
zoom_avant = new QAction(QIcon(":/ico/viewmag+.png"), tr("Zoom avant"), this);
|
||||||
zoom_arriere = new QAction(QIcon(":/ico/viewmag-.png"), tr("Zoom arri\350re"), this);
|
zoom_arriere = new QAction(QIcon(":/ico/viewmag-.png"), tr("Zoom arri\350re"), this);
|
||||||
zoom_adapte = new QAction(QIcon(":/ico/viewmagfit.png"), tr("Zoom adapt\351"), this);
|
zoom_adapte = new QAction(QIcon(":/ico/viewmagfit.png"), tr("Zoom adapt\351"), this);
|
||||||
@@ -316,7 +305,6 @@ void QETApp::actions() {
|
|||||||
expand_diagram -> setStatusTip(tr("Agrandit le sch\351ma en hauteur"));
|
expand_diagram -> setStatusTip(tr("Agrandit le sch\351ma en hauteur"));
|
||||||
shrink_diagram -> setStatusTip(tr("R\351tr\351cit le sch\351ma en hauteur"));
|
shrink_diagram -> setStatusTip(tr("R\351tr\351cit le sch\351ma en hauteur"));
|
||||||
|
|
||||||
toggle_aa -> setStatusTip(tr("Active / d\351sactive l'antialiasing pour le rendu du sch\351ma courant"));
|
|
||||||
zoom_avant -> setStatusTip(tr("Agrandit le sch\351ma"));
|
zoom_avant -> setStatusTip(tr("Agrandit le sch\351ma"));
|
||||||
zoom_arriere -> setStatusTip(tr("R\351tr\351cit le sch\351ma"));
|
zoom_arriere -> setStatusTip(tr("R\351tr\351cit le sch\351ma"));
|
||||||
zoom_adapte -> setStatusTip(tr("Adapte la taille du sch\351ma afin qu'il soit enti\350rement visible"));
|
zoom_adapte -> setStatusTip(tr("Adapte la taille du sch\351ma afin qu'il soit enti\350rement visible"));
|
||||||
@@ -377,7 +365,6 @@ void QETApp::actions() {
|
|||||||
connect(couper, SIGNAL(triggered()), this, SLOT(slot_couper()) );
|
connect(couper, SIGNAL(triggered()), this, SLOT(slot_couper()) );
|
||||||
connect(copier, SIGNAL(triggered()), this, SLOT(slot_copier()) );
|
connect(copier, SIGNAL(triggered()), this, SLOT(slot_copier()) );
|
||||||
connect(coller, SIGNAL(triggered()), this, SLOT(slot_coller()) );
|
connect(coller, SIGNAL(triggered()), this, SLOT(slot_coller()) );
|
||||||
connect(toggle_aa, SIGNAL(triggered()), this, SLOT(toggleAntialiasing()) );
|
|
||||||
connect(f_mosaique, SIGNAL(triggered()), &workspace, SLOT(tile()) );
|
connect(f_mosaique, SIGNAL(triggered()), &workspace, SLOT(tile()) );
|
||||||
connect(f_cascade, SIGNAL(triggered()), &workspace, SLOT(cascade()) );
|
connect(f_cascade, SIGNAL(triggered()), &workspace, SLOT(cascade()) );
|
||||||
connect(f_reorganise, SIGNAL(triggered()), &workspace, SLOT(arrangeIcons()) );
|
connect(f_reorganise, SIGNAL(triggered()), &workspace, SLOT(arrangeIcons()) );
|
||||||
@@ -456,8 +443,6 @@ void QETApp::menus() {
|
|||||||
// menu Affichage
|
// menu Affichage
|
||||||
menu_affichage -> addMenu(menu_aff_aff);
|
menu_affichage -> addMenu(menu_aff_aff);
|
||||||
menu_affichage -> addSeparator();
|
menu_affichage -> addSeparator();
|
||||||
menu_affichage -> addAction(toggle_aa);
|
|
||||||
menu_affichage -> addSeparator();
|
|
||||||
menu_affichage -> addAction(zoom_avant);
|
menu_affichage -> addAction(zoom_avant);
|
||||||
menu_affichage -> addAction(zoom_arriere);
|
menu_affichage -> addAction(zoom_arriere);
|
||||||
menu_affichage -> addAction(zoom_adapte);
|
menu_affichage -> addAction(zoom_adapte);
|
||||||
@@ -742,7 +727,6 @@ void QETApp::slot_updateActions() {
|
|||||||
zoom_arriere -> setEnabled(document_ouvert);
|
zoom_arriere -> setEnabled(document_ouvert);
|
||||||
zoom_adapte -> setEnabled(document_ouvert);
|
zoom_adapte -> setEnabled(document_ouvert);
|
||||||
zoom_reset -> setEnabled(document_ouvert);
|
zoom_reset -> setEnabled(document_ouvert);
|
||||||
toggle_aa -> setEnabled(document_ouvert);
|
|
||||||
infos_diagram -> setEnabled(document_ouvert);
|
infos_diagram -> setEnabled(document_ouvert);
|
||||||
|
|
||||||
// actions ayant aussi besoin d'un historique des actions
|
// actions ayant aussi besoin d'un historique des actions
|
||||||
@@ -785,9 +769,6 @@ void QETApp::slot_updateActions() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// actions ayant besoin de la connaissance de son mode
|
|
||||||
if (document_ouvert) toggle_aa -> setText(sv -> antialiased() ? tr("D\351sactiver l'&antialiasing") : tr("Activer l'&antialiasing"));
|
|
||||||
|
|
||||||
slot_updateMenuFenetres();
|
slot_updateMenuFenetres();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
qetapp.h
2
qetapp.h
@@ -29,7 +29,6 @@
|
|||||||
void systrayRestore();
|
void systrayRestore();
|
||||||
void quit(QCloseEvent * = NULL);
|
void quit(QCloseEvent * = NULL);
|
||||||
void toggleFullScreen();
|
void toggleFullScreen();
|
||||||
void toggleAntialiasing();
|
|
||||||
void aPropos();
|
void aPropos();
|
||||||
void dialog_print();
|
void dialog_print();
|
||||||
void dialog_export();
|
void dialog_export();
|
||||||
@@ -101,7 +100,6 @@
|
|||||||
QAction *configurer;
|
QAction *configurer;
|
||||||
QAction *entrer_pe;
|
QAction *entrer_pe;
|
||||||
QAction *sortir_pe;
|
QAction *sortir_pe;
|
||||||
QAction *toggle_aa;
|
|
||||||
QAction *f_mosaique;
|
QAction *f_mosaique;
|
||||||
QAction *f_cascade;
|
QAction *f_cascade;
|
||||||
QAction *f_reorganise;
|
QAction *f_reorganise;
|
||||||
|
|||||||
Reference in New Issue
Block a user