qucsattenuator: set bitmaps as resouces

The resouce bitmaps are compiled into on the binary.
This commit is contained in:
Guilherme Brondani Torri 2013-08-08 14:25:54 +02:00
parent d4a729c7e9
commit 7943e9dc1e
4 changed files with 10 additions and 11 deletions

View File

@ -24,7 +24,7 @@
bin_PROGRAMS = qucsattenuator
SUBDIRS = bitmaps
SUBDIRS =
dist_man_MANS = qucsattenuator.1
@ -32,7 +32,10 @@ MOCHEADERS = qucsattenuator.h
MOCFILES = $(MOCHEADERS:.h=.moc.cpp)
qucsattenuator_SOURCES = main.cpp qucsattenuator.cpp \
attenuatorfunc.cpp
attenuatorfunc.cpp qrc_qucsattenuator.cpp
qrc_qucsattenuator.cpp: qucsattenuator.qrc
$(RCC) -o $@ $<
nodist_qucsattenuator_SOURCES = $(MOCFILES)

View File

@ -74,12 +74,9 @@ int main( int argc, char ** argv )
if (var != NULL) {
QDir QucsDir = QDir (var);
QString QucsDirStr = QucsDir.canonicalPath ();
QucsSettings.BitmapDir =
QDir::convertSeparators (QucsDirStr + "/share/qucs/bitmaps/");
QucsSettings.LangDir =
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
} else {
QucsSettings.BitmapDir = BITMAPDIR;
QucsSettings.LangDir = LANGUAGEDIR;
}

View File

@ -42,7 +42,7 @@ QucsAttenuator::QucsAttenuator()
QWidget *centralWidget = new QWidget(this);
setCentralWidget(centralWidget);
setWindowIcon(QPixmap(QucsSettings.BitmapDir + "big.qucs.xpm"));
setWindowIcon(QPixmap(":/bitmaps/big.qucs.xpm"));
setWindowTitle("Qucs Attenuator " PACKAGE_VERSION);
QMenu *fileMenu = new QMenu(tr("&File"));
@ -90,7 +90,7 @@ QucsAttenuator::QucsAttenuator()
topoGrid->addWidget(ComboTopology, 1,0,1,2);
pixTopology = new QLabel(TopoGroup);//====================Pixmap for Topology
pixTopology->setPixmap(QPixmap((QucsSettings.BitmapDir + "att_pi.png")));
pixTopology->setPixmap(QPixmap((":/bitmaps/att_pi.png")));
topoGrid->addWidget(pixTopology,2,0,3,2);
topoGrid->setSpacing(5);
@ -265,21 +265,21 @@ void QucsAttenuator::slotTopologyChanged()
switch(ComboTopology->currentIndex())
{
case PI_TYPE:
pixTopology->setPixmap(QPixmap((QucsSettings.BitmapDir + "att_pi.png")));
pixTopology->setPixmap(QPixmap((":/bitmaps/att_pi.png")));
LabelR2->setText("R2:");
LabelR3->show();
lineEdit_R3->show();
LabelR3_Ohm->show();
break;
case TEE_TYPE:
pixTopology->setPixmap(QPixmap((QucsSettings.BitmapDir + "att_tee.png")));
pixTopology->setPixmap(QPixmap((":/bitmaps/att_tee.png")));
LabelR2->setText("R2:");
LabelR3->show();
lineEdit_R3->show();
LabelR3_Ohm->show();
break;
case BRIDGE_TYPE:
pixTopology->setPixmap(QPixmap((QucsSettings.BitmapDir + "att_bridge.png")));
pixTopology->setPixmap(QPixmap((":/bitmaps/att_bridge.png")));
LabelR2->setText("R4:");
LabelR3->hide();
lineEdit_R3->hide();

View File

@ -31,7 +31,6 @@ struct tQucsSettings
int x, y; // position of main window
QFont font;
QString LangDir;
QString BitmapDir;
QString Language;
};